Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(file): add line args #46

Open
wants to merge 6 commits into
base: main
Choose a base branch
from

Conversation

HigherOrderLogic
Copy link

πŸ”— 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)
  • ✨ 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.

@pi0
Copy link
Member

pi0 commented Mar 16, 2024

Nice idea! How do you think to smplify to one lines arg:

  • lines=5:
  • lines=2:5
  • lines=:5

@HigherOrderLogic
Copy link
Author

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?

@M-jerez
Copy link

M-jerez commented Oct 24, 2024

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants