With this tool it's possible to generate a superset of markdown, so that you don't repeat yourself.
It also works for any plain-text content, so it's able to expand source code as well.
Examples:
Input | Macros | Output |
# Hello World
Lorem ipsum
<LoveBox>This is a custom widget</LoveBox> |
const Box = ({ icon, children }) => `> :${icon}: ${children}`
const LoveBox = ({ children }) => <Box icon="heart">{children}</Box> |
# Hello World
Lorem ipsum
> :heart: This is a custom widget |
foo, err := bar()
<Err v=foo /> |
const Err = ({ v }) => `if err != nil {
return nil, err
}
return ` v ", nil" |
foo, err := bar()
if err != nil {
return nil, err
}
return foo, nil |
Click here for a web-based editor with live preview.
npm install -g remacro
remacro --input "$(cat input.md)" --macros "$(cat macros.js)" > output.md
TODO