@lackadaisical/markdown-binder v0.4.0
@lackadaisical/markdown-binder
A module that concatenates Markdown output for use with pandoc.
Installation and Usage
npm:
npm install @lackadaisical/markdown-binder
Yarn:
yarn add @lackadaisical/markdown-binder
bindMarkdown
export default async function bindMarkdown(
input: string | string[],
customMetadata?: Record<string, unknown>,
defaultsBase?: Record<string, unknown>,
revisionHistory?: Record<string, Record<string, unknown>>,
customSchema?: Record<string, Record<string, unknown>>
): Promise<boundMarkdown> {
Where:
input
is:
- an array of pathlike strings or;
- a pathlike string.
Optional Params:
customMetadata?: Record<string, unknown>,
defaultsBase?: Record<string, unknown>,
revisionHistory?: Record<string, Record<string, unknown>>,
customSchema?: Record<string, Record<string, unknown>>
customMetadata: The content of a pandoc custom metadata-file, or list of keys to be treated as metadata values.
defaultsBase: The content of a pandoc defaults file to be used as the base for configuration.
revisionHistory: An object containing Approvers, their position, and the dates that they are approving documents.
customSchema: An object containing a JSONSchema to validate frontmatter values against.
Returns:
An object containing:
- Processed Markdown file
- Frontmatter
- Pandoc defaults file
{
"properties": {
"documentContent": {
"content": {
"description": "Concatenated Markdown content.",
"type": "string",
},
"encoding": {
"description:": "Encoding for source file(s).",
"type": "String"
}
},
"documentFrontmatter": {
"description": "Object containing frontmatter keys.",
"type": "object"
},
"pandocConfiguration": {
"description": "The content of a pandoc defaults file, validated against a built-in schema",
"type": "object"
}
}
}
2 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago