UNPKG

myst-to-jats

Version:
32 lines 1.26 kB
import type { Plugin } from 'unified'; import type { Heading } from 'myst-spec'; import type { GenericParent } from 'myst-common'; import { NotebookCell } from 'myst-common'; import type { Options } from '../types.js'; export type Section = Omit<Heading, 'type'> & { type: 'section'; meta?: string; }; export declare function sectionAttrsFromBlock(node: { kind?: NotebookCell | string; identifier?: string; }): { 'sec-type'?: string; id?: string; }; /** * This transform does the following: * - For sub-articles: * - Blocks are converted to sections so notebook cell divisions are maintained. * - Within each block, headers are converted to sections. * - For main articles: * - Notebook code cell blocks (with meta.type of "notebook-code") are deleted. * - Remaining blocks are removed, lifting children up a level * - Top-level heading nodes are then used to break the tree into section nodes, * with heading and subsequent nodes as children */ export declare function sectionTransform(tree: GenericParent, opts?: Pick<Options, 'isSubArticle'>): void; export declare const sectionPlugin: Plugin<[ Pick<Options, 'isSubArticle'>? ], GenericParent, GenericParent>; //# sourceMappingURL=sections.d.ts.map