created by theno | 2017-01-05 | online | src |
“A framework for easily creating beautiful presentations using HTML.”
– https://github.com/hakimel/reveal.js
Markdown support -> easy editing:
Don’t bother with HTML syntax
Write slides in a markdown file
Writing slides in Markdown is easy:
## reveal.js
> "A framework for easily creating beautiful presentations using HTML."
>
> -- <cite>https://github.com/hakimel/reveal.js</cite>
* It's basically a website displayed in a browser
* Works better with Chrome than Firefox
* Markdown support -> easy editing:
* Don't bother with xml syntax
* Write slides in a markdown file
Some reveal.js presentations: * “Official” demo: http://lab.hakim.se/reveal-js * http://slid.es/gsklee/functional-programming-in-5-minutes * http://www.adidahiya.com/design.html * http://slides.drublic.de/awesome-code * http://hoebel.net/presentations_archive/saltstack/saltstack.html
More demos: https://github.com/hakimel/reveal.js/wiki/Example-Presentations
“Fabric is a Python (2.5-2.7) library and command-line tool for streamlining the use of SSH for application deployment or systems administration tasks.”
– http://www.fabfile.org/
>>shell-deploy-scripts on steroids!<<
fabfile.py
contains the fabric tasks
fab
executes a taskexample fabfile.py
:
from fabric.api import env, run, task
@task
def show_ips():
ips = run('/bin/hostname -I')
print('IPs of {}:\n {}'.format(env.host, ips))
fab
uses the fabfile of the current dir:
> ls
fabfile.py
> fab show_ips -H user@example_host
[example_host] Executing task 'ip_addresses'
[example_host] run: hostname -I
[example_host] out: 1.2.3.4
IPs of mobi12.uni.cx:
1.2.3.4
Done. Disconnecting from example_host... done.
Collection of fabric tasks:
* set up an owncloud server
* set up an own android app repository (own F-Droid server)
* set up a linux desktop:
eg. configure vim, tmux, solarized colors (dotfiles on steroids!)
* set up …
*
set up everything you need for a reveal.js presentation:
sh
fab setup.revealjs
boilerplate for getting started on a nice reveal.js presentation:
* reveal.js code installed (comes with built-in plugins)
* Additional reveal.js plugins installed
* index.html
prepared accordingly
* All slides are defined in slides.md
install fabsetup:
sh
sudo apt-get install git fabric #
mkdir -p ~/repos && cd ~/repos
git clone https://github.com/theno/fabsetup
run fabric task setup.revealjs
:
sh
cd ~/repos/fabsetup
fab setup.revealjs -H localhost
Asks for: * Presentation base directory * Title * Sub-title * Short description
Optionally: * Create github repo * Download npm libs
When running again (also optional): * Re-install reveal.js codebase
~/repos/my_presi> tree
.
├── .git/
├── .gitignore
│
├── README.md <-- Short description and usage
│
├── slides.md <-- All slides are defined here
├── index.html <-- Configuration
├── img/
│ └── thanks.jpg <-- good place for images
│
└── reveal.js/ <--.
├── css/ `-- reveal.js code "hidden" in a subdir
├── js/ (keeps the basedir clean)
├── plugin/
...
├── img -> ../img \
├── reveal.js -> ../reveal.js |_ symbolic links in order
├── slides.md -> ../slides.md | to run `npm start`
└── index.html -> ../index.html /
template features
All the built-in plugins are enabled in the index.html
:
* marked.js, markdown.js: Markdown support
* highlight.js: Code syntax highlighting
* zoom.js: Zoom in and out with ALT+click
* notes.js: Speaker notes
* math.js: Formatting math expressions
This additional plugins will be installed and set up, too: * menu.js: Slideout menu (slide index, change theme and transition) * toc-progress.js: “LaTeX Beamer-like progress indicator” * title-footer.js: “Footer showing title of presentation”
Two dividers exist:
* New horizontal slide: \n---- ----\n
* New vertical slide: \n----\n
Win-win:
* “Raw” slides.md
: Easy to read and edit
* Horizontal lines in rendered Markdown: Easy to read, too
cumbersome. * With decktape
cd ~/bin/decktape/active && \ #
./phantomjs decktape.js --size 1280x800 URL ~/repos/my_presi/my_presi.pdf
slides.md
rendered by github into a PDF:
https://github.com/theno/revealjs_template/blob/master/slides.mdNote: URL can be of: * localhost:8000 * github.io page
Checkout the template presentation repo:
sh
git clone https://github.com/theno/revealjs_template ~/repos/my_presi
Then:
* Adjust <title>reveal.js template</title>
in index.html
* Edit slides.md
* Add symbolic link:
sh
cd ~/repos/my_presi && ln -snf ../reveal.js reveal.js/reveal.js
A github repo (with index.html
) can be rendered into a github.io page
Add remote repo at github.com
(automated in fabsetup task setup.revealjs)
Configure entry point for github.io page
(manually, select “master branch”)
fab setup.revealjs
(one of this tasks):
Creates the boilerplate of your presentation:
* Clean basedir (reveal.js codebase hidden in a subdir)
* Slides are written in a Markdown file
* Usefull plugins enabled (eg. footer, toc, menu)
* Versioning with git
* Publishing at github.io
>>just edit the slides.md<<
setup.revealjs
Alternative:
prez – “Opiniated Reveal slideshow generator with nice PDF output and ability to treat notes as first-class content.”