DavidWells / DavidWells/markdown-magic
Feature Request: Comment range
Nobody has claimed this yet.
- Dominant language
- JavaScript
- Stars
- 868
- Forks
- 223
- PR merge metrics
- No merged PRs in 30d
Description
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.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by locating the code-injection handling that currently supports the lines option, then inspect how source ranges are parsed and extracted. Use the example code.js block markers as the expected input; done means a block selector can replace the line-range selector and extracts the content between matching markers.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- javascript
- Domain
- documentation, tooling
- Issue type
- Feature
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100