Created
August 18, 2019 08:09
-
-
Save airicbear/f192402bf717d3fe6de6d222c0dada2e to your computer and use it in GitHub Desktop.
Useful scripts I used for my Journal
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/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. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/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 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/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