pimd icon indicating copy to clipboard operation
pimd copied to clipboard

New command: include

Open hagenburger opened this issue 6 years ago • 1 comments

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

<?include filename ?>

Renderes the given filename at the same location the include command was called from.

Example usage

main.md:

# Main Markdown file

Text 1

<?include second.md ?>

Text 2

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>

Unwanted

Make sure, the imported file does not get wrapped in for example a <p> like this:

<h1>Main Markdown file</h1>
<p>Text 1</p>
<p>
  <h2>Second Markdown file</h2>
  <p>Text 3</p>
</p>
<p>Text 2</p>

Help

For writing tests: This should either have files as test cases or mock the file methods from Node.

hagenburger avatar Aug 15 '18 16:08 hagenburger