* TOC only @ 2022-11-17 16:48 Craig Parker [not found] ` <14f84699-724f-4483-8fe6-1845d1fe81b5n-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org> 0 siblings, 1 reply; 3+ messages in thread From: Craig Parker @ 2022-11-17 16:48 UTC (permalink / raw) To: pandoc-discuss [-- Attachment #1.1: Type: text/plain, Size: 603 bytes --] Is there a way to generate JUST a table of contents? I can probably hack up a file with bash after the fact, but didn't know if there was a way to redirect TOC content to another html file. -- 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/14f84699-724f-4483-8fe6-1845d1fe81b5n%40googlegroups.com. [-- Attachment #1.2: Type: text/html, Size: 890 bytes --] ^ permalink raw reply [flat|nested] 3+ messages in thread
[parent not found: <14f84699-724f-4483-8fe6-1845d1fe81b5n-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org>]
* Re: TOC only [not found] ` <14f84699-724f-4483-8fe6-1845d1fe81b5n-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org> @ 2022-11-17 17:11 ` BPJ [not found] ` <CADAJKhA2MfhXh+4hiE7H1DtWyupDXVqx5KC-qCLiS2G+UoSx1g-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org> 0 siblings, 1 reply; 3+ messages in thread From: BPJ @ 2022-11-17 17:11 UTC (permalink / raw) To: pandoc-discuss [-- Attachment #1: Type: text/plain, Size: 1898 bytes --] Create a template with only the ToC generating stuff: ``````html <nav id="$idprefix$TOC" role="doc-toc"> $if(toc-title)$ <h2 id="$idprefix$toc-title">$toc-title$</h2> $endif$ $table-of-contents$ </nav> `````` or just the last line but one if you don't want the nav element and title. Save that to something like `gen-toc.html` and invoke pandoc with `--template=gen-toc.html` added. You might want to place the template in the templates subdirectory of your pandoc user directory (both of which you may have to create; see `pandoc --help` for where) so that you can use it from anywhere. Den tors 17 nov. 2022 17:49Craig Parker <craig.fossfolks-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> skrev: > Is there a way to generate JUST a table of contents? I can probably hack > up a file with bash after the fact, but didn't know if there was a way to > redirect TOC content to another html file. > > -- > 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/14f84699-724f-4483-8fe6-1845d1fe81b5n%40googlegroups.com > <https://groups.google.com/d/msgid/pandoc-discuss/14f84699-724f-4483-8fe6-1845d1fe81b5n%40googlegroups.com?utm_medium=email&utm_source=footer> > . > -- 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/CADAJKhA2MfhXh%2B4hiE7H1DtWyupDXVqx5KC-qCLiS2G%2BUoSx1g%40mail.gmail.com. [-- Attachment #2: Type: text/html, Size: 3045 bytes --] ^ permalink raw reply [flat|nested] 3+ messages in thread
[parent not found: <CADAJKhA2MfhXh+4hiE7H1DtWyupDXVqx5KC-qCLiS2G+UoSx1g-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>]
* Re: TOC only [not found] ` <CADAJKhA2MfhXh+4hiE7H1DtWyupDXVqx5KC-qCLiS2G+UoSx1g-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org> @ 2022-11-17 19:20 ` Craig Parker 0 siblings, 0 replies; 3+ messages in thread From: Craig Parker @ 2022-11-17 19:20 UTC (permalink / raw) To: pandoc-discuss [-- Attachment #1.1: Type: text/plain, Size: 2460 bytes --] Is there a way, during the calling of files (I'm using a catchall -- ./md/*.md) to extract the document title? I can snag the TOC with a template like you said, but it's got links to things in the current document (<li><a href="#link-to-heading">Actual Heading Name</a></li>.) I'm trying to pull in separate files, but leave them separate, so if my bash for loop, I was going to echo $filename and $titlename (if I can get $titlename somehow form pandoc) On Thursday, November 17, 2022 at 12:12:04 PM UTC-5 BP wrote: > Create a template with only the ToC generating stuff: > > ``````html > <nav id="$idprefix$TOC" role="doc-toc"> > $if(toc-title)$ > <h2 id="$idprefix$toc-title">$toc-title$</h2> > $endif$ > $table-of-contents$ > </nav> > `````` > > or just the last line but one if you don't want the nav element and title. > Save that to something like `gen-toc.html` and invoke pandoc with > `--template=gen-toc.html` added. You might want to place the template in > the templates subdirectory of your pandoc user directory (both of which you > may have to create; see `pandoc --help` for where) so that you can use it > from anywhere. > > > > > Den tors 17 nov. 2022 17:49Craig Parker <craig.f...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> skrev: > >> Is there a way to generate JUST a table of contents? I can probably hack >> up a file with bash after the fact, but didn't know if there was a way to >> redirect TOC content to another html file. >> >> -- >> 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/14f84699-724f-4483-8fe6-1845d1fe81b5n%40googlegroups.com >> <https://groups.google.com/d/msgid/pandoc-discuss/14f84699-724f-4483-8fe6-1845d1fe81b5n%40googlegroups.com?utm_medium=email&utm_source=footer> >> . >> > -- 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/f4eeaee3-78b4-4cae-b77f-5b858a8d9709n%40googlegroups.com. [-- Attachment #1.2: Type: text/html, Size: 4228 bytes --] ^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2022-11-17 19:20 UTC | newest] Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed) -- links below jump to the message on this page -- 2022-11-17 16:48 TOC only Craig Parker [not found] ` <14f84699-724f-4483-8fe6-1845d1fe81b5n-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org> 2022-11-17 17:11 ` BPJ [not found] ` <CADAJKhA2MfhXh+4hiE7H1DtWyupDXVqx5KC-qCLiS2G+UoSx1g-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org> 2022-11-17 19:20 ` Craig Parker
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).