Extract sections of a markdown file with a regular expression! Great for changelogs ;)
Given a document called my-document.md
:
```markdown
This is my amazing markdown document.
This section should be pulled out. ```
You can extract the second section with the following command:
```console $ markdown-extract "Extract me!" my-document.md
This section should be pulled out. ```
If you've got Rust installed on your system, you can simply install
markdown-extract
with Cargo.
console
$ cargo install markdown-extract
A Docker image is also available, and can be installed with the following command:
console
$ docker pull sean0x42/markdown-extract:v2
You can then run the container with the following command:
console
$ docker run -it sean0x42/markdown-extract:v2 --help
Note that because markdown-extract accesses the file system, you will need to mount a volume if you want to access a file on the host. e.g.
console
$ docker run -v $PWD:/opt -it sean0x42/markdown-extract:v2 v2.0.0 /opt/CHANGELOG.md
If you know a better way of achieving this, please let me know!
There aren't many, to be honest.
CHANGELOG.md
by version.markdown-extract
to extract API
documentation, and inject it into OpenAPI schemas.If you have another use for this tool, please let me know!