mirror of https://github.com/mpastell/Weave.jl
Start working on ctation rendering
parent
11f95b3844
commit
935303d175
|
@ -0,0 +1,3 @@
|
|||
{{#article}}
|
||||
{{author}}. ({{year}}). {{title}}. {{journal}}. {{volume}}:{{{pages}}}. doi: {{{doi}}}.
|
||||
{{/article}}
|
|
@ -104,6 +104,7 @@ Multiple lines
|
|||
##
|
||||
using Revise
|
||||
import Weave: WeaveMarkdown
|
||||
import Mustache
|
||||
|
||||
md = """
|
||||
|
||||
|
@ -115,5 +116,18 @@ cite [@Bezanson2017] again
|
|||
|
||||
"""
|
||||
|
||||
m = WeaveMarkdown.parse_markdown(md, "test/documents/bibtex/testdocs.bib");
|
||||
m = WeaveMarkdown.parse_markdown(md, joinpath(@__DIR__, "documents/bibtex/testdocs.bib"));
|
||||
m
|
||||
# Render references
|
||||
tpl = Mustache.template_from_file(joinpath(@__DIR__, "../templates/html_citations.tpl"))
|
||||
ref = WeaveMarkdown.CITATIONS[:references]["Bezanson2017"]
|
||||
ref[ref["type"]] = "true"
|
||||
ref["author"] = replace(ref["author"], r"\sand\s"i => ", ")
|
||||
for key in keys(ref)
|
||||
ref[key] = replace(ref[key], r"\{|\}" => "")
|
||||
ref[key] = replace(ref[key], "--" => "—")
|
||||
end
|
||||
|
||||
Mustache.render(tpl, ref)
|
||||
r2 = Dict("author" => "Matti Pastell", "title" => "Some paper", "article" => "true")
|
||||
Mustache.render(tpl, r2)
|
||||
|
|
Loading…
Reference in New Issue