
Security News
Deno 2.2 Improves Dependency Management and Expands Node.js Compatibility
Deno 2.2 enhances Node.js compatibility, improves dependency management, adds OpenTelemetry support, and expands linting and task automation for developers.
markdown-notes-tree
Advanced tools
Generate Markdown trees that act as a table of contents for a folder structure with Markdown notes
If you have a folder structure with Markdown notes, you can use this tool to generate Markdown trees that act as a table of contents for the folder structure.
By default, the tool does the following:
README.md
file (in the directory where the tool is executed)README.md
files in subdirectories, each containing the subdirectory's name as title and a tree of the subdirectory's contents (can be disabled through command line arguments)You can run the tool again and again without changing the result. Once a tree has been written to your main README.md
file, you can add anything below the tree (or move the tree) and the tool will respect the tree's boundaries.
Of course, it is recommended to run the tool again every time you make changes to the Markdown notes in your folder structure. It can be useful to include the tool in build scripts or pre-commit hooks.
npm install -D markdown-notes-tree
You can run the tool by running npx markdown-notes-tree
from the command line or invoking markdown-notes-tree
from an npm script.
Make sure to run the tool in the top-level directory of your Markdown notes folder structure.
By default, the tool ignores:
.
or _
node_modules
foldersYou can customize this using the --ignore
and --includeAllDirectoriesByDefault
command line arguments (see below).
The generated README.md
files for subdirectories provide some space to add a description for the directory. If a description is provided, it will be preserved and it will also be included in generated trees containing the directory.
--ignore
: Specify glob pattern for additional files or folders to ignore. You can use this argument multiple times in order to specify multiple glob patterns.
markdown-notes-tree --ignore **/CONTRIBUTING.md
markdown-notes-tree --ignore CONTRIBUTING.md --ignore sub1/CONTRIBUTING.md
markdown-notes-tree --ignore exclude-this-folder
--includeAllDirectoriesByDefault
: Include all directories by default (don't apply the default ignored folders listed above). You can combine this with custom ignores as needed.
markdown-notes-tree --includeAllDirectoriesByDefault --ignore node_modules
--linkToSubdirectoryReadme
: When linking to a subdirectory, link directly to its README.md
file. Note that this assumes that each subdirectory will actually have a README.md
file. By default, the tool generates these automatically.
markdown-notes-tree --linkToSubdirectoryReadme
--noSubdirectoryTrees
: Don't write README.md
files to subdirectories. Any existing README.md
files in subdirectories will be ignored.
markdown-notes-tree --noSubdirectoryTrees
--notesBeforeDirectories
: If a directory contains both notes and subdirectories, put the notes before the subdirectories in he tree. By default, it's the other way around.
markdown-notes-tree --notesBeforeDirectories
--orderNotesByTitle
: Order notes in the same (sub)directory by title instead of by filename.
markdown-notes-tree --orderNotesByTitle
--silent
: Don't log to the console during execution.
markdown-notes-tree --silent
--subdirectoryDescriptionOnNewLine
: If subdirectory descriptions are provided, put them on a new line in the tree.
markdown-notes-tree --subdirectoryDescriptionOnNewLine
--useTabs
: Use tabs (instead of the standard four spaces) for indentation.
markdown-notes-tree --useTabs
This project is using Prettier to format the JavaScript code. Installing the VS Code plugin recommended through the extensions.json
file should make this easy.
The build script verifies that the formatting actually matches Prettier style and that the unit and integration tests are passing.
During development, you can run the tool on a folder by navigating to the folder in the command line and then executing node path/to/cli.js
, adding arguments as needed. Example: node ../../../cli.js --silent
FAQs
Generate Markdown trees that act as a table of contents for a folder structure with Markdown notes
The npm package markdown-notes-tree receives a total of 936 weekly downloads. As such, markdown-notes-tree popularity was classified as not popular.
We found that markdown-notes-tree demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
Deno 2.2 enhances Node.js compatibility, improves dependency management, adds OpenTelemetry support, and expands linting and task automation for developers.
Security News
React's CRA deprecation announcement sparked community criticism over framework recommendations, leading to quick updates acknowledging build tools like Vite as valid alternatives.
Security News
Ransomware payment rates hit an all-time low in 2024 as law enforcement crackdowns, stronger defenses, and shifting policies make attacks riskier and less profitable.