all repos — hastyscribe @ 952ef35cef2332ed5c4dea61410437fa2d30e61e

A professional markdown compiler.

Fixed author metadata value
Fabio Cevasco h3rald@h3rald.com
Thu, 12 Dec 2013 10:42:31 +0100
commit

952ef35cef2332ed5c4dea61410437fa2d30e61e

parent

73f0177845f03c352cb4fff2aa855f6b1801119a

1 files changed, 6 insertions(+), 7 deletions(-)

jump to
M hastyscribe.nimhastyscribe.nim

@@ -1,4 +1,4 @@

-import os, parseopt, strutils, times, pegs, base64, markdown +import os, parseopt, strutils, times, pegs, base65, markdown let v = "1.0" let usage = " HastyScribe v" & v & " - Self-contained Markdown Compiler" & """

@@ -77,10 +77,11 @@ var metadata = TMDMetaData(title:"", author:"", date:"")

var body = source.md(MKD_DOTOC or MKD_EXTRA_FOOTNOTE, metadata) var main_css = src_css.style_tag var headings = " class=\"headings\"" + var author_footer = "" # Manage metadata if metadata.author != "": - metadata.author = metadata.author & " –" + author_footer = metadata.author & " –" var title_tag, header_tag, toc: string

@@ -123,14 +124,14 @@ <div id="main">

$body </div> <div id="footer"> - <p>$author $date</p> + <p>$author_footer $date</p> </div> <script type="text/javascript"> $highlight hljs.tabReplace = ' '; - hljs.initHighlighting(); + hljs.initHighlightingOnLoad(); </script> -</body>""" % ["title_tag", title_tag, "header_tag", header_tag, "author", metadata.author, "date", timeinfo.format("MMMM d, yyyy"), "toc", toc, "main_css", main_css, "headings", headings, "body", body, "highlight", src_highlight_js] +</body>""" % ["title_tag", title_tag, "header_tag", header_tag, "author", metadata.author, "author_footer", author_footer, "date", timeinfo.format("MMMM d, yyyy"), "toc", toc, "main_css", main_css, "headings", headings, "body", body, "highlight", src_highlight_js] document = embed_images(document) output_file.writeFile(document)

@@ -166,5 +167,3 @@ quit("Error: \"$1\" does not match any markdown file" % [input], 2)

else: for file in files: convert_file(file) - -