From e8ffa3c3ce125a2fd84ad4796ed3d4cf10be9736 Mon Sep 17 00:00:00 2001 From: gauthiier Date: Mon, 22 Sep 2014 18:06:52 +0200 Subject: [PATCH] tiltle, author, date + template for html5 output --- nnnew.sh | 4 ++- template/Makefile | 2 +- template/notes.mmd | 4 +++ template/p/nnnote-template.html5 | 54 ++++++++++++++++++++++++++++++++ 4 files changed, 62 insertions(+), 2 deletions(-) create mode 100644 template/p/nnnote-template.html5 diff --git a/nnnew.sh b/nnnew.sh index 3678500..0178471 100755 --- a/nnnew.sh +++ b/nnnew.sh @@ -79,9 +79,11 @@ if [ -z "$BIBLIOGRAPHE_PATH" ]; then else node $BIBLIOGRAPHE_PATH/refactorbib.js --data $BIB > tmpbib.json REFERENCE=$(node $BIBLIOGRAPHE_PATH/generatebib.js --data tmpbib.json --items [\"$REF\"] --output md) + AUTHOR=$(whoami) + DATE=$(date +%Y\-%m\-%d) echo $REFERENCE rm tmpbib.json - sed -i.bak "s~*MACHINE-REF*~$REFERENCE~g" notes.mmd + sed -i.bak "s~*MACHINE-REF*~$REFERENCE~g ; s~%\ title~%\ $REFERENCE~g ; s~%\ author~%\ $AUTHOR~g ; s~%\ date~%\ $DATE~g" notes.mmd fi # cleanup diff --git a/template/Makefile b/template/Makefile index 4fa5510..b32eadb 100644 --- a/template/Makefile +++ b/template/Makefile @@ -17,7 +17,7 @@ $(OUT)%.pdf : %.mmd HTML := $(patsubst %.mmd,$(OUT)%.html,$(wildcard *.mmd)) $(OUT)%.html : %.mmd - pandoc $< -s --filter pandoc-citeproc --csl $(CSL) --bibliography $(BIB) -o $@ + pandoc $< -s -t html5 --template=p/nnnote-template.html5 --filter pandoc-citeproc --csl $(CSL) --bibliography $(BIB) -o $@ all : dir $(HTML) index diff --git a/template/notes.mmd b/template/notes.mmd index 2b851cb..4a643f6 100644 --- a/template/notes.mmd +++ b/template/notes.mmd @@ -1,3 +1,7 @@ +% title +% author +% date + ### Reference *MACHINE-REF diff --git a/template/p/nnnote-template.html5 b/template/p/nnnote-template.html5 new file mode 100644 index 0000000..cbec080 --- /dev/null +++ b/template/p/nnnote-template.html5 @@ -0,0 +1,54 @@ + + + + + + +$for(author-meta)$ + +$endfor$ +$if(date-meta)$ + +$endif$ + $if(title-prefix)$$title-prefix$ - $endif$$pagetitle$ + +$if(quotes)$ + +$endif$ +$if(highlighting-css)$ + +$endif$ +$for(css)$ + +$endfor$ +$if(math)$ + $math$ +$endif$ +$for(header-includes)$ + $header-includes$ +$endfor$ + + +$for(include-before)$ +$include-before$ +$endfor$ +$if(title)$ +
+$if(date-meta)$ +

$date-meta$

+$endif$ +
+$endif$ +$if(toc)$ + +$endif$ +$body$ +$for(include-after)$ +$include-after$ +$endfor$ + + \ No newline at end of file