pandoc / lua-filters

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

Include files filter updates #173

Closed lmunch closed 3 years ago

lmunch commented 3 years ago

This patchset keeps the paths to images relative and also improves the usage in combination with the include-code-files.lua filter

lmunch commented 3 years ago

@tarleb Please review

tarleb commented 3 years ago

Thanks, looks good! Can we add a test for this?

lmunch commented 3 years ago

Sure, I can add a test. I will look at it later this week.

lmunch commented 3 years ago

@tarleb I have updated the test and documentation, but the CI fails in math2svg which seems to be unreleated.

BTW, awesome work with pandoc, pandoc/latex docker image etc. Use it everyday, highly appreciated.

tarleb commented 3 years ago

Awesome, thanks! I'll look into the math2svg problems.

tarleb commented 3 years ago

It seems that the math2svg problems are caused by changes in the npm ecosystem. It's probably enough to configure a Ubuntu PPA to get a newer node version installed in our testing container. I'll try if that fixes it, and just merge regardless if it doesn't.

gabyx commented 3 years ago

@lmunch : The relative path changes is generally a good idea, but its really bit too intrusive because

This feature needs probably more thoughts:

A variant with absolute paths like:

```{.include}
${env:ROOT_DIR}/chapters/A.md


will work if `${env:ROOT_DIR}` is replaced beforehand with the environment variable `ROOT_DIR` which points to the root of the document tree.

In this way one can still write multimarkdown documents.

Or maybe (`-M "includes-relative-to-cwd=true")

````md
```{.include .relative-to-current}
subdir/A.md

{.relative-to-current}

gabyx commented 3 years ago

I added this feature in #177. See the Readme under transclusion.