Re this:

> 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 investigated, and parts of the writer options are "light userdata" (I hadn't heard of that). I've committed and merged a fix that will report such items as "<pointer>". You can now list most of the writer options (just a few colors show as <pointer>).

I'm not sure whether the use of light userdata is intentional here (this isn't a 3.0 thing; it was already the case in previous versions). Albert?

On Thu, 19 Jan 2023 at 21:32, ChrisD <cd34-gg-4SSc53hpTiu9TMao6EloiEEOCMrvLtNR@public.gmane.org> wrote:
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.

--
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/CAEe_xxiQAz2MVihALKGes6Ai%3DUrOPKgkvGq19ULiLsjBhTuTbQ%40mail.gmail.com.