Here's an example of how to generate indexes from Markdown using a Lua filter and ConTeXt output. I have an input file, context-index.md: <#cb1-1>--- <#cb1-2>title: Test out Indexes from Spans in Markdown <#cb1-3>linkcolor: green <#cb1-4>linkcontrastcolor: red <#cb1-5>--- <#cb1-6> <#cb1-7># Section One <#cb1-8> <#cb1-9>[Éomer]{.index}[Éomer] let blow the horns to rally all men to his <#cb1-10>banner that could come thither; for he thought to make a great <#cb1-11>shield-wall at the last, and stand, and fight there on foot till all <#cb1-12>fell, and do deeds of song on the fields of <#cb1-13>[Pelennor]{.index}Pelennor, though no man should be left in the West <#cb1-14>to remember the last [Mark, King of the]{.index}King of the Mark. So <#cb1-15>he rode to a green hillock and there set his banner, and the [White <#cb1-16>Horse]{.index}White Horse ran rippling in the wind. <#cb1-17> <#cb1-18>| Out of doubt, out of dark to the day's rising <#cb1-19>| I came singing in the sun, sword unsheathing. <#cb1-20>| To hope's end I rode and to heart's breaking: <#cb1-21>| Now for wrath, now for ruin and a red nightfall! <#cb1-22> <#cb1-23>These staves he spoke, yet he laughed as he said them. For once more <#cb1-24>lust of battle was on him; and he was still unscathed, and he was <#cb1-25>young, and he was king: the lord of a fell people. And lo! even as he <#cb1-26>laughed at despair he looked out again on the [Ships, <#cb1-27>Black]{.pandoc}black ships, and he lifted up his sword to defy them. <#cb1-28> <#cb1-29>``` {=context} <#cb1-30>\completeindex <#cb1-31>``` <#cb1-32> I build it using a make file, GNUmakefile: <#cb2-1>all: context-index.ctx.pdf <#cb2-2> <#cb2-3>%.ctx.pdf : %.md <#cb2-4> pandoc -w context -o $@ --lua-filter=context-index.lua $< The pandoc command to build it loads a Lua Filter , context-index.lua: <#cb3-1>local function has_value (tab, val) <#cb3-2> for index, value in ipairs(tab) do <#cb3-3> if value == val then <#cb3-4> return true <#cb3-5> end <#cb3-6> end <#cb3-7> return false <#cb3-8>end <#cb3-9> <#cb3-10>function Span(el) <#cb3-11> if el.classes and #el.classes > 0 then <#cb3-12> if has_value(el.classes, 'index') then <#cb3-13> if FORMAT == "context" then <#cb3-14> table.insert(el.content, 1, pandoc.RawInline('context', '\\index{')) <#cb3-15> table.insert(el.content, pandoc.RawInline('context', '}')) <#cb3-16> end <#cb3-17> end <#cb3-18> end <#cb3-19> return el.content <#cb3-20>end -- Span Here's the pandoc command to build the PDF: pandoc -w context -o context-index.ctx.pdf --lua-filter=context-index.lua context-index.md The PDF file it produces, context-index.ctx.pdf, is attached to this e-mail. The makefile, the markdown source, and the lua filter are also in a zip file attached to this message. I'm not sure how to do this using LaTeX output or HTML output. Does anybody else have ideas for those output formats? On Tue, Aug 11, 2020 at 3:45 PM Marty Heyman wrote: > We would like to use Pandoc Markdown as Source Language for a few complex > and large technical manuals (100s of pages). Indexing key germs is > seriously important. I searched these discussions and didn't see an obvious > path (nor from the manual). Any success or potentially useful avenues > you've tried? > > -- > 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/6109678b-fa72-4fab-b176-abe5dcb50039o%40googlegroups.com > > . > -- T. Kurt Bond, tkurtbond-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org, https://tkurtbond.github.io -- 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/CAN1EhV_4p5mS5ejS%2B-BAUYDNfxEsUMRuaibV%2B1qyh06Tnghj_A%40mail.gmail.com.