Created
February 22, 2018 20:47
-
-
Save njamescouk/6d41a9f9bbc1a608d00f96e7e9d3a72f to your computer and use it in GitHub Desktop.
generate default templates for pandoc
This file contains 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
@echo off | |
goto main | |
My installation of pandoc didn't have the advertised templates or the | |
advertised directory they were meant to be in, which is a nuisance if | |
you need to modify them. This batch file should do the job. | |
:main | |
pandoc -v | grep "fault user" | sed "s/^[^:]*: *\(.*\)/\1/" > genT_tmpfile | |
set /p PANDOC_USER_DIR=<genT_tmpfile | |
del genT_tmpfile | |
pushd %PANDOC_USER_DIR% | |
if NOT %errorlevel%==0 echo cannot access pandoc user data directory & goto :eof | |
if not exist templates md templates | |
for /f %%t in ('pandoc --list-output-formats') do pandoc --print-default-template=%%t > templates\default.%%t | |
popd | |
set PANDOC_USER_DIR= |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
My installation of pandoc didn't have the advertised templates or the
advertised directory they were meant to be in, which is a nuisance if
you need to modify them. This batch file should do the job.