-
-
Notifications
You must be signed in to change notification settings - Fork 4.9k
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
feature: include ranged code lines #3393
feature: include ranged code lines #3393
Conversation
fix issue #3310
Can anybody tell me why the CI test did not pass and how I could do? I checked out the master branch before doing any changes and the tests failed too when I run I have already added tests for the changes and all of them passed. |
@kezhenxu94 |
Hi @kezhenxu94 👋🏻 Is it possible you can describe what it's doing? I'm not understanding it. Maybe a screen shot? Thank you 👍🏻 |
Hi @tcrowe 👋🏻 As described in issue #3393 , this commit provides possibilities to include just a range of lines in a code file instead of the whole file, for example, file if (tired && night){
sleep();
} and by any chance I just want to include part of the code,
So I just need to write:
to include from line 2(inclusive) to line 3(exclusive). |
@kezhenxu94 Hey, that's pretty cool! Thanks for the explanation. |
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 test this PR on my local machine like this. It's works well. Thanks 😊
{% include_code lang:javascript from:1 to:2 test.js %}
{% include_code lang:javascript from:3 to:3 test.js %}
{% include_code lang:javascript from:4 test.js %}
{% include_code lang:javascript to:5 test.js %}
{% include_code lang:javascript test.js %}
Fix issue #3310
Thank you for creating a pull request to contribute to Hexo code! Before you open the request please review the following guidelines and tips to help it be more easily integrated: