automd
automd copied to clipboard
feat(file): add line args
๐ Linked issue
N/A
โ Type of change
- [ ] ๐ Documentation (updates to the documentation, readme, or JSdoc annotations)
- [ ] ๐ Bug fix (a non-breaking change that fixes an issue)
- [ ] ๐ Enhancement (improving an existing functionality like performance)
- [x] โจ New feature (a non-breaking change that adds functionality)
- [ ] ๐งน Chore (updates to the build process or auxiliary tools and libraries)
- [ ] โ ๏ธ Breaking change (fix or feature that would cause existing functionality to change)
๐ Description
Add line to limit the amount of content copy over.
Im not sure if their name fit. I'll add docs after the args' name are finalized.
๐ Checklist
- [ ] I have linked an issue or discussion.
- [ ] I have updated the documentation accordingly.
Nice idea! How do you think to smplify to one lines arg:
- lines=5:
- lines=2:5
- lines=:5
Nice idea! How do you think to smplify to one lines arg:
- lines=5:
- lines=2:5
- lines=:5
Yeah I think that's nicer.
And in case only the starting/ending line was defined, should we assume that the user want to copy from line 0/to the end?
Waiting on this change to adopt this library, any estimates of when this will be published?
Also from personal experience using a similar library on this project https://github.com/MionKit/mion. When importing source code, using line numbers gets very difficult to maintain and requires a review every time the src code gets updated. it would be very interesting to be able to use a pattern delimiter as an argument so we can insert comments in the src code and extract the code between the delimiters
<!-- automd:file src="./example.ts" code dlimiter="//######myFunction" -->
<!-- /automd -->
This would extract anything between the delimiter // ######myFunction
// file ./example.ts
export const token = '1';
// ######myFunction
export function myFunction() {
// code here
}
// ######myFunction
This example would only import the src code within the delimiters (myFunction).
willing to work on it after this PR get merged
@M-jerez nice idea feel free to make a PR to support pattern matches. (also see #78 which is relevant. ideally we could have similar matcher syntax of browsers)