File tree Expand file tree Collapse file tree 3 files changed +37
-1
lines changed
Expand file tree Collapse file tree 3 files changed +37
-1
lines changed Original file line number Diff line number Diff line change @@ -45,11 +45,24 @@ export function asciidocFormat(): Format {
4545 ) ;
4646}
4747
48+ const kFormatOutputDir = "asciidoc" ;
49+
50+ // Ref target marks the refs div so the post process can inject the bibliography
51+ const kRefTargetIdentifier = "refs-target-identifier" ;
52+ const kRefTargetIndentifierValue = "// quarto-refs-target-378736AB" ;
53+ const kUseAsciidocNativeCites = "use-asciidoc-native-cites" ;
54+
4855// This provide book specific behavior for producing asciidoc books
4956const asciidocBookExtension = {
5057 multiFile : true ,
5158 formatOutputDirectory ( _format : Format ) {
52- return "asciidoc" ;
59+ return kFormatOutputDir ;
60+ } ,
61+ filterParams : ( _options : PandocOptions ) => {
62+ return {
63+ [ kUseAsciidocNativeCites ] : true ,
64+ [ kRefTargetIdentifier ] : kRefTargetIndentifierValue ,
65+ } ;
5366 } ,
5467 async onMultiFilePrePrender (
5568 isIndex : boolean ,
Original file line number Diff line number Diff line change @@ -59,6 +59,7 @@ import("./quarto-init/configurefilters.lua")
5959import (" ./quarto-init/includes.lua" )
6060import (" ./quarto-init/resourcerefs.lua" )
6161
62+ import (" ./quarto-post/asciidoc.lua" )
6263import (" ./quarto-post/book.lua" )
6364import (" ./quarto-post/cites.lua" )
6465import (" ./quarto-post/delink.lua" )
@@ -219,6 +220,7 @@ local quartoPre = {
219220local quartoPost = {
220221 -- quarto-post
221222 { name = " post-cites" , filter = indexCites () },
223+ { name = " post-asciidoc" , filter = asciidoc () },
222224 { name = " post-foldCode" , filter = foldCode () },
223225 { name = " post-figureCleanupCombined" , filter = combineFilters ({
224226 latexDiv (),
Original file line number Diff line number Diff line change 1+ -- asciidoc.lua
2+ -- Copyright (C) 2020-2022 Posit Software, PBC
3+
4+
5+ local kAsciidocNativeCites = ' use-asciidoc-native-cites'
6+
7+ function asciidoc ()
8+ return {
9+ Cite = function (el )
10+ if quarto .doc .isFormat (" asciidoc" ) and param (kAsciidocNativeCites ) then
11+ local citesStr = " "
12+ el .citations :map (function (cite )
13+ citesStr = citesStr .. ' <<' .. cite .id .. ' >>'
14+ end )
15+ return pandoc .RawInline (" asciidoc" , citesStr );
16+ end
17+ end
18+ }
19+ end
20+
21+
You can’t perform that action at this time.
0 commit comments