Command line utility that can be called to parse a specific Markdown file into a SUMMARY.json file or dictionary with the following format:
{
"array": [
{
"title": "Link Title",
"link": "file.md",
"sub": [
{
"title": "Link Title 3",
"link": "file3.md",
"sub": [ ... ]
},
...
]
},
{
"title": "Link Title 2",
"link": "file2.md"
}
],
"title": ""
}
- Clone the repository
- Navigate to the root and run
npm install
- Run
npm run build
- The utility can be used by calling
gensum
- Test that you have the utility working by running
gensum -v
to get the version number. - You can also try
gensum -h
orgensum --help
This repository comes with a sample
folder in the root directory of this repository containing two identical Markdown files aside from their filenames. The tool will not work if you use sample.md
, since it should only work with files named SUMMARY.md
or summary.md
. You can use those files to mess around with development.
gensum verify [options] <path> [src]
Available Options:
-a, --abs
- Ignores[src]
and assumes<path>
is an absolute filepath.
Available Arguments:
<path>
- Required argument. The filepath of the Markdown file.[src]
- Optional argument. If specified, the Markdown file's path will become relative to the directory specified in this folder. If not specified, gensum will use the current working directory.
gensum generate [options] <path> [src]
Alias: gen
Available Options:
-a --abs
- Ignores[src]
and assumes<path>
is an absolute filepath.-j --outjson
- Outputs the summary dictionary asSUMMARY.json
instead of just outputting the summary dictionary
Available Arguments:
<path>
- Required argument. The filepath of the Markdown file.[src]
- Optional argument. If specified, the Markdown file's path will become relative to the directory specified in this folder. If not specified, gensum will use the current working directory.