Skip to content
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

include-files relative path for top-level file not in root #269

Open
ricopicone opened this issue Aug 28, 2023 · 1 comment · May be fixed by #270
Open

include-files relative path for top-level file not in root #269

ricopicone opened this issue Aug 28, 2023 · 1 comment · May be fixed by #270

Comments

@ricopicone
Copy link

ricopicone commented Aug 28, 2023

If I pandoc with the include-files filter a document in a subdirectory of the root ./sub/a.md that includes a relative file path, say

```include
subsub/b.md
```

where b.md has path ./sub/subsub/b.md, the filter cannot find the file. It works if I use the path relative to the root, i.e.,

```include
sub/subsub/b.md
```

This is a problem for me because I want to include a.md in multiple documents that don't share the same root.

I think there are two solutions:

  1. include an option to turn off relative paths in includes (my preference) or
  2. change the behavior for a top-level file ./sub/a.md (i.e., the one passed to pandoc) such that its includes are relative to its directory, ./sub.

I don't want to break existing code, so I think having an option to turn off all relative includes is probably best. I haven't tried editing the filter because I'm hoping others have input (or a solution!) for this. Thanks!

@ricopicone
Copy link
Author

I think a workaround is to add a wrapper file to the root directory. However, this is pretty hacky.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant