Rendering Presentations made with Go's present tool

Greetings Hugo users,

I want to say that I’m sorry in advance if this topic has ever been brought to discussion before.
I tried searching for it but couldn’t find any relevant results.

I have a blog that I made with Hugo (hosted on Github Pages) and I was planning to upload some
presentations that I made using the present tool from Go’s toolchain.
The way that I was going to go about it was to export my slides from the browser as a PDF nad
upload the PDF files but then I realized that it would be great if I could just render them right away
from my blog.

Has anyone tried this before? I’m sure I’m not the first one.
If yes, could you please share how you did it?
If not, would other hugo users be interested in such a feature?

Regards

1 Like

I’m assuming you don’t want Hugo to build those pages since present takes care of that. If I were you, I’d just render them with present and put the output in the Hugo static directory.

2 Likes

Hugo can’t create PDFs, an external tool is needed.

A few people have discussed creating PDFs with Hugo.

I don’t think anyone has done this with Hugo alone.

I am good with current tooling in this area, such as Pandoc. We don’t really vote for features in Hugo, but I would say no if we did. PDFs aren’t in the base experience of building websites. :slight_smile:

You misunderstood my question.

I was asking what’s a good way for Hugo to render presentations made with the go present tool,
not make Hugo export pdfs.

Good thing @moorereason gotcha covered:

Yeah that should probably work, thanks!

I just tried out present. Running present serves the HTML on localhost. But how do you export the slides to HTML?

I was surprised to see how the Go present markup is a hybrid of Org mode (headings, bold, links, bullets) and Markdown (italics, code) :slight_smile:

Do you have a way to export the present slides to HTML from the command line? Or do you just “Save As” from the browser?

Hey! Sorry for the late reply!

Assuming you don’t have embedded videos or playground snippets you can just open your presentation while present is running and hit Ctrl+S to save the html together with whatever javascript/css is used.

Hope that helps!

Thanks for the reply.

I feared that was the only way :frowning: … I was looking for a command-line approach to save the .slide files to HTML.

Also, as I learned by googling more, it looks like present isn’t maintained. There are issues I stumbled across that were opened 4 years back. But no one has cared to fix those.

Yeah I know. I personally really like present as it is -
writing the skeleton of your presentation in a plain text file means you are close to 90% done.

That said if I ever need anything more I’ve heard remark.js is pretty similar
and has friendlier integration with Hugo.

I just thought I’ll mention this for you and anyone else that is looking into this subject for future reference.

Thanks. I have been using reveal.jsremark.js seems to be in the same category.

… and there’s also https://webslides.tv

Go present looked promising because of its simple Org/Markdown-like markup. Sad to see it not being maintained.

FWIW, I merged a change into present last month. If you want to submit changes, the team is willing to accept them.

1 Like

How would you integrate this in Hugo? With a lot of shortcodes?

TL;DR: Design an Org exporter that exports to webslides, bake that into ox-hugo, and have Hugo sites with embedded slides sections.


My ulterior plan is to design an Org-mode to HTML slide exporter (such already exists for export to reveal.js slides), and then move the exported HTML to the Hugo static/ dir.

That ties in well with my ox-hugo project. Reveal.js slides are good, but webslides.tv looks like much more fresh.

Go present attracted me because of its markup syntax, which would be easy to convert from Org, but alas it’s a mostly dead project.

FWIW I have the same need. The reason for using the present tool format is the .code / .play sections to embed editable code made of selected parts of a file and run the whole file in the playground live while presenting. It’s pretty magical for audiences.

In reading through this 4 years old thread (1 year in Hugo is a lifetime, trust me) not much changed. Put your presentation in a folder and use a shortcode that embeds the presentation? If that leads to issues please open a NEW issue (or maybe stay within the past 6 months :wink: ) For the Javascript we have pipes now. And I am pretty sure a lot changed in the present tool too.

That would not work natively, as these need a present server instance to run the WebSocket code generated by that tool.

In the meantime I’ve been going another way: using the x/tools/present package which already parses this format to generate HTML pages, and from there use them as individual pages in a multi-page article. Looks promising, generating one page per slide, and much better for SEO than the embed I’m currently using. Would be even better if there was a way to embed that compilation in Hugo one way or another, but it’s better than nothing.