markdown-magic-directory-tree
v2.1.0
Published
Print an archy tree for markdown file
Maintainers
Readme
Directory tree plugin
Add directory tree to markdown files via markdown-magic
Install
npm i markdown-magic markdown-magic-directory-tree --save-devAdding the plugin
See example.ts for usage.
import path from 'path';
import { markdownMagic } from 'markdown-magic';
import DIRTREE from './index.ts';
const config = {
matchWord: 'AUTO-GENERATED-CONTENT',
transforms: {
DIRTREE,
},
};
const markdownPath = path.join(import.meta.dirname, 'README.md');
await markdownMagic(markdownPath, config);Usage in markdown
directory-tree/
├── __fixtures__/
├── __snapshots__/
├── CHANGELOG.md
├── example.ts
├── index.spec.ts
├── index.ts
├── LICENSE
├── package.json
├── README.md
├── tsconfig.build.json
└── types.tsOptions
- dir -
process.cwd()by default - ignore -
['.git', '.gitkeep', '.gitignore', 'node_modules']by default - depth -
Infinityby default (how deep in the tree to traverse) - onlyDirs -
falseby default (how mnuch t)
