@lackadaisical/markdown-binder-cli v0.2.20
README
This script will process all Markdown folders within a specified directory (and all subdirectories).
It will concatenate the files after doing a natural sort on the file paths.
Any images in each file will have their paths made absolute in the output. Footnotes are also made unique on a per-file basis to ensure that no collisions occur.
YAML frontmatter is required, and the provided values are validated against an inbuilt schema.
The output file name will be based on the 'title' value. If multiple YAML blocks exist, values will be extracted & validated from the first.
The following outlines the frontmatter schema:
Value | Type | Required | Requirements |
---|---|---|---|
keywords | array | true | |
subject | string | true | |
title | string | true | |
toc-depth | number | false | 1 - 5 |
Usage
First, grab any dependencies:
yarn install
Then, run the script using nodejs:
node index.js -i «path/to/input-dir»
By default, the script will output to input-directory/build, however you can use the -o option to set an alternate output path.
The script will fail (by design) if the output folder does not exist.
Other flags:
Flag | Description | Type |
---|---|---|
--version | Show version number | boolean |
-i , --input-directory | Input Directory | string required |
-c , --write-clean | Write content without frontmatter | boolean default: false |
-d , --pandoc-defaults-base | Pandoc defaults base configuration | boolean default: false |
-f , --separate-frontmatter | Output frontmatter as a separate YAML metadata-file | boolean default: false |
-m , --custom-metadata | YAML configuration file - overrides pandoc defaults base | string |
-o , --output-directory | Output Directory | string |
-r , --revision-history | Generate revision history from provided schema | string |
-s , --custom-schema | Path to JSONSchema to validate frontmatter against | string |
-w , --write-defaults | Write pandoc defaults file (configuration file) | boolean |
-h , --help | Show help | boolean |
--verbose | Enable verbose output | boolean default: false |
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
3 years ago