Auto Links adding

Having trouble installing Oxygen? Got a bug to report? Post it all here.
[Stupid]_[User]
Posts: 21
Joined: Mon Dec 05, 2022 9:35 am

Auto Links adding

Post by [Stupid]_[User] »

Hello everyone! :)

I have tons of links in my document, most of them to my document topics, but adding them manually spend a lot of my time. I was used macros for such things while using MS Word. Macros, which was used by me in MS Word, automatically add a links to a document topic. It works such way: I mark the text, which equal to the topic name, push the button, macros automatically found necessary topic in text and add link to it.

Is it a way to make something similar in Oxygen? Maybe you know some API, which can do this work?
Radu
Posts: 9059
Joined: Fri Jul 09, 2004 5:18 pm

Re: Auto Links adding

Post by Radu »

Hi,

Oxygen has support for Java or Javascript based plugins:
https://www.oxygenxml.com/doc/versions/ ... guide.html
But something like you want is probably not easy to implement. In a Word document you have all the content in only one file but with DITA XML you have lots of topic files, and each of them might contain the target that you are looking for.
Here's something which might already work without the need for plugins:
1) Open a DITA topic and select the text which you want to search in other topics.
2) Use the "Ctrl-Shift-R" (CMD-Shift-R on Mac OSX) shortcut to open the "Open/Find Resource" dialog.
3) Check the "in content" radio button and you will see a list of all topics containing that text.
4) Right click a target topic and choose "Copy Location".
5) Close the dialog and paste the location which is now in the clipboard in the opened topic, a link should be automatically inserted by Oxygen to the target topic.

Regards,
Radu
Radu Coravu
<oXygen/> XML Editor
http://www.oxygenxml.com
chrispitude
Posts: 907
Joined: Thu May 02, 2019 2:32 pm

Re: Auto Links adding

Post by chrispitude »

Hi Mr. User,

What kind of links are you adding? If they are links to subtopics in that section (a "local table of contents"), you could try this plugin:

DITA-mini-toc-element

But that is a guess and your needs are probably different.
[Stupid]_[User]
Posts: 21
Joined: Mon Dec 05, 2022 9:35 am

Re: Auto Links adding

Post by [Stupid]_[User] »

Radu wrote: Thu Dec 08, 2022 10:24 am Hi,

Oxygen has support for Java or Javascript based plugins:
https://www.oxygenxml.com/doc/versions/ ... guide.html
But something like you want is probably not easy to implement. In a Word document you have all the content in only one file but with DITA XML you have lots of topic files, and each of them might contain the target that you are looking for.
Here's something which might already work without the need for plugins:
1) Open a DITA topic and select the text which you want to search in other topics.
2) Use the "Ctrl-Shift-R" (CMD-Shift-R on Mac OSX) shortcut to open the "Open/Find Resource" dialog.
3) Check the "in content" radio button and you will see a list of all topics containing that text.
4) Right click a target topic and choose "Copy Location".
5) Close the dialog and paste the location which is now in the clipboard in the opened topic, a link should be automatically inserted by Oxygen to the target topic.

Regards,
Radu
Hi, Radu!

Your decission for these problem works, but I still spend a lot of time for links adding. I think, that use of Java plugins will help me better (I'll trying to resolve my problem this way).

Best wishes, Stupid User.
[Stupid]_[User]
Posts: 21
Joined: Mon Dec 05, 2022 9:35 am

Re: Auto Links adding

Post by [Stupid]_[User] »

chrispitude wrote: Thu Dec 08, 2022 2:34 pm Hi Mr. User,

What kind of links are you adding? If they are links to subtopics in that section (a "local table of contents"), you could try this plugin:

DITA-mini-toc-element

But that is a guess and your needs are probably different.
Hi, chrispitude!

I saw a plugin you linking for and, as I thought, it's not right way for decission of my problem.
I need to add a links to other topics inside my topic text.
For example:
I have a topic with "HELP" name. Every time I use HELP text in other topics, I shoul add a link to "HELP" topic. Finally I will use these links only in my output PDF dicument. I.e. I see following text in any place of my output PDF: "You can use HELP chapter to resolve your problems", if I click on HELP text - I'll "jump" to HELP chapter.

I didn't saw worst explanation than my, but hope you'll understand me!
Post Reply