pandoc-include icon indicating copy to clipboard operation
pandoc-include copied to clipboard

Include only certain line numbers

Open joewiz opened this issue 7 years ago • 4 comments

Pandoc-include doesn't currently allow us to include only a range of line numbers, does it? For example, if I have a complete poem or program in a file (e.g., poem.md or program.xq), but my text I only want to include lines 6-12 and later lines 13-18. If pandoc-include doesn't support this, is it planned, or if not, are you aware of any projects that support this? Thanks.

joewiz avatar Jan 02 '17 20:01 joewiz

I had no plans for this feature, but it sound useful, and it should be feasible. Please give me some time to think about how this should be done!

steindani avatar May 09 '17 22:05 steindani

@steindani Thanks so much for considering the idea! I'd still find it useful and would be happy to test it if you decide to give it a shot.

joewiz avatar May 10 '17 13:05 joewiz

@joewiz what do you think about the following include syntax?

```cropped
alpha.md <- the source file
2 <- number of skipped lines (0 to start from the first line, optional)
1 <- number of lines to include (optional)
```

steindani avatar May 13 '17 21:05 steindani

@steindani I'm far from a pandoc or markdown extension syntax expert, but this looks great! My only thought is to change "cropped" to "include-lines". Cropping might suggest image slicing, whereas include-lines seems like a natural extension of your original function. Just an idea though!

joewiz avatar May 13 '17 23:05 joewiz