obsidian-pandoc-reference-list icon indicating copy to clipboard operation
obsidian-pandoc-reference-list copied to clipboard

adapted code to allow for relative paths to bib-file in a files front…

Open matthiasmoe opened this issue 7 months ago • 0 comments

Motivation

The motivation for the changes is to allow relative paths to bibliographies in the frontmatter of a file, e.g.:

---
bibliography: ../../aBibtex.bib
---

The current plugin works only for absolute paths and file names when the file is located at the root of the Vault. However, Pandoc allows for relative paths. Adding the feature makes it simpler to keep the obsidian-markdown file easily convertible into standalone markdown files. That supports the distribution of files.

Implementation

The implementation is fairly simple: When the bibliography path is extracted from the file, it is checked whether joining the directory of the viewed Markdown file and the bibliography results in a valid file path. If it does, then the joined path is taken for further processing. It should not interfere with the current implementation.

I ran the tests of this project. However, some failed because the path to Pandoc is hard-coded to /opt/homebrew/bin/pandoc which does not align with my system. It is advisable to run the tests on the right machine again.

matthiasmoe avatar Dec 06 '23 13:12 matthiasmoe