Skip to content

Instantly share code, notes, and snippets.

@zgulde
Created July 17, 2019 14:08
Show Gist options
  • Save zgulde/bccb681431bf85da3abd079335ddce39 to your computer and use it in GitHub Desktop.
Save zgulde/bccb681431bf85da3abd079335ddce39 to your computer and use it in GitHub Desktop.
#!/usr/bin/env bash
tail -n +3 $0 | pandoc --section-divs --mathjax -o index.html ; exit 0
# Self-Rendering Markdown File
Just make sure you have `pandoc` installed, ignore the first two lines of this
file, and make this file executable (`chmod +x self-rendering.md`).
Then you can run this file to produce it's html output.
```
./self-rendering.md
```
And a `index.html` file will be created.
You can add any additional arguments to `pandoc` in the second line.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment