Simple text preprocessor for content segmentation.
cargo install --git https://github.com/x0k/mk.gitnix profile install github:x0k/mkmkfile content:
common content
foo:
foo segment start
# segment with a dependency
bar: foo
bar segment content
# multiple segment definition
foo:
foo segment end$ mk bar | cat output:
common content
foo segment start
# segment with a dependency
bar segment content
# multiple segment definition
foo segment endThat's all.
- Content can be specified via std in or input files.
- By default, input file names should begin with
Mkfileormkfile. - Files are read in lexicographic order.
- The contents of the files are concatenated.
- By default, a temporary file will be created and executed.
- If you pipe the program to something then the std out will be used.
/at the end of the segment name defines a group./at the beginning of the dependency name indicates that name should be left as is.
foo:
foo content
group/:
pushd folder
bar: /foo
bar segment content
baz: bar
baz segment content
popdDesugared:
foo:
foo content
group:
pushd folder
group/bar: foo group
bar segment content
group/baz: group/bar group
baz segment content
group:
popdl/lib1/build:
build lib1
l/lib2/build:
build lib2
app: l/*/build
build appDesugared:
l/lib1/build:
build lib1
l/lib2/build:
build lib2
app: l/lib1/build l/lib2/build
build appNote
Completions ignore the input argument.
Source completions with bash:
echo "source <(COMPLETE=bash mk)" >> ~/.bashrc
For other shells see: clap_complete
MIT