https://github.com/camacho/markdown-magic-directory-tree
Print directory tree in Markdown
https://github.com/camacho/markdown-magic-directory-tree
Last synced: 3 months ago
JSON representation
Print directory tree in Markdown
- Host: GitHub
- URL: https://github.com/camacho/markdown-magic-directory-tree
- Owner: camacho
- Created: 2017-01-11T22:51:05.000Z (over 8 years ago)
- Default Branch: master
- Last Pushed: 2022-03-26T14:01:17.000Z (about 3 years ago)
- Last Synced: 2025-01-02T09:11:50.763Z (4 months ago)
- Language: JavaScript
- Size: 41 KB
- Stars: 42
- Watchers: 2
- Forks: 95
- Open Issues: 2
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
- jimsghstars - camacho/markdown-magic-directory-tree - Print directory tree in Markdown (JavaScript)
README
# Directory tree plugin
Add directory tree to markdown files via [markdown-magic](https://github.com/DavidWells/markdown-magic)
## Install
```
npm i markdown-magic markdown-magic-directory-tree --save-dev
```## Adding the plugin
See `example.js` for usage.
```js
const fs = require('fs');
const path = require('path');
const markdownMagic = require('markdown-magic');const config = {
transforms: {
DIRTREE: require('./index.js'),
},
};const markdownPath = path.join(__dirname, 'README.md');
markdownMagic(markdownPath, config);
```## Usage in markdown
```
markdown-magic-directory-tree/
├── .npmrc
├── example.js
├── index.js
├── package-lock.json
├── package.json
└── README.md
```## Options
* **dir** - `process.cwd()` by default
* **ignore** - `['.git', '.gitkeep', '.gitignore', 'node_modules']` by default
* **depth** - `Infinity` by default (how deep in the tree to traverse)
* **onlyDirs** - `false` by default (how mnuch t)