markdown-magic
markdown-magic copied to clipboard
Feature Request: Comment range
Currently the code injection allows you to specify lines of code from a file:
<!-- AUTO-GENERATED-CONTENT:START (CODE:src=./relative/path/to/code.js&lines=22-44) -->
This content will be dynamically replaced with code from the file lines 22 through 44
<!-- AUTO-GENERATED-CONTENT:END -->
This can be dificult to maintain as line numbers are subject to change with API changes. An easier way to do this would be to select between specified comment blocks. Here's a simple example:
<!-- AUTO-GENERATED-CONTENT:START (CODE:src=./relative/path/to/code.js&block=BLOCK1) -->
This content will be dynamically replaced with code (from the file) found between comments containing "BLOCK1".
<!-- AUTO-GENERATED-CONTENT:END -->
code.js :
// ...
// <BLOCK1>
console.log("This will get selected");
// </BLOCK1>
Happy to help out with a PR.
Hey @nyan-left
I like this idea! Happy to review this as PR
Shall send it through early next week :)