/** * Copyright 2017-present Palantir Technologies, Inc. All rights reserved. * Licensed under the BSD-3 License as modified (the “License”); you may obtain * a copy of the license in the LICENSE and PATENTS files in the root of this * repository. */ import * as marked from "marked"; import { IBlock, ICompiler } from "./client"; export interface ICompilerOptions { /** Options for markdown rendering. See https://github.com/chjj/marked#options-1. */ markdown?: marked.MarkedOptions; /** * Reserved @tags that should be preserved in the contents string. * A common use case is allowing specific code constructs, like `@Decorator` names. * Do not include the `@` prefix in the strings. */ reservedTags?: string[]; /** * Base directory for generating relative `sourcePath`s. * * This option _does not affect_ glob expansion, only the generation of * `sourcePath` in plugin data. * @default process.cwd() */ sourceBaseDir?: string; } export declare class Compiler implements ICompiler { private options; constructor(options: ICompilerOptions); objectify(array: T[], getKey: (item: T) => string): { [key: string]: T; }; relativePath: (path: string) => string; renderBlock: (blockContent: string, reservedTagWords?: string[] | undefined) => IBlock; renderMarkdown: (markdown: string) => string; /** * Converts the content string into an array of `ContentNode`s. If the * `contents` option is `html`, the string nodes will also be rendered with * markdown. */ private renderContents; /** * Extracts optional YAML frontmatter metadata block from the beginning of a * markdown file and parses it to a JS object. */ private extractMetadata; /** * Splits the content string when it encounters a line that begins with a * `@tag`. You may prevent this splitting by specifying an array of reserved * tag names. */ private parseTags; }