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

[gatsby-remark-embed-snippet] embend only part of files #6321

Closed
ghost opened this issue Jul 6, 2018 · 2 comments
Closed

[gatsby-remark-embed-snippet] embend only part of files #6321

ghost opened this issue Jul 6, 2018 · 2 comments

Comments

@ghost
Copy link

ghost commented Jul 6, 2018

Summary

It would be nice to embed only part of files delimited by line numbers.

Basic example

I think this should be done in the markdown source, for example an object with key lines. For example to embed line 3 and 12 to 15.

embed:sample-javascript-file.js{lines: [3, 12-15]}

+ add keyword highlight to highlight line directly from markdown. for example: embed:sample-javascript-file.js{lines: [3, 12-15], highlight: [3, 14-15}

Motivation

It would permit to analyse parts of code one by one on a big file.

@m-allanson
Copy link
Contributor

@benjaminabel You're in luck! There's a PR to add this functionality over at #6084. I think it's ready to merge so should be released in the next day or two.

@ghost
Copy link
Author

ghost commented Jul 9, 2018

Thanks @m-allanson I didn't find this PR before I opened this issue.

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

No branches or pull requests

1 participant