xwmx / nb

CLI and local web plain text note‑taking, bookmarking, and archiving with linking, tagging, filtering, search, Git versioning & syncing, Pandoc conversion, + more, in a single portable script.
https://xwmx.github.io/nb
GNU Affero General Public License v3.0
6.43k stars 180 forks source link

Pandoc runs from bash working dir rather than $nb working dir -- fails to render resources #283

Closed akashpal-21 closed 4 months ago

akashpal-21 commented 8 months ago

nb export [item] [path] fails to render resources (images) because pandoc is initiated from current bash working dir! if I cd into $notebook and run the command it exports correctly.

Would it be possible to make nb export directory agnostic like the rest of the commands?

xwmx commented 4 months ago

@akashpal-21 Thanks for the heads up! As of version 7.11.0, pandoc now runs in the directory containing the target item, and a test has been added confirming that images are embedded when using the pandoc --embed-resources or deprecated --self-contained options. By default, export does not embed the images. I can consider making --embed-resources / --self-contained the default if it makes sense.

akashpal-21 commented 4 months ago

Thanks for fixing it, although I won't be able to take benefit of it currently - I have moved to using Emacs to keep my notes as vim didn't fit my need and once it was done I found myself not wanting to use the md format too;