Skip to content

Instantly share code, notes, and snippets.

@airicbear
Created August 18, 2019 08:09
Show Gist options
  • Save airicbear/f192402bf717d3fe6de6d222c0dada2e to your computer and use it in GitHub Desktop.
Save airicbear/f192402bf717d3fe6de6d222c0dada2e to your computer and use it in GitHub Desktop.
Useful scripts I used for my Journal
#!/usr/bin/env bash
# Convert markdown files to PDF format.
# Dependencies:
# - pandoc (apt): sudo apt install pandoc
# - xetex (apt): sudo apt install texlive-xetex
for FILE in ./md/*.md; do
PDFFILE="./pdf/"$(basename "${FILE%.md}.pdf")
if [ ! -f $PDFFILE ]; then
echo Converting $FILE to ${PDFFILE}...
pandoc $FILE -o $PDFFILE --pdf-engine=xelatex
fi
done
echo Done.
#!/usr/bin/env bash
# Format markdown to be compatible with pandoc.
# Dependencies:
# - npm (apt): sudo apt install npm
# - remark: npm install -g remark-cli
for file in ./md/*.md; do
remark $file -o $file
done
#!/bin/bash
for FILE in md/*.md; do
echo "* "$(basename "${FILE%.md}") >> Journal.org
while read p; do
echo "$p" >> Journal.org
done <$FILE
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment