Comments (10)
Thanks for your suggestions. I think the two ways to specify the range are both feasible.
Especially, the second approach can be implemented by allowing users to set custom delimiters.
I will work on this maybe in a few days.
from pandoc-include.
Thanks! I'm happy to beta-test it if you want.
from pandoc-include.
Hello, I have implemented this feature in the master branch and add some tests under the test
directory.
You could test it if you have some time.
Feel free to comment here if you have any suggestions.
from pandoc-include.
I've tested it and it seems to be working quite well (edit: I'm afraid it introduced a bug, though, #19 ).
Leaving the start / end markers so open is a nice touch.
I can work on those, but I do have a couple of additional remarks / suggestions (in addition to 4ed50b1#r51230553 ):
- You could specify in the doc that if the same "snippetStart"er is twice in the file, the filter will use the first one,
- You could make explicit that both the "snippetStart" and "snippetEnd" are required (you could imagine that no "snippetEnd" could be interpreted as "until the file terminates", which could be a nice feature, that would be similar to setting endLine to the end of the file by default),
- You could leave an option to decide if the snippet Start / End marker will be added to the output or not, (we could want to mark the limitation of the snippets without adding anything to it),
- You could accommodate negative line numbers, and interpret them as "counting from the end of the file" (this was a feature suggested here in the first place).
Those are my two cents :-)
from pandoc-include.
The first point is addressed with #18
from pandoc-include.
Thanks for your detailed suggestions and work.
I think they are all reasonable, and I will try to add those features later.
BTW, the PR has been merged.
(Sorry for the late reply since I am a little busy recently.)
from pandoc-include.
You're fine, thanks for following, I appreciate. I'm happy to keep testing and editing the instructions, btw.
from pandoc-include.
Hello, I have fixed the above issues according to your suggestions and I have already run some tests. You could try to run more tests if you'd like to.
(Sorry for the late update since I am quite busy last month.)
from pandoc-include.
Thanks a lot. I've tested the last changes quite intensively, and did not see any bug.
I have two comments, though, for (possible) further improvments.
- When using
includeSnippetDelimiters=False
, I think the rest of the line where the identifier is should be ignored if it's empty.
That is, I believe it would be better for
static void Main()
{
/* Start included */
int yourAge;
to be rendered with
int yourAge;
than with
int yourAge;
(note the white line), especially since modifying the source code to
static void Main()
{
/* Start included */ int yourAge;
would seem fairly weird / ugly.
- Pandoc-include-code offers the possibility of indenting / "dedenting" the included file. I can see at least two use cases for that:
1. When including a source code, as above, (you would wantint yourAge;
to lose its indentation),
2. If the included portion is within a list (or indented for other, similar, reasons). Typically, you may want to "extract" the quote from a snippet like follows:butThis is the file I will include in another. * This is the first list item. * Here's the second list item. <!-- Snippet starts --> > A blockquote would look great below the second list item. <!-- Snippet ends --> * And here's the third list item
will result in the quote being preceded by 4 spaces, transforming it into a code block. I know, that's probably a corner case, but still, it would be nice to be able to "dedent" the included file.!include`snippetStart=" <!-- Snippet starts -->", snippetEnd="<!-- Snippet ends -->"` in.md
from pandoc-include.
Thanks for your detailed suggestions. Both of your comments are reasonable, and I have added these features.
Feel free to comment here if there's anything that still needs improving.
from pandoc-include.
Related Issues (20)
- Bug with code blocks (containing tab?) HOT 2
- Another issue with code blocks and horizontal lines HOT 3
- Included figures with relative paths are not found HOT 3
- Comments in code blocks returns error HOT 1
- Hard line breaks are not preserved HOT 1
- Invalid API Version HOT 1
- Error: invalid api version HOT 3
- Parameterized include HOT 2
- files with _ (underscore) in their name HOT 1
- No longer automatically inserting pagebreaks HOT 2
- Adjust section level in included markdown files HOT 12
- support mdbook include syntax HOT 1
- add id-prefix option
- Could not find executable pandoc-include HOT 3
- newlines in src do not work HOT 1
- invalid api version? HOT 3
- Too strict on "File not found" HOT 15
- Filename's underscore gets escaped? HOT 2
- Support for `sourcepos` extension recursively, to provide sync-preview. HOT 3
- Release 1.3.1 not available in Pypi HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from pandoc-include.