Crates.io | md2src |
lib.rs | md2src |
version | 1.1.0 |
source | src |
created_at | 2020-07-26 18:00:23.651547 |
updated_at | 2020-07-29 18:46:05.565595 |
description | Markdown to source. Extracts code blocks marked with triple backticks into files. |
homepage | https://github.com/AlexanderWillner/md2src |
repository | https://github.com/AlexanderWillner/md2src |
max_upload_size | |
id | 269810 |
size | 39,108 |
Simple rust library and CLI to extract code blocks marked with triple backticks from markdown files into source files.
To download the latest release, please run either cargo install md2src
or brew install AlexanderWillner/tap/md2src
.
Run run md2src README.md
to create the source file named code_snippet_000.rs
from the following code:
fn main() {
todo!();
}
$ md2src --help
md2src 1.1.0
Alexander Willner <alex@willner.ws>
Markdown to source. Extracts code blocks marked with triple backticks into files.
USAGE:
md2src [OPTIONS] <filename> [--] [folder]
FLAGS:
-h, --help Prints help information
-V, --version Prints version information
OPTIONS:
-e, --extension <extension> File extension for code files [default: rs]
-l, --language <language> Code snippet language to extract [default: rust]
-p, --prefix <prefix> Prefix code files with this string [default: code_snippet_]
-i, --ignore <string>... Ignore code with this string [default: // (note: this does not compile)]
ARGS:
<filename> Markdown file that contains the code snippets
<folder> Folder for the code snippets [default: .]