-
Notifications
You must be signed in to change notification settings - Fork 6
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
Would like to extract just parts of a file #3
Comments
Another "upgrade" to this could be the possibility to "latch onto" some control characters/tags in the source code file, so the referenced part will be the same even if the line numbers changed (if code is added/removed in the file). |
I'd like that, too :-) Example:
I think there's even no need for a prefix in the source for for opening/closing a tagged range. Each region would just start with a tag and end whenever the same tag appears agains, e.g.
would be included as
|
Just saw, a fix has been introduced for this. Great! But it comes with a small bug. Pls see my inline comment on the committed code. |
I noticed that currently the lines property seems to fetch the wrong lines. In the example below the lines 93 to 108 have been included.
https://sbaechler.gitbooks.io/elm-hexagon/content/v/096ebfc78082d42142074cf98fa0638b0bf0e267/doc/2-dancefloor.html |
It looks like your Regex is ignoring empty lines: http://stackoverflow.com/questions/5034781/js-regex-to-split-by-line |
I'd like to extract just a range of lines from a source code file. The syntax could look like this:
{% codesnippet "./myfile.js", linerange="10-12" %}{% endcodesnippet %}
Ideally I could even specify multiple line ranges, eg:
{% codesnippet "./myfile.js", linerange="10-12, 14, 17-18" %}{% endcodesnippet %}
The ranges would be separated by a line containing just "...", eg:
The text was updated successfully, but these errors were encountered: