git.iko.soy/typeable/pandoc
on master help sign in
lua-filters.md doc: Added handout example.
3d6f98cJohn MacFarlane
doc/lua-filters.md+21
@@ -362,6 +362,27 @@ function Note(el)
362end
362end
363```
363```
364
364
365+## Creating a handout from a paper
366+
367+This filter extracts all the numbered examples, section
368+headers, block quotes from a document, in addition to any
369+divs with class `handout`:
370+
371+``` lua
372+function Pandoc(doc)
373+ local hblocks = {}
374+ for i,el in pairs(doc.blocks) do
375+ if (el.t == "Div" and el.classes[1] == "handout") or
376+ (el.t == "BlockQuote") or
377+ (el.t == "OrderedList" and el.style == "Example") or
378+ (el.t == "Header") then
379+ table.insert(hblocks, el)
380+ end
381+ end
382+ return pandoc.Pandoc(hblocks, meta)
383+end
384+```
385+
365## Converting ABC code to music notation
386## Converting ABC code to music notation
366
387
367This filter replaces code blocks with class `abc` with
388This filter replaces code blocks with class `abc` with