docutils-ts
Version:
Port of the Python Docutils library to TypeScript
33 lines (32 loc) • 1.26 kB
TypeScript
import * as nodes from '../nodes.js';
import Transform from '../transform.js';
import { Document, ElementInterface, NodeInterface } from "../types.js";
/**
* TitlePromoter transform.
* Base class for other transforms which promote section names to title and subtitle
*/
declare abstract class TitlePromoter extends Transform {
promoteTitle(node: NodeInterface): number | undefined;
promoteSubtitle(node: ElementInterface): number | undefined;
candidateIndex(node: ElementInterface): any[];
}
export declare class DocTitle extends TitlePromoter {
setMetadata(): void;
apply(): void;
}
export declare class SectionSubTitle extends TitlePromoter {
apply(): void;
}
export declare class DocInfo extends Transform {
private biblioNodes;
_init(document: Document, startNode: NodeInterface | undefined): void;
apply(): void;
extractBibliographic(fieldList: nodes.field_list): void;
checkEmptyBiblioField(field: any, name: any): void;
checkCompoundBiblioField(field: any, name: any): void;
extractAuthors(field: any, name: any, docinfo: any): void;
authorsFromOneParagraph(field: any): void;
authorsFromBulletList(field: any): void;
authorsFromParagraphs(field: any): void;
}
export { TitlePromoter };