Generates a list of markdown files from a directory tree, with links to each file, and maintains this tree in README.md files in each directory.
You can globally install markdown-docs-tree
with npm/yarn/pnpm:
npm install -g markdown-docs-tree # or
yarn global add markdown-docs-tree # or
pnpm add -g markdown-docs-tree
Or run it directly without installing:
npx markdown-docs-tree # or
pnpm dlx markdown-docs-tree
markdown-docs-tree [dir]
acts upon the specified directory, or the current directory by default, and modifies README.md
files there and in subdirectories.
For each markdown file, it will read titles from (in order of precedence):
- A title property in yaml front matter
- The first h1 heading in the Markdown file
- The first heading in the Markdown file
- The filename
Tool | Difference |
---|---|
markdown-file-tree |
markdown-file-tree is focused on generating a tree of markdown files for a GitHub Wiki (_Sidebar.md ), but markdown-docs-tree is focused on generating a tree of markdown files for a directory of markdown files anywhere in a repo. |
markdown-notes-tree |
markdown-notes-tree limits the amount of content that can be put into the README.md for a subdirectory to a single paragraph, and fences the description of the subdirectory. markdown-docs-tree allows for arbitrary content to be included in the README.md for a subdirectory, and fences the location of the tree only. |