0.1.0 • Published 4 years ago
remacro-core v0.1.0
remacro
Usage
With this tool it's possible to generate a superset of markdown, so that you don't want to repeat yourself.
It also works for any plain-text content, so it's able to expand source code as well.
Examples:
# 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
The syntax for writing macros is the same for writing components in React.
Live editor
Click here for a web-based editor with live preview.
CLI
Installation
npm install -g remacro
Call
remacro --input "$(cat file1.md)" --macros "$(cat file2.js)"
Integration with VSCode
TODO
0.1.0
4 years ago