On 1/19/2023 10:12 AM, John MacFarlane wrote:
> sitemap.json is really for processing with external tools. If you're using a Lua filter, then you can use the new module
> https://pandoc.org/lua-filters.html#module-pandoc.structure
I started playing with this, but quickly got confused.
Inside my lua filter, pandoc.structure is nil. Is this available in a filter, or only in a custom writer? Should I be trying to write a custom writer rather than a filter?
Is there an example of getting or using the table of contents?
Also, I tried to print the value of PANDOC_WRITER_OPTIONS, but wlupton's logging.lua errors on it (bad argument #1 to 'for iterator' (table expected, got light userdata)). I the tried the debugging printer I have used in the past, kikito's inspect.lua, and it reports its value as " <userdata 1>". How do I access writer_options from a filter (for example, the toc-depth)? For what it's worth, I can print the value of PANDOC_READER_OPTIONS.
Thanks,
--
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-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org.
To view this discussion on the web visit https://groups.google.com/d/msgid/pandoc-discuss/f761231d-87ea-6bfb-38c3-99eb15184263%40intielectronics.com.