0.2.20 • Published 3 years ago

@lackadaisical/markdown-binder-cli v0.2.20

Weekly downloads
70
License
GPL-3.0-or-later
Repository
github
Last release
3 years ago

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:

ValueTypeRequiredRequirements
keywordsarraytrue
subjectstringtrue
titlestringtrue
toc-depthnumberfalse1 - 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:

FlagDescriptionType
--versionShow version numberboolean
-i, --input-directoryInput Directorystring required
-c, --write-cleanWrite content without frontmatterboolean default: false
-d, --pandoc-defaults-basePandoc defaults base configurationboolean default: false
-f, --separate-frontmatterOutput frontmatter as a separate YAML metadata-fileboolean default: false
-m, --custom-metadataYAML configuration file - overrides pandoc defaults basestring
-o, --output-directoryOutput Directorystring
-r, --revision-historyGenerate revision history from provided schemastring
-s, --custom-schemaPath to JSONSchema to validate frontmatter againststring
-w, --write-defaultsWrite pandoc defaults file (configuration file)boolean
-h, --helpShow helpboolean
--verboseEnable verbose outputboolean default: false
0.2.20

3 years ago

0.2.19

3 years ago

0.2.18

3 years ago

0.2.17

3 years ago

0.2.16

3 years ago

0.2.15

3 years ago

0.2.14

3 years ago

0.2.13

3 years ago

0.2.12

3 years ago

0.2.11

3 years ago

0.2.10

3 years ago

0.2.7

3 years ago

0.2.9

3 years ago

0.2.8

3 years ago

0.2.1

3 years ago

0.2.0

3 years ago

0.2.6

3 years ago

0.2.3

3 years ago

0.2.2

3 years ago

0.2.5

3 years ago

0.2.4

3 years ago

0.1.0

3 years ago