public inbox archive for pandoc-discuss@googlegroups.com
 help / color / mirror / Atom feed
* Custom lua writers and standalone documents
@ 2020-10-04 14:32 William Lupton
       [not found] ` <66e3e0f4-a77c-4ff6-b71e-68182d95ac2an-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org>
  0 siblings, 1 reply; 8+ messages in thread
From: William Lupton @ 2020-10-04 14:32 UTC (permalink / raw)
  To: pandoc-discuss


[-- Attachment #1.1: Type: text/plain, Size: 1516 bytes --]

Hello,

% pandoc --version
pandoc 2.9.2.1

I want to generate modified HTML for headers (to be specific, I want to add 
a link to each header, like Sphinx does), so I decided to create a custom 
lua writer.

I started with the supplied sample.lua and modified the Header() function, 
but I find (when I run with --standalone --table-of-contents) that I don't 
get a ToC. And when I look at the variables in the Doc() function I don't 
see 'toc' or 'table-of-contents'.

Should I be able do this, or do I have to use my custom writer to generate 
a fragment and then run pandoc again to process the fragment and generate 
the ToC (I've tried this and it works)?

Note: I tried to parse this comment in sample.lua Doc(), but am not clear 
whether it's saying that I can use --template in the _same_ pandoc 
invocation or whether I need to use a separate invocation:
* You could use the metadata table to fill variables in a custom lua 
template.  Or, pass `--template=...` to pandoc, and pandoc will do the 
template processing as usual.

I can supply more detailed info on request.

Thanks,
William Lupton

-- 
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/66e3e0f4-a77c-4ff6-b71e-68182d95ac2an%40googlegroups.com.

[-- Attachment #1.2: Type: text/html, Size: 2004 bytes --]

^ permalink raw reply	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2020-10-05 17:10 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-10-04 14:32 Custom lua writers and standalone documents William Lupton
     [not found] ` <66e3e0f4-a77c-4ff6-b71e-68182d95ac2an-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org>
2020-10-04 15:12   ` John MacFarlane
     [not found]     ` <m2362ut47x.fsf-jF64zX8BO08an7k8zZ43ob9bIa4KchGshsV+eolpW18@public.gmane.org>
2020-10-04 15:54       ` William Lupton
     [not found]         ` <CAEe_xxjxAsHgd3nQtL+-Nrsfgk9tbOmhYz_8JJ2dMkCMAJ1aRA-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2020-10-04 15:56           ` William Lupton
     [not found]             ` <CAEe_xxijXFxtfTzRJNp_wmT93ERdFDm_9oauEkrPmjWjT9zfPw-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2020-10-04 16:25               ` William Lupton
2020-10-04 18:41               ` John MacFarlane
     [not found]                 ` <m2imbpsuk7.fsf-jF64zX8BO08an7k8zZ43ob9bIa4KchGshsV+eolpW18@public.gmane.org>
2020-10-05  8:42                   ` William Lupton
     [not found]                     ` <CAEe_xxinvW1OkUm8QGTuFU_yoitz97XqYmdQO4pyUhKSL=dWCQ-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2020-10-05 17:10                       ` John MacFarlane

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).