OK, I played around a little bit with sample.lua and have the following understanding: (1) pandoc handles normal template usage in combination with sample.lua, I only have to set --template=... on the commandline. Everything is fine. (2) Despite specifying --toc on the commandline, _no_ table of contents is produced with sample.lua! It seems, that pandoc internally sets the content for the table of contents to the metadata variable toc. In fact, if I add some arbitrary text to the metadata variable toc, e.g. in a yaml block, then a table of contents is printed with this text through my template. It does not matter, if --toc is used or not. Question: How can I set the metadata variable toc in sample.lua? (I guess, I would have to create the toc myself in sample.lua). I tied to modify metadata in function Doc, but it didn't work. (3) Section numbering does not work with sample.lua. How can I get the commandline arguments --number-sections and --number-offset=N in sample.lua? I guess, I would also have to do the section numbering myself in sample.lua. (4) --sections-divs does not work in sample.lua. If I could read the commandline argument --section-divs in sample.lua, I could write the opening
tag in function Header. BUT: where and how could I create the closing
tag? Maybe I would have to put a closing tag right before the next opening tag in every call to function Header at the same or lower level and add the last closing tag in function Doc to the body. Or is there a better way? Thanks in advance for every help! Regards Karl Karl Weber schrieb am Montag, 28. September 2020 um 08:08:11 UTC+2: > Hi John, > > thank you for your answer. I would think it should be possible to do that > with my own custom writer (in Lua). Is that right? > > If so, how much work would it be? My starting point would be the > sample.lua obtained though the command > > pandoc --print-default-data-file sampla.lua > > Is there an easier way to do this? How close is this sample.lua to what > pandoc is doing for output format html5? I.e. how much would I have to add > to sample.lua? Is it only my desired functionality or are there more > differences? (I am using, for instance, --toc and --sections-div, which > does not seem to be part of the sample.lua...) I did't find > template-processing as well, but I am just starting to learn how to build > my own custom writer... > > Im am using pandoc 2.10.1 > > This solution (if feasible) would have the advantage, that I could add > more functionality I am currently missing (there may indeed be one or two > things), but it would also have the disadvantage, that I would have to > adapt my own custom writer, whenever pandoc evolves. However, this should > only be necessary if the datamodel of pandoc is changing, or isn't it? I am > still undecided. > > Thanks in advance > Karl > > John MacFarlane schrieb am Montag, 28. September 2020 um 01:02:41 UTC+2: > >> >> No, you can't specify it in YAML metadata. >> >> "'Karl Weber' via pandoc-discuss" >> writes: >> >> > Hi, >> > >> > I do want to specify number-offset neither on the commandline of pandoc >> nor >> > in the defaults yaml file. The reason is, that I have a project >> consisting >> > of a number of documents in markdown format, that I want to convert to >> > html5 using make. Hence I need to specify number-offset for each file >> > individually. >> > >> > Is there some way to do this? >> > >> > I tried to specify it in a yaml block at the beginning of each file, >> > something like the following: >> > >> > --- >> > output: >> > html_document: >> > pandoc_args: [ >> > "--number-offset=4,0" >> > ] >> > --- >> > >> > I tried different variations of this example, but none worked. Note, >> that >> > my input format ist pandoc markdown. >> > >> > It would be great, if something like that would work. I would >> appreciate >> > any help. >> > >> > Thanks in advance, >> > Karl >> > >> > >> > -- >> > You received this message because you are subscribed to the Google >> Groups "pandoc-discuss" group. >> > To unsubscribe from this group and stop receiving emails from it, send >> an email to pandoc-discus...-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org >> > To view this discussion on the web visit >> https://groups.google.com/d/msgid/pandoc-discuss/200b15bc-f323-487e-b39d-e6be8845eacan%40googlegroups.com. >> >> > -- You received this message because you are subscribed to the Google Groups "pandoc-discuss" group. To unsubscribe from this group and stop receiving emails from it, send an email to pandoc-discuss+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To view this discussion on the web visit https://groups.google.com/d/msgid/pandoc-discuss/90ec5cf3-3f74-4ae2-94a9-66d60d007ee1n%40googlegroups.com.