summaryrefslogtreecommitdiff
path: root/data
diff options
context:
space:
mode:
authorJohn MacFarlane <jgm@berkeley.edu>2015-09-15 09:27:45 -0700
committerJohn MacFarlane <jgm@berkeley.edu>2015-09-15 09:28:18 -0700
commitf2f35224f614199ac5fc26be84bba093a92ba984 (patch)
tree59d99861377ef34e36ed23bb8ec7f2e6331d5246 /data
parent6dcfa7e07b42858e78ea7d29ae82782ddc9e1761 (diff)
sample.lua - define CaptionedImage, add newline at end.
Cloess #2393.
Diffstat (limited to 'data')
-rw-r--r--data/sample.lua8
1 files changed, 7 insertions, 1 deletions
diff --git a/data/sample.lua b/data/sample.lua
index f5c17839e..fa265d04d 100644
--- a/data/sample.lua
+++ b/data/sample.lua
@@ -84,7 +84,7 @@ function Doc(body, metadata, variables)
end
add('</ol>')
end
- return table.concat(buffer,'\n')
+ return table.concat(buffer,'\n') .. '\n'
end
-- The functions that follow render corresponding pandoc elements.
@@ -251,6 +251,12 @@ function html_align(align)
end
end
+function CaptionedImage(src, tit, caption)
+ return '<div class="figure">\n<img src="' .. escape(src,true) ..
+ '" title="' .. escape(tit,true) .. '"/>\n' ..
+ '<p class="caption">' .. caption .. '</p>\n</div>'
+end
+
-- Caption is a string, aligns is an array of strings,
-- widths is an array of floats, headers is an array of
-- strings, rows is an array of arrays of strings.