-
Create GitHub repo & write Markdown into README.md (all the time, as you do research)
-
Create gh-pages Branch & Markdown for presentation
-
Use Pandoc to convert Markdown into Reveal.js HTML (locally)
-
Automatically publish Reveal.js Markdown on GitHub Pages with Pandoc & Travis CI
Create new GitHub repository incl. README.md
.
git clone https://github.com/yourUserName/yourRepoName.git
Now clone this repository & use the README.md
as thought bin for everything about that topic that seems to be remarkable and may somehow find their way into the presentation later.
If you've done enough research, create a new Markdown file presentation.md
inside the repository.
This file uses Markdown that will be transformed to reveal.js powered HTML later. Here's an example:
% Title
% Name
% yyyy/mm/dd
# Header1
---
### Header3
- foo
- bar
- foobar
---
### header
1. foo
1. bar
1. baz
# HEADER
---
_foo_
__bar__
___baz___
[foobar_link](https://github.com/hakimel/reveal.js/#full-setup)
> foo bar
> baz
A ---
delimits slides, the rest is simple elegant Markdown :)
Instead of Pandoc you could also use reveal.js' build in Markdown integration, but this seems to be a bit more error prone and pollutes the output of raw HTML or PDF. Another approach would be to use reveal-md.
Install pandoc:
brew install pandoc
Create a docs
folder for the pandoc output:
mkdir docs
Run pandoc with the -t revealjs
parameter (more details in the docs):
pandoc \
--standalone \
-t revealjs \
-o docs/index.html \
presentation.md \
-V revealjs-url=https://revealjs.com \
-V theme=solarized
Change your theme with the -V theme=yourChosenTheme
parameter as you like.
⚠️ If you have custom githubuser.github.io repo configured, this may lead to a accessible site: The problem is, that if you already configured a githubuser.github.io repo to serve a GitHub page - and configured it with a custom domain name, all the other repositories will try to use that custom domain name also - which won't work, since there's no CNAME configured etc. (see the docs, this issue and see this webapps.stackexchange q&a)
Travis CI can deploy your static files to GitHub Pages after a successful build (see docs)
Therefor create a .travis.yml
inside your GitHub repository. It installs pandoc
, creates the output directory docs
and executes it to generate our reveal.js powered HTML:
---
before_install:
# Install pandoc
- sudo apt-get update
- sudo apt-get -y install pandoc
- pandoc --version
script:
# create docs directory for pandoc output
- mkdir docs
# Generate reveal.js powered HTML from Markdown
- pandoc --standalone -t revealjs -o docs/index.html presentation.md -V revealjs-url=https://revealjs.com -V theme=solarized
# Deploy to GitHub pages (see https://docs.travis-ci.com/user/deployment/pages/)
deploy:
provider: pages
local_dir: docs
skip_cleanup: true
github_token: $GITHUB_TOKEN # Set in the settings page of your repository, as a secure variable
keep_history: true
on:
branch: master
Then in the deploy
section it deployes the static files to GitHub pages. The skip_cleanup: true
parameter is important, otherwise our generated HTML will be lost before uploading to pages. Be also sure to generate a personal access token inside your GitHub settings at https://github.com/settings/tokens with the public_repo
scope.
Then create a new environment variable inside your TravisCI project settings at https://travis-ci.org/yourGitHubName/yourRepoName/settings called GITHUB_TOKEN
and fill in the generated token.
Finally add docs
to your .gitignore
file to prevent uploading the locally generated HTML and commit/push to your GitHub repository. Travis CI will automatically setup your repository to server GitHub pages after the first successfull run.
https://ebildungslabor.de/blog/revealjs/
https://medium.com/isovera/devops-for-presentations-reveal-js-markdown-pandoc-gitlab-ci-34d07d2c1011
https://martinmurphy.tech/2018/04/using-github-pages-for-presentations/