modmd
v0.0.1
Published
Markdown include resolver
Readme
modown
Markdown include resolver - A library that recursively resolves include comments in Markdown files.
Features
- Finds
<!-- @path/to/file.md -->comments in Markdown files and replaces them with the content of the specified file - Supports recursive includes - included files can also contain include comments
Installation
npm install modown
# or
pnpm add modown
# or
yarn add modownUsage
CLI
# 파일 내용을 표준 출력으로 출력
npx modown input.md
# 결과를 파일로 저장
npx modown input.md > output.mdProgrammatic API
import { resolveIncludes } from 'modmd'
const result = resolveIncludes('./main.md')
console.log(result)Example
main.md:
# Main Document
<!-- @./intro.md -->
## Body
...intro.md:
Introduction content.Result:
# Main Document
Introduction content.
## Body
...Recursive Example
main.md:
# Main Document
<!-- @./section1.md -->section1.md:
## Section 1
<!-- @./subsection.md -->subsection.md:
### Subsection
Content here.Result:
# Main Document
## Section 1
### Subsection
Content here.License
MIT
