oxygenxml / dita-ot-diagrams-plugin

Dynamically convert PlantUML content inside DITA topics to SVG
Apache License 2.0
9 stars 3 forks source link

Allow relative links #4

Open rogerhadley opened 2 years ago

rogerhadley commented 2 years ago

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 commented 2 years ago

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 commented 2 years ago

Thanks for the email, Radu. I’m setting up a test project now.

If I remember correctly, with the earlier versions of the plugin, only absolute links worked. In my preliminary tests with the latest version of the plug, I am now able to get relative links to work, but only when all source and target files are in the same directory. So there are some constraints as to how files are located that affect relative link paths. I’ll let you know what I find out. Perhaps I can make it work.

-Roger

Roger Hadley Senior Technical Communicator 503-327-7178 Fiserv www.fiserv.comhttp://www.fiserv.com/

From: Radu Coravu @.> Sent: Sunday, March 27, 2022 9:42 PM To: oxygenxml/dita-ot-diagrams-plugin @.> Cc: Hadley, Roger (US - Oregon) @.>; Author @.> Subject: Re: [oxygenxml/dita-ot-diagrams-plugin] Allow relative links (Issue #4)

⚠ EXTERNAL MESSAGE – Think Before You Click

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?

— Reply to this email directly, view it on GitHubhttps://urldefense.com/v3/__https:/github.com/oxygenxml/dita-ot-diagrams-plugin/issues/4*issuecomment-1080178933__;Iw!!P9vvK-4S!2gjmYkVSS0gZsuBgKtcZrnvUW3flj4XrmA5MdljF1PJbTrpnM-Ne6za_cXyHD2kdO2g$, or unsubscribehttps://urldefense.com/v3/__https:/github.com/notifications/unsubscribe-auth/AKE6HU4NCYPQL47BCFXQE5LVCE2CDANCNFSM5RVSBSPA__;!!P9vvK-4S!2gjmYkVSS0gZsuBgKtcZrnvUW3flj4XrmA5MdljF1PJbTrpnM-Ne6za_cXyHCv0stB8$. You are receiving this because you authored the thread.Message ID: @.**@.>>

raducoravu commented 2 years ago

@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 commented 2 years ago

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:

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 commented 2 years ago

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 commented 1 year ago

OK, thanks for looking into this, Radu. We’ll figure out how to incorporate the workaround in our standards. -Roger

Roger Hadley Senior Technical Communicator 503-327-7178 Fiserv www.fiserv.comhttp://www.fiserv.com/

From: Radu Coravu @.> Sent: Tuesday, April 5, 2022 11:30 PM To: oxygenxml/dita-ot-diagrams-plugin @.> Cc: Hadley, Roger (US - Oregon) @.>; Mention @.> Subject: Re: [oxygenxml/dita-ot-diagrams-plugin] Allow relative links (Issue #4)

⚠ EXTERNAL MESSAGE – Think Before You Click

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.

— Reply to this email directly, view it on GitHubhttps://urldefense.com/v3/__https:/github.com/oxygenxml/dita-ot-diagrams-plugin/issues/4*issuecomment-1089872090__;Iw!!P9vvK-4S!36noGEYDYfP8WglDghPr0O9ow0vLOWLi7ocqLqHKldAU293wvb24403mLlaTsGI65FI$, or unsubscribehttps://urldefense.com/v3/__https:/github.com/notifications/unsubscribe-auth/AKE6HU74RH43CKH7BOHC7WTVDUVMXANCNFSM5RVSBSPA__;!!P9vvK-4S!36noGEYDYfP8WglDghPr0O9ow0vLOWLi7ocqLqHKldAU293wvb24403mLlaT0tXrDG4$. You are receiving this because you were mentioned.Message ID: @.***>