GithubHelp home page GithubHelp logo

idiv-biodiversity / pandoc-cheat-sheet Goto Github PK

View Code? Open in Web Editor NEW
23.0 4.0 6.0 18 KB

cheat sheet templates for pandoc

License: Creative Commons Attribution Share Alike 4.0 International

Makefile 10.55% HTML 14.27% TeX 75.18%
pandoc pandoc-templates cheat-sheet cheatsheet cheat-sheets cheatsheets refcard

pandoc-cheat-sheet's Introduction

Pandoc Cheat Sheet Templates

This project contains cheat sheet templates to be used with pandoc. Cheat sheets try to fit as much content as possible onto few pages. Both the LaTeX and the HTML template utilize columns to achieve that.

Variables

The variables are more or less what you expect from the default pandoc templates.

Some variables have been purposefully removed to keep both the template codes and the output comparatively simple. The original templates were very general, but for a cheat sheet we don't need that much functionality. Notable removals from the default templates include:

  • abstract
  • table of contents
  • bibliography
  • everything regarding LaTeX beamer

There have only been a very few additions. An example variable template containing these can be found in the example-variables.yml file. This file contains comments to explain why these variables should be used as default.

Usage

The templates support both PDF documents and HTML web pages. This way, you can easily create both with just a single input file. The examples use Markdown as the input file format.

PDF

Create the PDF cheat sheet:

pandoc                                \
  --standalone                        \
  --from=markdown+yaml_metadata_block \
  --template=cheat-sheet.tex          \
  --pdf-engine=xelatex                \
  -o my-topic-cheat-sheet.pdf         \
  my-topic-cheat-sheet.yml            \
  my-topic-cheat-sheet.md

HTML

Create the HTML cheat sheet:

pandoc                                \
  --standalone                        \
  --from=markdown+yaml_metadata_block \
  --template=cheat-sheet.html         \
  -o my-topic-cheat-sheet.html        \
  my-topic-cheat-sheet.yml            \
  my-topic-cheat-sheet.md

You can open this page locally or put in on a web server.

Makefile

Because these pandoc command-lines are long and cumbersome to write, there is also a very generic Makefile contained in this repository. Assuming your input file ends in -cheat-sheet.md, e.g. my-topic-cheat-sheet.md, then you just need to type make to create all cheat sheet variants.

Anytime you change either one of the sources, i.e. your Markdown file, the YAML metadata file or one of the templates, just retype make and it will rebuild the files whose sources changed.

git submodule

This is how you would create a fresh project and add cheat sheet as a git submodule:

# create a new project
mkdir topic-cheat-sheet
cd topic-cheat-sheet
git init

# create dummy content
echo '# cheat sheet about topic' > topic-cheat-sheet.md
git stage topic-cheat-sheet.md

# add submodule
git submodule add https://github.com/idiv-biodiversity/pandoc-cheat-sheet.git

# link the cheat sheet files into your project
ln -s -t . pandoc-cheat-sheet/cheat-sheet.* pandoc-cheat-sheet/Makefile
git stage cheat-sheet.* Makefile

# copy the metadata template to your project
cp pandoc-cheat-sheet/example-variables.yml topic-cheat-sheet.yml
git stage topic-cheat-sheet.yml

# ignore the cheat sheet products
echo topic-cheat-sheet.html >> .gitignore
echo topic-cheat-sheet.pdf  >> .gitignore
echo topic-cheat-sheet.tex  >> .gitignore
git stage .gitignore

# create the cheat sheets
make

# done, review the cheat sheets and make a git commit whet you're ready:
# - xdg-open topic-cheat-sheet.html
# - xdg-open topic-cheat-sheet.pdf
# - git commit -m 'initial commit'

pandoc-cheat-sheet's People

Contributors

hayribakici avatar wookietreiber avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

pandoc-cheat-sheet's Issues

Add overall headline

Hello.

I'm trying to implement an overall headline as a title for the cheat sheet but unfortunately without success so far.

Maybe there is the possibility to set the title from the variables.yml as headline.

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.