SHELL:=/bin/zsh NOTES_DIR="/home/dzack/orals/rawnotes" OUT_DIR="/home/dzack/orals/out" WWW_DIR="/var/www/ag_notes" all: clean pandoc generate sync type clr_green 2>&1 >/dev/null || { source "$$DOTFILES_ROOT/.bash_colors";} clr_greenb "____________________________________________________" clr_greenb "___________ All files compiled. __________________" clr_greenb "____________________________________________________" ## Giant Problem Doc problems: mkdir ./figures; find ./rawnotes/Hartshorne_Problems -name \*.png -exec cp {} ./figures \; find ./rawnotes/Hartshorne_Problems -iname "*.md" -print0 | sort -z | xargs -r0 awk 'FNR==1{print ""}1' | sed '/\#to_work\//g' > temp1.md; cat ./problemdata.yaml > HartshorneMegadoc.md; cat ./temp1.md | ./pandoc_stripmacros_problems.sh >> HartshorneMegadoc.md; cat ./HartshorneMegadoc.md | sed -E -e 's/\#to_work|\#completed//g' | pandoc -r markdown+simple_tables+table_captions+yaml_metadata_block+tex_math_single_backslash --to=markdown --lua-filter=./kill_solutions.lua --template=./doctemplate.tex --to=latex -o HartshorneMegadoc.tex --resource-path=/var/www/notes_site; pdflatex HartshorneMegadoc.tex; pdflatex HartshorneMegadoc.tex; rm ./temp1.md; readingnotes: mkdir ./figures; find "./rawnotes/0_Study Guides/Reading Notes" -iname \*.png -exec cp {} ./figures \; find "./rawnotes/0_Study Guides/Reading Notes" -iname "*.md" -print0 | sort -z | xargs -r0 awk 'FNR==1{print ""}1' > temp2.md; cat ./problemdata.yaml > ReadingDoc.md cat ./temp2.md | ./pandoc_stripmacros.sh >> ReadingDoc.md; cat ./ReadingDoc.md | pandoc -r markdown+simple_tables+table_captions+yaml_metadata_block+tex_math_single_backslash --to=markdown --template=./doctemplate.tex --to=latex -o ReadingDoc.tex --resource-path=/var/www/notes_site --lua-filter=/home/dzack/.pandoc/filters/convert_amsthm_envs.lua --lua-filter=/home/dzack/.pandoc/filters/convert_math_delimiters.lua; pdflatex ReadingDoc.tex; pdflatex ReadingDoc.tex; #cat ./ReadingDoc.md | pandoc -r markdown+simple_tables+table_captions+yaml_metadata_block+tex_math_single_backslash --to=markdown --template=./doctemplate.tex --to=pdf -o ReadingDoc.pdf --resource-path=/var/www/notes_site --lua-filter=/home/zack/.pandoc/filters/convert_amsthm_envs.lua; stdnotes: mkdir ./figures; find "./rawnotes/0_Study Guides/Reading Notes" -iname \*.png -exec cp {} ./figures \; find "./rawnotes/0_Study Guides/Reading Notes" -iname "*.md" -print0 | sort -z | xargs -r0 awk 'FNR==1{print ""}1' > ReadingDoc.md; echo "Making LaTeX..."; pandoc_totex_orpdf.sh -f ReadingDoc.md -x > ReadingDoc.tex; echo "Latex done."; echo "Making PDF..."; @mkdir -p tex_tempfiles; @latexmk --shell-escape -pdf ReadingDoc.tex -quiet -outdir=tex_tempfiles && cp tex_tempfiles/ReadingDoc.pdf . 2>&1 >/dev/null; echo "PDF done."; ## Markdown Output pandoc: rm -rf $(OUT_DIR); mkdir $(OUT_DIR); echo "Copying base directory.." rsync -a --exclude='.*' --exclude="*.yaml" --exclude="*.css" --exclude="*.sty" --exclude="*.tex" --exclude="*.txt" --exclude="*.sh" --exclude="*.html" --exclude="*.log" --exclude="*.add.spl" --exclude="*.add" --exclude="*.bib" $(NOTES_DIR)/ $(OUT_DIR)/; echo "Running custom pandoc conversion..." mkdir $(OUT_DIR)/figures; mkdir $(OUT_DIR)/tikzcd; while read THISFILE; do echo "$$THISFILE"; awk 'FNR==1{print ""}1' "$$THISFILE" | ./pandoc_stripmacros.sh | sed '/file:\/\//d' > temp.md && mv temp.md "$$THISFILE"; done < <(find $(OUT_DIR)/ -type f -iname "*.md" ) cp ./index.md $(OUT_DIR); cp ./index.yaml $(OUT_DIR); pandoc_test: rm -rf $(OUT_DIR); echo "Copying Notes directory.." rsync -a --exclude='.*' --exclude="*.yaml" --exclude="*.css" --exclude="*.sty" --exclude="*.tex" --exclude="*.txt" --exclude="*.sh" --exclude="*.html" --exclude="*.log" --exclude="*.add.spl" --exclude="*.add" --exclude="*.bib" $(NOTES_DIR) $(OUT_DIR); echo "Running custom pandoc conversion..." #mkdir $(OUT_DIR)/figures; mkdir $(OUT_DIR)/tikzcd; while read THISFILE; do echo "$$THISFILE"; awk 'FNR==1{print ""}1' "$$THISFILE" | ./pandoc_stripmacros.sh | sed '/file:\/\//d' > temp.md && mv temp.md "$$THISFILE"; done < <(find $(OUT_DIR)/ -type f -iname "*.md" ) cp ./index.md $(OUT_DIR); cp ./index.yaml $(OUT_DIR); ema_test: rm -rf $(OUT_DIR); echo "Copying Notes directory.." rsync -a --exclude='.*' --exclude="*.yaml" --exclude="*.css" --exclude="*.sty" --exclude="*.tex" --exclude="*.txt" --exclude="*.sh" --exclude="*.html" --exclude="*.log" --exclude="*.add.spl" --exclude="*.add" --exclude="*.bib" $(NOTES_DIR) $(OUT_DIR); echo "Running custom pandoc conversion..." #mkdir $(OUT_DIR)/figures; mkdir $(OUT_DIR)/tikzcd; cp ./index.md $(OUT_DIR); cp ./index.yaml $(OUT_DIR); watch: HOST=0.0.0.0 PORT=8000 emanote; sync: rsync -vaz --rsh="ssh -l zack" $(WWW_DIR)/ dzackgarza.com:$(WWW_DIR)/; generate: mkdir $(WWW_DIR); cp ./templates $(OUT_DIR)/templates -r; emanote -L $(OUT_DIR) gen $(WWW_DIR); .SILENT: clean: echo "Removing directories.." @rm -rf $(OUT_DIR); @rm -rf $(WWW_DIR); .PHONY: clean .ONESHELL: