Open hagenburger opened 6 years ago
This command will include the result of another Markdown file into the current one.
The plugin should be named @pimd/include-plugin.
@pimd/include-plugin
<?include filename ?>
Renderes the given filename at the same location the include command was called from.
include
main.md:
main.md
# Main Markdown file Text 1 <?include second.md ?> Text 2
second.md:
second.md
## Second Markdown file Text 3
Rendered result (when main.md gets rendered):
<h1>Main Markdown file</h1> <p>Text 1</p> <h2>Second Markdown file</h2> <p>Text 3</p> <p>Text 2</p>
Make sure, the imported file does not get wrapped in for example a <p> like this:
<p>
<h1>Main Markdown file</h1> <p>Text 1</p> <p> <h2>Second Markdown file</h2> <p>Text 3</p> </p> <p>Text 2</p>
For writing tests: This should either have files as test cases or mock the file methods from Node.
#16 New command: include
New feature as plugin
This command will include the result of another Markdown file into the current one.
The plugin should be named
@pimd/include-plugin
.Specifications
Renderes the given filename at the same location the
include
command was called from.Example usage
main.md
:second.md
:Rendered result (when
main.md
gets rendered):Unwanted
Make sure, the imported file does not get wrapped in for example a
<p>
like this:Help
For writing tests: This should either have files as test cases or mock the file methods from Node.