https://github.com/alexanderwillner/md2src
Markdown to Source (written in Rust)
https://github.com/alexanderwillner/md2src
cargo cli markdown rust
Last synced: 9 months ago
JSON representation
Markdown to Source (written in Rust)
- Host: GitHub
- URL: https://github.com/alexanderwillner/md2src
- Owner: AlexanderWillner
- License: apache-2.0
- Created: 2020-07-26T17:28:22.000Z (over 5 years ago)
- Default Branch: master
- Last Pushed: 2020-07-29T18:46:07.000Z (over 5 years ago)
- Last Synced: 2025-03-29T14:06:29.903Z (10 months ago)
- Topics: cargo, cli, markdown, rust
- Language: Rust
- Homepage:
- Size: 56.6 KB
- Stars: 1
- Watchers: 2
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Mardown to Source
Simple rust library and CLI to extract code blocks marked with triple backticks from markdown files into source files.
[](https://github.com/AlexanderWillner/md2src/actions) [](https://coveralls.io/github/AlexanderWillner/md2src?branch=master) [](https://crates.io/crates/md2src) [](https://github.com/AlexanderWillner/md2src/releases)
## Installation
To download the latest release, please run either ```cargo install md2src``` or ```brew install AlexanderWillner/tap/md2src```.
## Example
Run run ```md2src README.md``` to create the source file named ```code_snippet_000.rs``` from the following code:
```rust
fn main() {
todo!();
}
```
## Help
```bash
$ md2src --help
md2src 1.1.0
Alexander Willner
Markdown to source. Extracts code blocks marked with triple backticks into files.
USAGE:
md2src [OPTIONS] [--] [folder]
FLAGS:
-h, --help Prints help information
-V, --version Prints version information
OPTIONS:
-e, --extension File extension for code files [default: rs]
-l, --language Code snippet language to extract [default: rust]
-p, --prefix Prefix code files with this string [default: code_snippet_]
-i, --ignore ... Ignore code with this string [default: // (note: this does not compile)]
ARGS:
Markdown file that contains the code snippets
Folder for the code snippets [default: .]
```