markdown-latex-boilerplate
markdown-latex-boilerplate copied to clipboard
Request for the makefile to read settigns off config.txt instead
Okay, here is something windows user might find useful. An equiv to the makefile for this boilerplate. A request has been pushed, and is awaiting your confirmation.
The only issue is that the makefile is hardcoded, so I would like to ask if you can recode the makefile to read off config.txt instead?
Oh and btw I decided to keep the sections as a separate text file. It really make it easier to keep track of sections that way, especially when it becomes very large.
This is the winmake.bat batch file:
ECHO OFF
ECHO Windows Makefile alternative for markdown-latex-boilerplate
ECHO Command List: "winmake pdf","winmake epub","winmake html": default html
SET COMMAND=%1%
ECHO "COMMAND: %COMMAND%"
for /f %%i in (config.txt) do (
for /f "tokens=1,2 delims==" %%a IN ("%%i") DO SET "%%a=%%b"
)
set /p SECTIONS=<%SECTIONS%
rmdir build /S /q
mkdir build
IF "%COMMAND%"=="pdf" goto pdf
IF "%COMMAND%"=="epub" goto epub
IF "%COMMAND%"=="html" goto html
ECHO Default is HTML
goto html
:pdf
markdown2pdf --toc -N --bibliography=%REFERENCES% -o ./build/example.pdf --csl=./csl/%CSL%.csl --template=%TEMPLATE% %SECTIONS%
goto exit
:epub
pandoc -S -s --biblatex --toc -N --bibliography=%REFS% -o ./build/example.epub -t epub --normalize %SECTIONS%
goto exit
:html
pandoc -S --mathjax="http://cdn.mathjax.org/mathjax/latest/MathJax.js" --section-divs -s --biblatex --toc -N --bibliography=%REFERENCES% -o ./build/example.html -t html --normalize %SECTIONS%
goto exit
:exit
ECHO All Done!
PAUSE
This is what the config.txt looks like:
SECTIONS=sections.txt
REFERENCES=references.bib
TEMPLATE=template.tex
CSL=outline.txt
This is what the sections.txt looks like:
example.md references.md
Thanks for the pull request! I won't be able to test the winmake file though, so I'll have to take your word for it :) You may want to add some stuff to the README for Windows users.
Yea, good idea. Can you change makefile to point to the config.txt for the settings? It's so that if a linux user or windows users edit the config.txt, it will be reflected on both?
Oh btw I had another user test the current pull I sent you. It works on linux now. Can you do another pull request?