myst-cli
Version:
Command line tools for MyST
29 lines • 1.44 kB
TypeScript
import type { GenericParent } from 'myst-common';
import type { PageFrontmatter } from 'myst-frontmatter';
import type { VFile } from 'vfile';
import type { ISession } from '../session/types.js';
import type { LoadFileResult } from '../process/file.js';
/**
* Return resolveFile function
*
* If `sourceFile` is format .tex, `relativeFile` will be resolved relative to the
* original baseFile; otherwise, it will be resolved relative to `sourceFile`.
*
* The returned function will resolve the file as described above, and return it if
* it exists or log an error and return undefined otherwise.
*/
export declare const makeFileResolver: (baseFile: string) => (relativeFile: string, sourceFile: string, sourcePath: string, vfile: VFile) => string | undefined;
/**
* Return loadFile function
*
* Loaded file is added to original baseFile's dependencies.
*/
export declare const makeFileLoader: (session: ISession, baseFile: string) => (fullFile: string) => string;
/**
* Return paresContent function
*
* Handles html and tex files separately; all other files are treated as MyST md.
*/
export declare const makeContentParser: (session: ISession, file: string) => (filename: string, content: string) => Promise<LoadFileResult>;
export declare function includeFilesTransform(session: ISession, baseFile: string, tree: GenericParent, frontmatter: PageFrontmatter, vfile: VFile): Promise<void>;
//# sourceMappingURL=include.d.ts.map