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

Closed
kaihendry opened this issue Feb 16, 2017 · 3 comments
Closed

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

kaihendry opened this issue Feb 16, 2017 · 3 comments
Labels
FeatureRequest FrozenDueToAge Tools This label describes issues relating to any tools in the x/tools repository.
Milestone

Comments

@kaihendry
Copy link

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
Copy link
Contributor

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
Copy link
Contributor

leighmcculloch 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 This label describes issues relating to any tools in the x/tools repository. label Sep 12, 2019
@seankhliao
Copy link
Member

Duplicate of #12635

@seankhliao seankhliao marked this as a duplicate of #12635 Oct 16, 2021
@rsc rsc unassigned broady Jun 23, 2022
@golang golang locked and limited conversation to collaborators Jun 23, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
FeatureRequest FrozenDueToAge Tools This label describes issues relating to any tools in the x/tools repository.
Projects
None yet
Development

No branches or pull requests

6 participants