Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/cobular/md-include
https://github.com/cobular/md-include
Last synced: about 2 months ago
JSON representation
- Host: GitHub
- URL: https://github.com/cobular/md-include
- Owner: Cobular
- License: mit
- Created: 2023-10-09T21:10:45.000Z (about 1 year ago)
- Default Branch: main
- Last Pushed: 2023-10-09T21:32:30.000Z (about 1 year ago)
- Last Synced: 2024-10-31T11:39:28.897Z (2 months ago)
- Language: Rust
- Size: 10.7 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: license.md
Awesome Lists containing this project
README
# MD Include
A simple tool to insert other files into markdown (or any) files.
Simply place the string `{{ embed_file(path="") }}` into your file, then call `md-include` on it:
```bash
$ ls
file.md$ cat file.md
some stuff
more stuff{{ embed_file(path="") }}
last_stuff
$ md-include file.md
some stuff
more stuffCONTENTS FROM THAT FILE
last_stuff
```## Installing
`cargo install md-include`
## Usage
```bash
A tool to include any file in markdown filesUsage: md-include [OPTIONS] [CUSTOM_PANDOC_FLAGS]...
Arguments:
The root directory to recursively search for markdown files
[CUSTOM_PANDOC_FLAGS]... Custom flags to pass to pandocOptions:
-o, --output-pdf Output to PDF instead of stdout
-h, --help Print help
-V, --version Print version
```If you pass a glob instead of a single file, this tool will parse and embed all `embed_file`s, then concat them all seperated by `\n\n * * * \n\n` (a Markdown
)The sort order is based on depth of paths, with ties broken by alphabetical order.
You can also use `-o` and this will call pandoc to convert markdown to pdf.