Skip to content

Commit 26a4322

Browse files
committed
Add comments to lua filter
1 parent cc1f9c1 commit 26a4322

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

src/html-index.lua

+4
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@ end
2222
if quarto.doc.is_format("html") then -- latex uses mkindex, not this
2323
return {
2424
RawBlock = function(el)
25+
-- this filter is in charge of producing the HTML anchors the index will link to
2526
if el.format == "html" then
2627
local indexEntry = extractIndexEntry(el.text)
2728
if indexEntry ~= nil then
@@ -33,6 +34,9 @@ if quarto.doc.is_format("html") then -- latex uses mkindex, not this
3334
Strong = function(el2)
3435
return pandoc.walk_inline(el2, {
3536
Code = function(el3)
37+
-- this filter produces links to the index from the function's name
38+
-- Because we format these as **``functionName``** in the markdown
39+
-- it will always be a Strong element containing a Code element
3640
if el3.text ~= nil then
3741
-- only create a link if this appears in the index
3842
local escaped = escape(el3.text)

0 commit comments

Comments
 (0)