From: William Lupton <wlupton-QSt+ys/nuMyEUIsrzH9SikB+6BGkLq7r@public.gmane.org>
To: John MacFarlane <jgm-TVLZxgkOlNX2fBVCVOL8/A@public.gmane.org>
Cc: pandoc-discuss <pandoc-discuss-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org>
Subject: Re: Custom lua writers and standalone documents
Date: Sun, 4 Oct 2020 16:56:59 +0100 [thread overview]
Message-ID: <CAEe_xxijXFxtfTzRJNp_wmT93ERdFDm_9oauEkrPmjWjT9zfPw@mail.gmail.com> (raw)
In-Reply-To: <CAEe_xxjxAsHgd3nQtL+-Nrsfgk9tbOmhYz_8JJ2dMkCMAJ1aRA-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
[-- Attachment #1: Type: text/plain, Size: 2966 bytes --]
Also, I specified --table-of-contents on the command line, but didn't see
it set in the writer's Doc() function. Should I have expected to see it?
On Sun, 4 Oct 2020, 16:54 William Lupton, <wlupton-QSt+ys/nuMyEUIsrzH9SikB+6BGkLq7r@public.gmane.org>
wrote:
> Great. Thanks. I can do this.
>
> But can I then use a template? I didn't mention this earlier, but I tried
> setting some variables in the Doc() function (e.g. 'toc') and they didn't
> seem to be seen by the template.
>
> On Sun, 4 Oct 2020, 16:12 John MacFarlane, <jgm-TVLZxgkOlNX2fBVCVOL8/A@public.gmane.org> wrote:
>
>>
>> The table of contents is generated by the HTML writer.
>> So, if you create a custom writer, you'll have to reproduce
>> this functionality in your writer.
>>
>> William Lupton <wlupton-QSt+ys/nuMyEUIsrzH9SikB+6BGkLq7r@public.gmane.org> writes:
>>
>> > 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
>> .
>>
>
--
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/CAEe_xxijXFxtfTzRJNp_wmT93ERdFDm_9oauEkrPmjWjT9zfPw%40mail.gmail.com.
[-- Attachment #2: Type: text/html, Size: 4570 bytes --]
next prev parent reply other threads:[~2020-10-04 15:56 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-10-04 14:32 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 [this message]
[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
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=CAEe_xxijXFxtfTzRJNp_wmT93ERdFDm_9oauEkrPmjWjT9zfPw@mail.gmail.com \
--to=wlupton-qst+ys/numyeuisrzh9sikb+6bgklq7r@public.gmane.org \
--cc=jgm-TVLZxgkOlNX2fBVCVOL8/A@public.gmane.org \
--cc=pandoc-discuss-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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).