File tree Expand file tree Collapse file tree 2 files changed +19
-1
lines changed
Expand file tree Collapse file tree 2 files changed +19
-1
lines changed Original file line number Diff line number Diff line change @@ -17,8 +17,23 @@ function renderAsciidoc()
1717 Meta = function (meta )
1818 if hasMath then
1919 meta [' asciidoc-stem' ] = ' latexmath'
20- return meta
2120 end
21+
22+ -- We construct the title with cross ref information into the metadata
23+ -- if we see such a title, we need to move the identifier up outside the title
24+ local titleInlines = meta [' title' ]
25+ if # titleInlines == 1 and titleInlines [1 ].t == ' Span' then
26+ local span = titleInlines [1 ]
27+ local identifier = span .identifier
28+ if refType (identifier ) == " sec" then
29+ -- this is a chapter title, tear out the id and make it ourselves
30+ local titleContents = pandoc .write (pandoc .Pandoc (span .content ), " asciidoc" )
31+ meta [' title' ] = pandoc .RawInline (" asciidoc" , titleContents )
32+ meta [' title-prefix' ] = pandoc .RawInline (" asciidoc" , " [[" .. identifier .. " ]]" )
33+ end
34+ end
35+
36+ return meta
2237 end ,
2338 Math = function (el )
2439 hasMath = true ;
Original file line number Diff line number Diff line change 11$if(titleblock)$
2+ $if(title-prefix)$
3+ $title-prefix$
4+ $endif$
25= $title$
36$if(by-author)$
47$for(by-author)$$it.name.literal$$if(it.email)$ <$it.email$>$endif$$ sep$; $endfor$
You can’t perform that action at this time.
0 commit comments