File tree Expand file tree Collapse file tree 2 files changed +9
-0
lines changed
Expand file tree Collapse file tree 2 files changed +9
-0
lines changed Original file line number Diff line number Diff line change 66*/
77
88import { RenderedFile } from "../../../command/render/types.ts" ;
9+ import { PandocOptions , RenderedFile } from "../../../command/render/types.ts" ;
910import { kTitle } from "../../../config/constants.ts" ;
1011import { Format } from "../../../config/types.ts" ;
1112import { parsePandocTitle } from "../../../core/pandoc/pandoc-partition.ts" ;
@@ -41,6 +42,8 @@ export interface BookExtension {
4142 // bool extensions are single file by default but can elect to be multi file
4243 multiFile ?: boolean ;
4344
45+ filterParams ?: ( options : PandocOptions ) => Record < string , unknown > ;
46+
4447 formatOutputDirectory ?: ( format : Format ) => string ;
4548
4649 // book extensions can modify the format before render
Original file line number Diff line number Diff line change @@ -136,12 +136,18 @@ export const bookProjectType: ProjectType = {
136136 } ,
137137
138138 filterParams : ( options : PandocOptions ) => {
139+ const bookExt = options . format . extensions ?. book as BookExtension ;
140+ const filterParams = bookExt . filterParams
141+ ? bookExt . filterParams ( options )
142+ : { } ;
139143 if ( isMultiFileBookFormat ( options . format ) ) {
140144 return {
145+ ...filterParams ,
141146 [ kCrossrefResolveRefs ] : false ,
142147 } ;
143148 } else {
144149 return {
150+ ...filterParams ,
145151 [ kSingleFileBook ] : true ,
146152 } ;
147153 }
You can’t perform that action at this time.
0 commit comments