Skip to content
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

Include only certain line numbers #8

Open
joewiz opened this issue Jan 2, 2017 · 4 comments
Open

Include only certain line numbers #8

joewiz opened this issue Jan 2, 2017 · 4 comments

Comments

@joewiz
Copy link

joewiz commented Jan 2, 2017

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.

@steindani
Copy link
Owner

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!

@joewiz
Copy link
Author

joewiz commented May 10, 2017

@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.

@steindani
Copy link
Owner

@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)
```

@joewiz
Copy link
Author

joewiz commented May 13, 2017

@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!

dbaynard added a commit to dbaynard/pandoc-include that referenced this issue Aug 25, 2017
* steindani/issueFixes:
  Revise fileContentAsString encoding (issue steindani#2)
  Include only a portion of a file (issue steindani#8)
  Refactoring, file contents read as UTF-8
  Use UTF-8 if requested (issue steindani#2)
  CodeBlock include and file reader changes
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants