![]() Pandoc allows you to customise the output via extensive command line arguments and by templates. L.content = l.Pandoc is a program that converts between various text markup formats. It's a Google Doc thing, where each bullet is in a blockquoteīlocks = pandoc.Plain() Iterate over all blocks in an item, converting 'top-level' Here is my modified version of the original answer. The original answer above doesn't work with Pandoc 2.11 and a docx file exported from Google Docs. Using walk_blocks would have unintended side-effects, as it would affect all blocks, including the Para block nested below the Div. However there probably are different opinions on when a list should be made compact. The case of multi-block items is an omission in the linked post. L.content = l.content:map(compactifyItem) l.content is an instance of pandoc.List, so the following is equivalent element's index in the list in variable `i`, and assign the current step through the list of blocks step-by-step, keeping track of the I believe the following should work for the general case: - Iterate over all blocks in an item, converting 'top-level' L.content = List.map(l.content, compactifyItem2) a local List = require 'pandoc.List'Įlseif (#blocks = 2) then - I assume I have to change the Para and nest the child contentīntent = pandoc.Plain(ntent). how do I manage for cases where #blocks > 1? How do I change Para to Plain and then include any nested content (say I have two nested divs)?.should I use walk_block and change each list item to Plain?.pandoc mwe.txt -f markdown -t native -lua-filter a returns a Para for the first list item: [BulletList I tried to modify the example here to force all BulletList and OrderedList items to Plain, but I could not get it to work when an item contains nested content. I noticed that lists with nested tables/text/divs will not use the \tightlist option, as the Pandoc AST uses Para instead of Plain for each list item. I want to write a lua filter that forces Pandoc to use compact lists when converting from markdown to PDF. ![]()
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. Archives
December 2022
Categories |