Richard Wen
[email protected]
Personal template for reveal.js presentations with Python cookiecutter.
- Install Python
- Install cookiecutter via
pip
pip install cookiecutter
- Create a template using cookiecutter
- Change the directory to the folder with the same name as the
template_name
input - Install dependencies with npm
- Render HTML slides in the
docs
folder - Render PDF slides in the
slides
folder
cookiecutter gh:rrwen/cookiecutter-reveal
cd <template_name>
npm install
npm run html
npm run pdf
See Implementation for more details.
- Ensure git is installed
- Change directory to the generated folder
cd <template_name>
- Initialize the repository
- Add the generated files to commit
- Create an empty Github repository with the same name as
template_name
- Pull any changes if the Github repository is not empty
- Push the commit from
4.
to your created Github repository
git init
git add .
git commit -a -m "Initial commit"
git remote add origin https://github.com/<github_user>/<template_name>.git
git pull origin master --allow-unrelated-histories
git push -u origin master
This code creates folders and files for cookiecutter templates.
- The main file is cookiecutter.json which defines the inputs for the command line interface
- The inputs then replace any values surrounded with
{{}}
inside the folder {{cookiecutter.template_name}}
cookiecutter <-- template tool
|
cookiecutter.json <-- template inputs
|
{{cookiecutter.template_name}} <-- generated template
The following files will be created inside a folder with the same name as the template_name
input:
File | Description |
---|---|
docs/edit/logo.png | Logo image to show on slides |
docs/edit/style.css | CSS file for styling the slides |
slides/<file_name>.md | Markdown file containing the slide contents |
template.html | A reveal-md custom template file for generating slides |
.gitignore | A Node .gitignore automatically generated from github |
.npmignore | A file to specify ignoring docs/* |
LICENSE | MIT license file automatically created from github |
.travis.yml | A .travis.yml file for automatic builds and tests |
package.json | The npm package.json specifications with reveal-md and decktape dependencies |
README.md | a readme Markdown file with header section |