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

embed:: assets not having path rewritten #802

Open
opoudjis opened this issue Jul 24, 2023 · 1 comment
Open

embed:: assets not having path rewritten #802

opoudjis opened this issue Jul 24, 2023 · 1 comment
Assignees
Labels
bug Something isn't working

Comments

@opoudjis
Copy link
Contributor

A document with

include::{dir}/doc1.adoc

in which the doc1.adoc links to files, e.g. image::image.png[]

will rewrite the address of image.png[], so that processing from the home directory will still find the image location.

In embed::[], this has just stopped working. (There was a test instance in metanorma gem.) So relative links in embed:: documents have stopped working.

The only relevant code changes were https://github.com/metanorma/annotated-express/issues/116 , but I don't see why they would affect things. There is evidence that this hasn't worked in general well.

@opoudjis opoudjis self-assigned this Jul 24, 2023
@opoudjis opoudjis added the bug Something isn't working label Jul 24, 2023
@opoudjis
Copy link
Contributor Author

after a lot of work, I am rewriting embed locations, but I am not able to rewrite the locations of links within embedded documents (e.g. image locations). That doesn't work for includes either: asciidoctor/asciidoctor#894 was lodged in 2014, about the fact that Asciidoctor does not process subdocuments, and has not been addressed in this time.

Since includes don't rewrite asset locations, this is not expected behaviour currently in Asciidoctor, desirable though it clearly is. Therefore the takeaway is: we must NOT use subdirectories for embeds in Metanorma. Any images that link in the standalone documents will break when compiled into a master document.

I could implement this behaviour by preprocessing all links to assets in embeded documents (e.g. image::, include::, audio::, video::, and the source attributes we have introduced for exporting files; but also lutaml files, and anything really that indicates a file location.)

... I think that's too much to track feasibly in preprocessing. So I am demoting this ticket to low, with the understanding that it likely will never be implemented any further.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
Status: 🏝 Low priority
Development

No branches or pull requests

1 participant