-
-
Notifications
You must be signed in to change notification settings - Fork 19
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
Add embed functionality .. #17
Comments
Upon reflection this is overkill. It seems that what I really want is:
We already have
Implement those primitives and it'll work as-is...
|
(Only obvious issue here is what if we want the lines between two regexps - but not including them. Duplication?) |
skx
added a commit
that referenced
this issue
Jun 29, 2020
This allows three forms of file-inclusion: * Literal/Complete file inclusion. * Include lines from a file that match a regexp. * Include lines between two regular expressions. This closes #17
Merged
skx
added a commit
that referenced
this issue
Jun 29, 2020
* Added support for file-inclusion. This allows three forms of file-inclusion (where "file" means either reading a file from the local filesystem, or reading the output of executing a command): * Literal/Complete file inclusion. * Include lines from a file that match a regexp. * Include lines between two regular expressions. This closes #17
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
I recently came across this tool:
It allows you to embed code-samples in markdown files, though it must be said it is very flexible and basically you give it an input-file which contains:
The line will be replaced by content from the file-path, or the remote URL, between the start/end regexps. Pretty trivial to write this in perl, via the flip-flop operator:
That said it would be a nice addition here.
Something like:
The biggest, obvious, issue is that if you were to replace in-place, you'd lose the marker(s). So this example:
Could become:
But then you're stuck! You can't replace the content again, because the edited-in-place file no longer has the marker. You probably don't want that marker inline anyway. Though you could have something like:
Which could remain. But that's getting a bit markdown-specific. I guess the real solution is that your repository would have
README.in
(master-source) andREADME.md
(generated/expanded output).The text was updated successfully, but these errors were encountered: