fantik
v0.0.1
Published
Build presentations from Markdown
Downloads
3
Maintainers
Readme
Fantik
Create Presentation Slides From Markdown
Fantik is a simple wrapper that allows you to create presentation slides from Markdown.
Plugins support (only reveal.js for now).
Configurable.
Subsection slides support.
Enable --watch
feature, edit your slides in your favorite IDE and let Fantik rebuild HTML slides upon saving.
Installation
There are 2 ways how Fantik can be installed: Binary Executable and NPM. The installation via NPM is rather optional way since it is not so convenient as Binary Executable which is preferrable way.
Binary Executable
Go to release page and download binary executable for your platform. This option allows you to run fantik with all default configuration files are included to the binary and without Node.js installed on your system.
If you don't want to specify path before binary name when executing fantik, then put binary to any path from ${PATH}
(e.g. /usr/local/bin
)
NPM
npm install fantik
# or globally
npm install -g fantik
Usage
$ ./fantik --help
Usage: fantik [options] [command]
Build presentations from Markdown
Options:
-V, --version output the version number
-h, --help output usage information
Commands:
build [options] <input> builds html presentation from markdown
list list available plugins
$ ./fantik build --help
Usage: fantik build [options] <input>
builds html presentation from markdown
Options:
--plugin <plugin> which plugin to use (default: "reveal.js")
--config <config> custom configuration (yaml) to use
--out <output> output path (default: input name as inputname.html)
--watch keep watching for presentation and build output as soon as presentation is changed (default: false)
-h, --help output usage information
Configuration
It is possible to override/change default configuration by specifying custom yaml
file with --config
option for build
subcommand.
Custom Configuration
Available options:
markers.slidegroup
- define slide group marker (default:>>>slidegroup
)markers.slide
- define slide marker (default:>>>slide
)stylesAppend
- list of styles to be appended to selected pluginscriptsAppend
- list of JS scripts to be appended to selected pluginstylesOverride
- list of styles to override the selected pluginscriptsOverride
- list of JS scripts to override the selected plugin
NOTE: if both ...Append
and ...Override
options are specified, then ...Append
option takes place.
Custom Configuration Example
stylesAppend:
- '<link href="https://host/custom.css" rel="stylesheet">'
- |
<style>
section, .reveal h1, .reveal h2, .reveal h3, .reveal h4, .reveal h5, .reveal h6 {
font-family: 'Oswald', sans-serif !important;
}
</style>
scriptsAppend:
- '<script src="https://host/custom.js"></script>'
- |
<script>
const msg = 'Hello';
console.log(msg);
</script>
markers:
slidegroup: '***slidegroup'
slide: '***slide'
Example
# Creating slides
$ cat <<EOF | tee slides.tmd
>>>slide
# Presentation Name
>>>slide
# Agenda
>>>slidegroup
>>>slide
### Slide 1
>>>slide
### Slide 2
$ ./fantik build slides.tmd
# Open slides.html in your favorite browser
Building Binaries
You can build binary for Linux/Windows and use Fantik without Node.js installed.
# building binaries
npm install # install dependencies
npm run build-binaries
ls -lh bin/ # list built binaries
Motivation
Got tired of making presentation lectures in plain HTML (despite using reveal.js and its markdown support) copying layout structure over and over again. Hopefully it helps making presentation faster, lighter and transferring styling from lecture to lecture easier.
TODO
- Other presentation engines support (like impress.js, eagle.js)
- PDF export
- Markdown to HTML (for frameworks that don't support Markdown)
- Additional arguments support for slidegroup and slide classes (to be able to style per slidegroup/slide)
- Autodetection of the latest Reveal.js version
- Offline slides (downloads slides framework locally and links it)
- Use more efficient
watch
alternative
License
MIT