UNPKG

docutils-ts

Version:

Port of the Python Docutils library to TypeScript

29 lines (28 loc) 996 B
import { Settings } from "./settings.js"; import { Document, LoggerType } from "./types.js"; /** * Return a new empty document object. * * :Parameters: * `source_path` : string * The path to or description of the source text of the document. * `settings` : optparse.Values object * Runtime settings. If none are provided, a default core set will * be used. If you will use the document object with any Docutils * components, you must provide their default settings as well. For * example, if parsing, at least provide the parser settings, * obtainable as follows:: * * settings = docutils.frontend.OptionParser( * components=(docutils.parsers.rst.Parser,) * ).get_default_values() * {@link module:nodes~document} * @returns {module:nodes~document} New document * @see module:newDocument~newDocument */ declare function newDocument(args: { sourcePath: string; logger: LoggerType; }, settings?: Settings): Document; export { newDocument }; export default newDocument;