File tree Expand file tree Collapse file tree 3 files changed +15
-0
lines changed
Expand file tree Collapse file tree 3 files changed +15
-0
lines changed Original file line number Diff line number Diff line change @@ -136,6 +136,7 @@ export async function filterParamsJson(
136136 ...layoutFilterParams ( options . format ) ,
137137 ...languageFilterParams ( options . format . language ) ,
138138 ...jatsFilterParams ( options ) ,
139+ ...notebookContextFilterParams ( options ) ,
139140 ...filterParams ,
140141 [ kResultsFile ] : pandocMetadataPath ( resultsFile ) ,
141142 [ kTimingFile ] : pandocMetadataPath ( timingFile ) ,
@@ -466,6 +467,16 @@ function jatsFilterParams(options: PandocOptions) {
466467 }
467468}
468469
470+ function notebookContextFilterParams ( options : PandocOptions ) {
471+ const nbContext = options . services . notebook ;
472+ const notebooks = nbContext . all ( ) ;
473+ if ( notebooks . length > 0 ) {
474+ return {
475+ "notebook-context" : notebooks ,
476+ } ;
477+ }
478+ }
479+
469480async function quartoFilterParams (
470481 options : PandocOptions ,
471482 defaults ?: FormatPandoc ,
Original file line number Diff line number Diff line change @@ -155,6 +155,9 @@ export function notebookContext(): NotebookContext {
155155 }
156156
157157 return {
158+ all : ( ) => {
159+ return Object . values ( notebooks ) ;
160+ } ,
158161 get : ( nbAbsPath : string , context ?: ProjectContext ) => {
159162 const notebook = notebooks [ nbAbsPath ] ;
160163 const reviveRenders : RenderType [ ] = [ ] ;
Original file line number Diff line number Diff line change @@ -68,6 +68,7 @@ export interface NotebookTemplateMetadata extends NotebookMetadata {
6868export interface NotebookContext {
6969 // Retrieves the notebook from the context.
7070 get : ( nbPath : string , context ?: ProjectContext ) => Notebook | undefined ;
71+ all : ( ) => Notebook [ ] ;
7172 // Resolves the data on an executedFile into data that will
7273 // create a `renderType` output when rendered.
7374 resolve : (
You can’t perform that action at this time.
0 commit comments