public inbox archive for pandoc-discuss@googlegroups.com
 help / color / mirror / Atom feed
* HTML – Building a linked index page
@ 2022-08-07  9:20 Martin Post
       [not found] ` <45b1415d-1ab3-44c2-8199-d45095873e62n-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org>
  0 siblings, 1 reply; 5+ messages in thread
From: Martin Post @ 2022-08-07  9:20 UTC (permalink / raw)
  To: pandoc-discuss


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

Hello,

in a Markdown > HTML workflow, I am looking for a way to create “index” 
pages for a page set that will contain linked lists of block elements (e.g. 
all headings or figures) in that set.

So I’ll have 1.md, 2.md etc. converted to HTML (1.htm), and I’d like to 
generate e.g. a “h1_index.htm” with links to ID’d H1 headings:

<li>1<ul>
<li><a href="1.htm#first-heading">First Heading</a></li>
<li><a href="1.htm#second-heading">Second Heading</a></li>
</ul></li>
<li>2<ul>
<li><a href="2.htm#first-heading">First Heading</a></li>
<li><a href="2.htm#second-heading">Second Heading</a></li>
</ul></li>

Same for other block elements such as <figcaption> to generate a linked 
list of illustrations.

Can someone suggest how to approach this using only Pandoc (filters) 
instead of using a separate tool?

I believe the Python library Beautiful Soup 
(https://www.crummy.com/software/BeautifulSoup/) is often used for this 
kind of processing, but it would be nice to do it all with Pandoc.

Maybe a second (HTML > HTML) pass für concatenation and a filter that only 
leaves the respective elements?

Thank you.

-- 
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/45b1415d-1ab3-44c2-8199-d45095873e62n%40googlegroups.com.

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

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

end of thread, other threads:[~2022-08-07 15:37 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-08-07  9:20 HTML – Building a linked index page Martin Post
     [not found] ` <45b1415d-1ab3-44c2-8199-d45095873e62n-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org>
2022-08-07 13:56   ` Jiří Wolker
     [not found]     ` <9ee132fd-6023-0bf6-02f5-5f72e56392fb-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
2022-08-07 12:12       ` William Lupton
2022-08-07 14:02   ` Albert Krewinkel
     [not found]     ` <87edxs401h.fsf-9EawChwDxG8hFhg+JK9F0w@public.gmane.org>
2022-08-07 15:37       ` Martin Post

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).