Skip to content

Blazemeter/presenter

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

80 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

presenter

Companion to tool present

Summary

Presenter wraps tool present in a small alpine linux image with a statically compiled UPX compressed present binary serving content under ./docroot accessible by a browser launched automatically at URL http://127.0.0.1:8080 (see PRESENTER_HOST, PRESENTER_PORT).

Supports

Description

Default content URL is http://127.0.0.1:8080, override hostname/port with environmental variables see PRESENTER_*, ie. make run -e PRESENTER_PORT=9999

A slide bundle is created for each subdirectory of ./docroot, named <dir>.slide, by concatenating directory's .title file and alphabetically ordered .slide files inside. If <dir>.article doesn't exists its created as a copy of <dir>.slide.

To manage ordering, please use a naming convention like:

./docroot/subject/.title
./docroot/subject/000-intro.slide
./docroot/subject/100-finalwords.slide
./docroot/subject/blog.article

Will be bundled and served as if ./docroot had:

./docroot/subject.slide        # concatenation of subject/.title and subject/*.slide
./docroot/subject.article      # copy of subject.slide
./docroot/subject/blog.article

Above naming scheme guarantees 000-intro will appear in the bundle before 100-final.

  • Directory title file .title must start as a top level section (ie. # title), directories missing a .title get default one created using directory's name as title
  • Above means that individual slides (*.slide files) should start with a subsection ## slide title
  • Non slide files, like above's blog.article, are copied and served without modifications
  • Slide bundles are also served as <dir>.article if there is no such existing article.
  • Organize a mix of .slide and .article files in hierachical subdirectories for maximum impact.

Usage: make help

Environment variables

Env. Variable Description Default Value
PRESENTER_CMD Command to manage image/container docker
PRESENTER_HOST Host name address part to listen 127.0.0.1
PRESENTER_PORT Port of address to listen 8080
PRESENTER_OPENER Preferred application opener xdg-open or open
PRESENTER_EXPORT Exported filename sfx.run

Sharing

Docker image can be exported/saved for sharing (container name is presenter_local), to run it need to expose container's port 80 and use as command: presenter

# export creates sfx.run
$ make export
... share sfx.run ...
# run shared sfx.run
$ sh sfx.run

Title placeholders

Tile files .title have the following placeholders expanded:

PLACEHOLDER VALUE
{{DIR}} Directory name
{{PATH}} Path relative to docroot
{{FULLPATH}} Absolute directory path
{{CURRENT_DATE}} Current date

Example file ./docroot/subject/.title:

# Subject Title: {{DIR}}

Author Name
{{CURRENT_DATE}}
This file is in "{{PATH}}" ({{FULLPATH}})

Renders:

Subject Title: subject
Author Name
dow, dd MMM YYYY HH:mm:ss UTC
This file is in "subject" (/docroot/subject)

Styling

Before compilation templates and styles can be modified in script ./bin/present_patch. Default is to make theme less Go-specific by removing header, footer and re-wording title.

Scenarios

  • Problem: process and serve content in ./docroot
    • Solution: $ make [start]
  • Problem: run presenter for limited time
    • Solution: $ make [start] && sleep 30 && make stop
  • Problem: need to inspect image and/or running container
    • Solution: $ make (inspect|image/inspect|container/inspect)
  • Problem: use podman instead of docker
    • Solution: use PRESENTER_CMD=podman when calling make or sfx.run (see PRESENTER_CMD)
  • Problem: need to listen to a port different than 8080
    • Solution: use PRESENTER_PORT=nnnn when calling make or sfx.run (see PRESENTER_PORT)
  • Problem: need to share presentation
    • Solution: $ make export creates ~10MB sfx.run that can be shared and executed by sh sfx.run (file overwritten per invocation, rename/backup as required; to change filename see PRESENTER_EXPORT)
  • Problem: need shell access to running container
    • Solution: $ make shell

      $  make shell
      /docroot #
      

Releases

No releases published

Packages

No packages published

Languages

  • Shell 50.8%
  • Makefile 42.0%
  • Dockerfile 7.2%