0.4.0 • Published 2 years ago

@lackadaisical/markdown-binder v0.4.0

Weekly downloads
133
License
GPL-3.0-or-later
Repository
-
Last release
2 years ago

@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"
    }
  }
}
0.4.0

2 years ago

0.3.1

3 years ago

0.3.0

3 years ago

0.2.12

3 years ago

0.2.11

3 years ago

0.2.10

3 years ago

0.2.9

3 years ago

0.2.8

3 years ago

0.2.7

3 years ago

0.2.6

3 years ago

0.2.5

3 years ago

0.2.4

3 years ago

0.2.1

3 years ago

0.2.3

3 years ago

0.2.2

3 years ago

0.2.0

3 years ago

0.1.5

3 years ago

0.1.4

3 years ago

0.1.3

3 years ago

0.1.2

3 years ago

0.1.1

3 years ago

0.1.0

3 years ago