markdown_splitter 0.1.1

Utility tool to split a Markdown file into chunks from annotations
Documentation
  • Coverage
  • 71.43%
    5 out of 7 items documented2 out of 6 items with examples
  • Size
  • Source code size: 30.2 kB This is the summed size of all the files inside the crates.io package for this release.
  • Documentation size: 328.6 kB This is the summed size of all files generated by rustdoc for all configured targets
  • Ø build duration
  • this release: 20s Average build duration of successful builds.
  • all releases: 20s Average build duration of successful builds in releases after 2024-10-23.
  • Links
  • Homepage
  • romainbou/markdown-splitter
    1 0 0
  • crates.io
  • Dependencies
  • Versions
  • Owners
  • romainbou

Markdown Splitter

Utility tool to split a Markdown file into chunks following annotations

Annotation syntax

In order to identify which part of the document should be splitted we can use 'export' open and closing tags

# This is a document the is going to be splitted

<!-- export -->
This unnamed part will generate a new `export.md`
<!-- /export -->

This part will be ignored

<!-- export part1 -->
This contents will generate a new `part1.md`
<!-- /export part1 -->

<!-- export part-two.md -->
This contents will generate a new `part-two.md`
With multiple lines
<!-- /export -->

Usage

mds markdown.md
tree
.
├── export.md
├── markdown.md
├── part1.md
└── part-two.md

Options

mds markdown.md
`export.md` created
`part1.md` created
`part-two.md` created

Specifying a default output file

mds markdown.md -o export.md
`export.md` created

Use Case

Maintaining a diary or a blog in one file with annotations. This tool allows to split the file into multiple markdown files for each articles. Those markdown articles are now easy to publish with static site generators like Gatsby.

Build

cargo build

Test

cargo test

TODO

  • Support multiple export tags per file.
  • Support named export tags.
  • Better tags parsing.