https://github.com/morulus/markdown-structure-loader
Load markdown document structure
https://github.com/morulus/markdown-structure-loader
Last synced: 1 day ago
JSON representation
Load markdown document structure
- Host: GitHub
- URL: https://github.com/morulus/markdown-structure-loader
- Owner: morulus
- License: mit
- Created: 2019-03-10T21:54:18.000Z (over 7 years ago)
- Default Branch: master
- Last Pushed: 2023-01-04T23:18:27.000Z (over 3 years ago)
- Last Synced: 2025-06-10T09:41:16.382Z (about 1 year ago)
- Language: JavaScript
- Size: 15.6 KB
- Stars: 1
- Watchers: 1
- Forks: 0
- Open Issues: 2
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
markdown-structure-loader
==
Webpack loader which load markdown structure
Heading 2
--
### Heading 3
#### Heading 4 with `code`
##### Heading 5
##### Heading 4 again
###### Heading 6
## Heading 2 again
# Last heading 1
Will give:
```json
[
{
"heading": "markdown-structure-loader",
"depth": 1,
"children": [
{
"heading": "Heading 2",
"depth": 2,
"children": [
{
"heading": "Heading 3",
"depth": 3,
"children": [
{
"heading": "Heading 4 with code",
"depth": 4,
"children": [
{
"heading": "Heading 5",
"depth": 5,
"children": []
},
{
"heading": "Heading 4 again",
"depth": 5,
"children": [
{
"heading": "Heading 6",
"depth": 6,
"children": []
}
]
}
]
}
]
}
]
},
{
"heading": "Heading 2 again",
"depth": 2,
"children": []
}
]
},
{
"heading": "Last heading 1",
"depth": 1,
"children": []
}
]
```
Options
--
- `getAst` Keep original AST value of heading
Author and license
--
Morulus
Under [MIT](./LICENSE) license, 2019