Git Product home page Git Product logo

examdown's Introduction

Examdown

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.28.2
cmark 0.27.1 - CommonMark converter
wkhtmltopdf 0.12.3.2
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 is missing, two recipes are provided to help you obtain it:

$ make -s build-cmark
$ sudo make -s install-cmark

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

$ sudo apt install 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.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.