0

Background

I'm currently using the CLI for md-to-pdf. I'm not sure if it's by design or limitation, but when generating PDFs from MD files containing PNG hyperlinks from not within the directory containing the PNGs, the image URL is broken within the PDF.

If I run md-to-pdf within the directory containing the PNG & MD files, the PDF is generated which correctly embeds the PNG.

Workaround

As a workaround, I would like to change directory to the directory containing the PNG & MD files while the shell script is running (it's part of a pre-commit hook). If I run the shell script at the directory home/user/repo/, how do I CD to repo/docs/diagrams/<directoryWithPNG&MDs>? Sorry for the lack of better wording, but I'm new to shell scripting, I like it but it's tedious and I appreciate any help given.

Is it possible for me to return to the directory I was before I switched directories?

Thank you!

nlecce
  • 1

0 Answers0