myst-cli
Version:
Command line tools for MyST
37 lines • 1.8 kB
TypeScript
import type { Export, Licenses, PageFrontmatter } from 'myst-frontmatter';
import type { GenericParent } from 'myst-common';
import { RuleId } from 'myst-common';
import type { ValidationOptions } from 'simple-validators';
import { VFile } from 'vfile';
import type { ISession } from './session/types.js';
export declare function frontmatterValidationOpts(vfile: VFile, opts?: {
property?: string;
ruleId?: RuleId;
}): ValidationOptions;
/**
* Get page frontmatter from mdast tree
*
* @param session
* @param tree - mdast tree already loaded
* @param vfile - vfile used for logging
* @param preFrontmatter - incoming frontmatter for the page that is not from the project or in the tree
* @param keepTitleNode - do not remove leading H1 even if it is lifted as title
*/
export declare function getPageFrontmatter(session: ISession, tree: GenericParent, vfile: VFile, preFrontmatter?: Record<string, any>, keepTitleNode?: boolean): {
frontmatter: PageFrontmatter;
identifiers: string[];
};
export declare function processPageFrontmatter(session: ISession, pageFrontmatter: PageFrontmatter, validationOpts: ValidationOptions, path?: string): PageFrontmatter;
export declare function prepareToWrite(frontmatter: {
license?: Licenses;
}): {
license?: Licenses;
} | {
license: string | {
content?: string | import("myst-frontmatter").License;
code?: string | import("myst-frontmatter").License;
};
};
export declare function getExportListFromRawFrontmatter(session: ISession, rawFrontmatter: Record<string, any> | undefined, file: string): Export[];
export declare function updateFileInfoFromFrontmatter(session: ISession, file: string, frontmatter: PageFrontmatter, url?: string, dataUrl?: string): void;
//# sourceMappingURL=frontmatter.d.ts.map