Closed gabyx closed 3 years ago
Ah jeah. Definitely. Any suggestion, on the naming?
The include/exclude part into an own filter.
The filepath extension replacement would stay in this filter
Bonus: Maybe include an environment replacement replace-env-vars
if that is possible with Lua... (other PR :-)) -> own filter
I am going to call it codeblocks-filter-format
.
See latest commit. Its split up.
Thanks for merging.
Ok. I now made it more generic: All blocks with attributes can be filtered now.
... Everything else appears to be independent and could be implemented as a filter that modifies the code blocks and is run before
include-files
.
No it cant: Its a chicken an egg problem: Every filter which runs before this filter will eventually only run on the main document. (Chicken-egg problem).
I close this in favor of a newer PR base on master.
You don't need to close PR's to rebase them. You can just rebase and push to the branch this PR is opened against and it will update.
I know. Thought because of the mess, I make it more clear.
Von meinem iPhone gesendet
Am 22.05.2021 um 09:31 schrieb Caleb Maclennan @.***>:
You don't need to close PR's to rebase them. You can just rebase and push to the branch this PR is opened against and it will update.
— You are receiving this because you modified the open/close state. Reply to this email directly, view it on GitHub, or unsubscribe.
Here is a PR with tests which provide some attributes to include and exclude include blocks as well as replace extensions depending on the output format.
This comes in very handy for example when you want another file to be included for a different format. Application is a
table.md
with a HTML table which you format/style manually for Latex -> replace extensions with.tex
. See theREADME.md
.Enhancements for filter:
include-files.lua
replace-ext-if-format
.include-format
to use on all include blocks.New block filter
block-filter-format.lua
:Filtering blocks depending on attribute
include-if-format
.Filtering blocks depending on attribute
exclude-if-format
.Documentation in
README.md
.Tests added.
Would be cool if we could support this.