Skip to content

redsolver/examdown

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

31 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Examdown

Forked from https://github.com/pldiiw/examdown, switched from cmark to cmark-gfm

Write your exam with Markdown + AsciiMath, deliver a PDF

I sometimes need to write documents with equations in it. Word is way too cumbersome to use. LaTeX is awesome but complex. Why not just use the simplicity of Markdown syntax and intuitiveness of AsciiMath ? That's what this little bash script provides.

Install

Clone the repo:

$ git clone --recursive https://github.com/pldiiw/examdown.git

First, check that you have all the dependencies:

$ make -s checkdeps
getopt from util-linux 2.35.1
cmark-gfm 0.29.0.gfm.0 - CommonMark with GitHub Flavored Markdown converter
wkhtmltopdf 0.12.5
vendor/github-markdown-css/github-markdown.css
vendor/MathJax/MathJax.js

If the output looks like this, then you have all the dependencies needed.

If cmark-gfm is missing, install it with your favorite package manager, like pacman:

$ sudo pacman -S cmark-gfm

Or get it here: https://github.com/github/cmark-gfm

If wkhtmltopdf is missing, install it with your favorite package manager, like pacman:

$ sudo pacman -S wkhtmltopdf

If the two last ones are missing, just run these two commands:

$ git submodule init
$ git submodule update --recursive

Now that you have all the dependencies, run make -s build to set up the hierarchy needed for examdown to work.

$ make -s build

From there, you can run the tests to check that everything is ok:

$ make -s test

If the tests went right, you can now install the hierarchy generated by our build recipe to /usr/local by default:

$ sudo make -s install

If you wish to install it somewhere else, just override the PREFIX variable:

$ make -s install PREFIX="$HOME/.local"

If you installed examdown to some gloomy path, like above, be sure that the bin folder where examdown lies is in your $PATH variable.

Check that the installation worked:

$ examdown --help

You're done!

If you want to uninstall examdown, use the uninstall recipe:

$ sudo make -s uninstall

Do not forget to specify the PREFIX variable again if you modified it during the installation.

Usage

The following syntax is supported in the Markdown files:

See test/test.md for an example.

$ examdown --help
Markdown + AsciiMath -> PDF

Usage:
  examdown [options] <input-file>

Options:
  -o, --out <file>    - Save output to <file>. Defaults to 'out.pdf'.
  -O                  - Save output to a file with the same name and
                        in the same directory as the input file.
  -s, --css <file>    - Use <file> as the CSS for the output document.
                        If unspecified, will use a built-in CSS file.
  -t, --title <title> - Set title of document to <title>.
  -d, --delay <ms>    - Wait specified amount of milliseconds for the
                        javascript to render the math equations.
                        Defaults to 3000.
  -h, --help          - Display this help notice.

Contribute

Any suggestion or improvement is welcome!
Open an issue and we will discuss about it!

For the code style, please stick to Bahamas10' Bash Style Guide and use Shellcheck as a linter.

LICENSE

This repository is under the Unlicense, see LICENSE file for more information.

About

Write your exam with Markdown + AsciiMath, deliver a PDF

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Shell 64.8%
  • Makefile 35.2%