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

baseassetpath in PDF #255

Closed
opoudjis opened this issue Oct 9, 2021 · 1 comment
Closed

baseassetpath in PDF #255

opoudjis opened this issue Oct 9, 2021 · 1 comment
Assignees
Labels
enhancement New feature or request

Comments

@opoudjis
Copy link
Contributor

opoudjis commented Oct 9, 2021

Follow-up to #242

Normally, we pass images into the Presentation XML as Data URIs, rather than references to external image files. It is however possible to have a Metanorma XML file with images referenced as files with src attributes.

By default, those files are expected to be in the same directory as the Presentation XML file, so that any local file references are relative to that directory: so a src="./file.jpg" will be interpreted as being relative to the location of the Presentation XML file.

It is however possible for the file to move around during compilation, particularly in the process of generating a Metanorma site.

For that reason, we now have an optional baseassetpath path in Metanorma compilation, which nominates the starting point for any local URI references to image sources. So if baseassetpath is say "/root/images/", then any reference to src="./file.jpg" is relative not to the current location of the Presentation XML file, but to "/root/images/". (So the file is located in "/root/images/file.jpg".)

This ticket is a request for you to process the baseassetpath parameter, passed to mn2pdf, and to interpret any image file locations in the Presentation XML source as being relative to that directory. I am hoping that this can be implemented as an instance of --param baseassetpath = ....

I am not going to invoke it until you have completed this.

@Intelligent2013 Intelligent2013 added the enhancement New feature or request label Oct 9, 2021
Intelligent2013 added a commit to metanorma/mn2pdf that referenced this issue Oct 9, 2021
@Intelligent2013
Copy link

@opoudjis baseassetpath processing added in https://github.com/metanorma/mn2pdf/releases/tag/v1.38
But please don't put spaces around = in the mn2pdf command line:
--param baseassetpath=...

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

No branches or pull requests

2 participants