Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

x/tools/cmd/present: export to static site #19119

Open
kaihendry opened this issue Feb 16, 2017 · 2 comments

Comments

@kaihendry
Copy link

commented Feb 16, 2017

Please answer these questions before submitting your issue. Thanks!

What version of Go are you using (go version)?

go version devel +9cd3c0662a Thu Dec 15 20:06:07 2016 +0000 linux/amd64

What operating system and processor architecture are you using (go env)?

amd64

What did you do?

Try to export slideshow via Chrome's Ctrl+S so others can share a static URL of my slide show.

What did you expect to see?

The video embed

What did you see instead?

Missing video

https://youtu.be/RTqoa_AGHOE has details of the issue

@bradfitz bradfitz added this to the Unreleased milestone Mar 21, 2017

@bradfitz bradfitz changed the title tools/cmd/present: export to static site x/tools/cmd/present: export to static site Mar 21, 2017

@bradfitz

This comment has been minimized.

Copy link
Member

commented Mar 21, 2017

This is more of a Chrome bug than anything.

I suppose you could youtube-dl the video locally and then embed some HTML in the presentation to render the local video the same as a local image.

/cc @broady @campoy

@leighmcculloch

This comment has been minimized.

Copy link
Contributor

commented Apr 27, 2019

I think go present tool lends itself well to offering to generate static output as it makes it much simpler to deploy or share a presentation, and the resulting output if not being used with the play feature is static anyway. We shouldn't need to use Chrome to save a copy. Examples of where this can be handy:

  • To deploy the talk to GitHub Pages, Netlify, any other static file host.
  • To display the talk on a presentation computer that has no internet connectivity and doesn't have present on it to run.
  • To display a talk containing sensitive information that can't be hosted on any public URL and the presentation computer doesn't have present on it to run.

At the moment I use the following commands to save a static version:

curl -s http://127.0.0.1:39999/static/notes.js > build/static/notes.js
curl -s http://127.0.0.1:39999/static/slides.js | sed -E 's/(\/static\/)/.\1/' > build/static/slides.js
curl -s http://127.0.0.1:39999/static/styles.css > build/static/styles.css
curl -s http://127.0.0.1:39999/static/notes.css > build/static/notes.css
curl -s http://127.0.0.1:39999/talk.slide | sed -E 's/(\/static\/)/.\1/' | s -E '/play\.js/d' > build/index.html

But the tool could have an argument that generates static files instead of starting a web server. Example possible usage:

present -notes -out=build/
$ present -h
Usage of present:
  -base string
        base path for slide template and static resources
  -content string
        base path for presentation content (default ".")
  -http string
        HTTP service address (e.g., '127.0.0.1:3999') (cannot be present with -out) (default "127.0.0.1:3999")
  -nacl
        use Native Client environment playground (prevents non-Go code execution) when using local WebSocket transport
  -notes
        enable presenter notes (press 'N' from the browser to display them)
  -orighost string
        host component of web origin URL (e.g., 'localhost')
  -out string
        output path to generate the presentation as static files (cannot be present with -http)
  -play
        enable playground (permit execution of arbitrary user code) (default true)
  -use_playground
        run code snippets using play.golang.org; if false, run them locally and deliver results by WebSocket transport

Would the Go team accept a PR adding static output capability? I'd like to to open a PR with it.

@gopherbot gopherbot added the Tools label Sep 12, 2019

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
5 participants
You can’t perform that action at this time.