Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Modularize structure to add support for new styles and different input files #33

Merged
merged 4 commits into from
Feb 28, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
64 changes: 39 additions & 25 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,32 +1,46 @@
OUT_DIR=output
IN_DIR=markdown
STYLES_DIR=styles
STYLE=chmduquesne

all: html pdf docx rtf

pdf: resume.pdf
resume.pdf: style_chmduquesne.tex resume.md
pandoc --standalone --template style_chmduquesne.tex \
--from markdown --to context \
-V papersize=A4 \
-o resume.tex resume.md; \
context resume.tex
pdf: dir
for f in $(IN_DIR)/*.md; do \
FILE_NAME=`basename $$f | sed 's/.md//g'`; \
echo $$FILE_NAME.pdf; \
pandoc --standalone --template $(STYLES_DIR)/$(STYLE).tex \
--from markdown --to context \
-V papersize=A4 \
-o $(OUT_DIR)/$$FILE_NAME.tex $$f > /dev/null; \
context $(OUT_DIR)/$$FILE_NAME.tex --result=$(OUT_DIR)/$$FILE_NAME.pdf > $(OUT_DIR)/context_$$FILE_NAME.log 2>&1; \
done

html: dir
for f in $(IN_DIR)/*.md; do \
FILE_NAME=`basename $$f | sed 's/.md//g'`; \
echo $$FILE_NAME.html; \
pandoc --standalone -H $(STYLES_DIR)/$(STYLE).css \
--from markdown --to html \
-o $(OUT_DIR)/$$FILE_NAME.html $$f; \
done

html: resume.html
resume.html: style_chmduquesne.css resume.md
pandoc --standalone -H style_chmduquesne.css \
--from markdown --to html \
-o resume.html resume.md
docx: dir
for f in $(IN_DIR)/*.md; do \
FILE_NAME=`basename $$f | sed 's/.md//g'`; \
echo $$FILE_NAME.docx; \
pandoc -s -S $$f -o $(OUT_DIR)/$$FILE_NAME.docx; \
done

docx: resume.docx
resume.docx: resume.md
pandoc -s -S resume.md -o resume.docx
rtf: dir
for f in $(IN_DIR)/*.md; do \
FILE_NAME=`basename $$f | sed 's/.md//g'`; \
echo $$FILE_NAME.rtf; \
pandoc -s -S $$f -o $(OUT_DIR)/$$FILE_NAME.rtf; \
done

rtf: resume.rtf
resume.rtf: resume.md
pandoc -s -S resume.md -o resume.rtf
dir:
mkdir -p $(OUT_DIR)

clean:
rm -f resume.html
rm -f resume.tex
rm -f resume.tuc
rm -f resume.log
rm -f resume.pdf
rm -f resume.docx
rm -f resume.rtf
rm -f $(OUT_DIR)/*
File renamed without changes.
File renamed without changes.
File renamed without changes.