Skip to content

Feature Request: Comment range #54

@nyan-left

Description

@nyan-left

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions