pandoc / lua-filters

A collection of lua filters for pandoc
MIT License
602 stars 165 forks source link

Replace paths in `include-files.lua` and filter blocks by format #133

Closed gabyx closed 3 years ago

gabyx commented 3 years ago

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 the README.md.

Enhancements for filter: include-files.lua

New block filter block-filter-format.lua:

Would be cool if we could support this.

gabyx commented 3 years ago

Ah jeah. Definitely. Any suggestion, on the naming?

gabyx commented 3 years ago
gabyx commented 3 years ago

I am going to call it codeblocks-filter-format.

gabyx commented 3 years ago

See latest commit. Its split up.

gabyx commented 3 years ago

Thanks for merging.

gabyx commented 3 years ago

Ok. I now made it more generic: All blocks with attributes can be filtered now.

gabyx commented 3 years ago

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

alerque commented 3 years ago

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.

gabyx commented 3 years ago

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.