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

Allow relative links #4

Open
rogerhadley opened this issue Mar 25, 2022 · 6 comments
Open

Allow relative links #4

rogerhadley opened this issue Mar 25, 2022 · 6 comments

Comments

@rogerhadley
Copy link

When publishing DITA to multiple output channels, the http URL changes for the different channels. Yet I am forced to hardcode an absolute URL if I want to have a link in a PlantUML diagram that points to a DITA topic.

Please provide a way to make the link in a PlantUML diagram to be relative, as rendered in the HTML output, similar to the way xrefs between DITA topics are relative. That way I can publish the same diagram to multiple channels as part of a content set and the links to topics within that content set will work.

@raducoravu
Copy link
Collaborator

I'm not sure if I have a good idea about how to make what you want work, we would need to somehow process those links in the pre-processing stage.
Maybe you can upload a small sample project when you have the time. How about if you use relative HTML links instead of absolute links? Do those work?

@rogerhadley
Copy link
Author

rogerhadley commented Mar 29, 2022 via email

@raducoravu
Copy link
Collaborator

@rogerhadley so a path like ../topic.html to navigate outside of the current folder does not work, right? I'm afraid I have not used the functionality much, I do not even know how to create links in the PlantUML syntax. I did update the libraries about 1-2 weeks ago to fix this #3 reported issue.

@rogerhadley
Copy link
Author

Plant-UML-Link-Test.zip
I have done more testing now and I can modify my request.

Please provide a way to use relative links in PlantUML diagrams in the following scenario:

  • A DITA topic containing PlantUML diagrams exists. Think of this as a PlantUML warehouse topic. It is typically not published and is included in the ditamap as processing-role="resource-only".
  • In those PlantUML diagrams, there are relative links to DITA topics in other directories. Those relative links would work fine in the warehouse topic if it were published.
  • In a different location/directory, a DITA topic (that is published) contains a conref targeting one of the PlantUML diagrams.

This scenario is typical in our content, as we use the warehouse topic to assemble variations of diagrams containing sub-diagarams, call functions, etc. In this scenario, the PlantUML diagram link, as rendered in the topic hosting the conref, most likely does not work. If parallel directory structures are carefully constrained for locations of warehouse topics and topics hosting conrefs, relative links can work, but this is impractical in a working DITA content set.

I have attached a project that demonstrates relative links that do and do not work, as rendered in the topic hosting the conref to the PlantUML diagram.

As you can see, my testing confirms that relative links can work, especially in the simplest scenario where all warehouse topics and conref host topics are in the same directory. I am currently implementing this workaround in our content, but it is not ideal as it breaks our conventions for locating topics in directory structures arranged by subject matter.

@raducoravu
Copy link
Collaborator

Hi Roger, I do not have a solution for this I'm afraid, the PlantUML code ideally should refer relatively to DITA topic files (instead of HTML files) and some kind of pre-processing customization would convert these references to the proper HTML references.

@rogerhadley
Copy link
Author

rogerhadley commented Oct 11, 2022 via email

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

No branches or pull requests

2 participants