-
Notifications
You must be signed in to change notification settings - Fork 15
feature: add parameter to select specific lines from gist #25
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
Conversation
Hi @botoxparty, Thanks for sharing this! can you send me an example where you are using this? |
Sure, i made a post here with a demo: https://adamham.dev/posts/extending-gatsby-remark-embed-gist/ It removes the lines from the DOM completely, do you think it should maybe indicate to the user that there are lines removed? I guess that should probably be a separate PR. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I just have one change for you, some optimizations around the use of cheerio...
Ah this is great and thanks for the mention and link in your blog post! I think adding an indicator would be a good idea, but I agree with you, this can be done as a separate PR. In the mean time, I submitted a code review, overall great work, just one small optimization. Let me know what you think 😄 |
Codecov Report
@@ Coverage Diff @@
## master #25 +/- ##
===========================================
- Coverage 97.77% 85.93% -11.85%
===========================================
Files 2 2
Lines 45 64 +19
Branches 15 22 +7
===========================================
+ Hits 44 55 +11
- Misses 1 8 +7
- Partials 0 1 +1
Continue to review full report at Codecov.
|
So i've made those optimisations in the latest commit. I should probably write tests for the new functionality. I'll try and follow what you've done with the testing for highlights. |
Hey @botoxparty just checking on you. Are you planning on adding anything else (tests) to this PR? Let me know 😄 |
hey @weirdpattern so i've written out some tests based on the ones you had already written for the highlights. I'm not really sure if I've done it correctly I don't have a lot of experience with testing. would you mind reviewing it? |
@botoxparty sorry for the delay. |
Hey!
I was using this plug-in but needed the functionality to select specific lines so thought i'd share it back into the codebase.
It works by adding a
lines
parameter to the query string. e.g.gist:botoxparty/04f9c2bd909ba6f4424386d42242f961#serverless.yml?highlights=6,56&lines=1-4,50-60
RE: Tests, it still passes but I think something has changed with the
isValid
check. What was the purpose of that function?Do you have any time to write a test for this extended functionality?
Cheers!
Adam