tiltle, author, date + template for html5 output

This commit is contained in:
gauthiier 2014-09-22 18:06:52 +02:00
parent 40e0d8669f
commit e8ffa3c3ce
4 changed files with 62 additions and 2 deletions

View File

@ -79,9 +79,11 @@ if [ -z "$BIBLIOGRAPHE_PATH" ]; then
else else
node $BIBLIOGRAPHE_PATH/refactorbib.js --data $BIB > tmpbib.json node $BIBLIOGRAPHE_PATH/refactorbib.js --data $BIB > tmpbib.json
REFERENCE=$(node $BIBLIOGRAPHE_PATH/generatebib.js --data tmpbib.json --items [\"$REF\"] --output md) REFERENCE=$(node $BIBLIOGRAPHE_PATH/generatebib.js --data tmpbib.json --items [\"$REF\"] --output md)
AUTHOR=$(whoami)
DATE=$(date +%Y\-%m\-%d)
echo $REFERENCE echo $REFERENCE
rm tmpbib.json 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 fi
# cleanup # cleanup

View File

@ -17,7 +17,7 @@ $(OUT)%.pdf : %.mmd
HTML := $(patsubst %.mmd,$(OUT)%.html,$(wildcard *.mmd)) HTML := $(patsubst %.mmd,$(OUT)%.html,$(wildcard *.mmd))
$(OUT)%.html : %.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 all : dir $(HTML) index

View File

@ -1,3 +1,7 @@
% title
% author
% date
### Reference ### Reference
*MACHINE-REF *MACHINE-REF

View File

@ -0,0 +1,54 @@
<!DOCTYPE html>
<html$if(lang)$ lang="$lang$"$endif$>
<head>
<meta charset="utf-8">
<meta name="generator" content="pandoc">
<meta name="viewport" content="width=device-width, initial-scale=1.0, user-scalable=yes">
$for(author-meta)$
<meta name="author" content="$author-meta$">
$endfor$
$if(date-meta)$
<meta name="dcterms.date" content="$date-meta$">
$endif$
<title>$if(title-prefix)$$title-prefix$ - $endif$$pagetitle$</title>
<style type="text/css">code{white-space: pre;}</style>
$if(quotes)$
<style type="text/css">q { quotes: "“" "”" "" ""; }</style>
$endif$
$if(highlighting-css)$
<style type="text/css">
$highlighting-css$
</style>
$endif$
$for(css)$
<link rel="stylesheet" href="$css$">
$endfor$
$if(math)$
$math$
$endif$
$for(header-includes)$
$header-includes$
$endfor$
</head>
<body>
$for(include-before)$
$include-before$
$endfor$
$if(title)$
<header>
$if(date-meta)$
<p>$date-meta$</p>
$endif$
</header>
$endif$
$if(toc)$
<nav id="$idprefix$TOC">
$toc$
</nav>
$endif$
$body$
$for(include-after)$
$include-after$
$endfor$
</body>
</html>