git.iko.soy/typeable/pandoc
on master help sign in
Updated sample.lua for new metadata.
commitcd399d1b9df197f25f7eee6bb2b5e7d5ec3a3f47 authorJohn MacFarlane <fiddlosopher@gmail.com> dateSun 14 Jul 2013, 20:43 (13 years ago) parent359ce37
1 file changed+5−5
data/sample.lua+5−5
data/sample.lua+5−5
@@ -77,16 +77,16 @@ function Doc(body, metadata, variables)
7777 add('<!DOCTYPE html>')
7878 add('<html>')
7979 add('<head>')
80− add('<title>' .. metadata.title .. '</title>')
80+ add('<title>' .. (metadata['title'] or '') .. '</title>')
8181 add('</head>')
8282 add('<body>')
83− if title ~= "" then
84− add('<h1 class="title">' .. metadata.title .. '</h1>')
83+ if metadata['title'] and metadata['title'] ~= "" then
84+ add('<h1 class="title">' .. metadata['title'] .. '</h1>')
8585 end
86− for _, author in pairs(metadata.author) do
86+ for _, author in pairs(metadata['author'] or {}) do
8787 add('<h2 class="author">' .. author .. '</h2>')
8888 end
89− if date ~= "" then
89+ if metadata['date'] and metadata['date'] ~= "" then
9090 add('<h3 class="date">' .. metadata.date .. '</h3>')
9191 end
9292 add(body)