owickstrom / pandoc-include-code

A Pandoc filter for including code from source files
Mozilla Public License 2.0
141 stars 17 forks source link

startLine and endLine with negative numbers #39

Open CarstenGrohmann opened 3 years ago

CarstenGrohmann commented 3 years ago

Hello Oskar,

I use your Pandoc filter to include several source files in a beamer presentation. Everything works fine - thanks for implementing this filter.

It would be great if you can extend the filter to accept negative numbers for startLine and endLine. Negative numbers would work like positive numbers except they will count from the end of the file.

It would be great if you could extend the filter to accept negative numbers for startLine and endLine. Negative numbers would work like positive numbers, except that they would count from the end of the file.

I included automatically generated code to my markdown document. This code started always with line 4 and ended with the second last line, because the last line was just a repeating comment and I don't want this in my presentation.

I would have used this function to conveniently remove the last line in the file. Now I always counted the lines and then entered the desired line number.

Regards, Carsten