-
Notifications
You must be signed in to change notification settings - Fork 5
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
Site generation functionality fails on external image includes #242
Comments
Hey @ronaldtse, I think this might be coming from the underlying isodoc html function, and how that tries to handle images. I don't have that much context on that library, so I can't exactly figure out what's happening there, maybe @opoudjis might be able to help us out on that one? |
The challenge here is when isodoc builds the HTML, it needs to have the XML point out where the images are. e.g. maybe the XML file can store the base image path? |
It'd be more constructive to have that passed on to isodoc as a parameter from metanorma, rather than embed something that non-semantic in the semantic source. |
All you could pass to isodoc is the "base asset path", where isodoc would be expected to resolve the external references. We would need to make that an optional parameter when Metanorma calls the isodoc gem. |
|
So, the base asset path is:
|
@abunashir Back to you |
@ronaldtse: Let me clarify if I get that right - so, we basically want to add an option for cc: @opoudjis |
@abunashir not quite but close! Specifically,
|
@ronaldtse: The sitemap generator is passing the source file (adoc) as it is without reading it or doing any changes. Unless we want to add custom behaviour for this options, wouldn't it be better to add this functionality to figure out the default base path from metanorma gem side? Update: I was trying to test it out with both options, but now looks like the word converter is throwing the same error now. I will try do dig deep and will keep you guys posted and widely enough its looking into the site directory 🤔 |
When Metanorma is used on its own for one document, i.e.
All external paths are performed using the base relative path from In site generation, it looks like the source files get first moved into |
The xml/html or other issues seems to be fixed but the word file still has the missing image issues - I will do more debugging later to see what exactly is happening there!
|
Word operation now fixed. |
Ronald has agreed to make dataimageuri opt-out rather than opt-in, so it will need to be given an explicit false argument. |
So this particular task needs to be updated to say that when "data-image-uri" is false, then this issue applies. |
My work's complete. @abunashir Once you do your merge, I think this ticket is done. |
Fixed rspec, but are you testing what is done with baseassetpath, @abunashir? |
Thanks for fixing the spec, but I'm still having issue to generate word file, I've added the details to that PR. Regarding - the tests - we are only testing the delegation behaviour to that interface, and trust the metanorma gem to behave accordingly and also to avoid duplicate tests on both libraries. |
Update: Since, @opoudjis set it as default value, so I assume we don't necessarily need to set the base_path anymore, can we close this one @ronaldtse, or would you still prefer to add it? |
@abunashir in the case where the value is explicitly not set to the default, we will still have this problem... So we still need to fix it. |
Thanks @ronaldtse, with the recent merge on the PR, should it be resolved? can we close this issue? |
In mn-samples-iso, if you remove the
:data-uri-image:
attribute from one document, you will see a failure like this:This is due to the image being external to the file. When resolving any external file, the code should read using a base dir of the original location.
When the
:data-uri-image:
attribute is used, the external image file is embedded into the XML file, so this error does not occur.The text was updated successfully, but these errors were encountered: