cmacmackin / markdown-include

Provides syntax for Python-Markdown which allows for the inclusion of the contents of other Markdown documents.
GNU General Public License v3.0
104 stars 41 forks source link

More dynamic line ranges #48

Open BlakeFreer opened 3 months ago

BlakeFreer commented 3 months ago

Current line ranges can only support fixed line numbers, which means you cannot:

  1. get "all lines after line 5". Currently, you could use lines=5-99999 but this is not robust and raises a warning.
  2. Include the "last 10 lines" since you do not know these line numbers

Potential fixes could use syntax like:

  1. lines=5-END or lines=5-
  2. lines=-10-END following the Python slicing syntax where negative indices count from the end