Skip to main content
Participant
March 8, 2020
Question

Renaming cross reference link

  • March 8, 2020
  • 1 reply
  • 1631 views

Hello, 

 

I have documentation for my code that I maintain in Doxygen (general description + API reference). Our documentation team working with FrameMaker so I generate an XML output for them which were imported to FrameMaker using some template file which I do not fully understand. We reached good maturity and it works well except I cannot generate internal references with a custom naming. i.e. with the XML input below :

<ref refid="group__ip__class_1gaad23d5c191f1ede03638140cb21ca31f" kindref="member">actions</ref>

I would expect that link text will be action, but currently, action just attached as a text after the link with link text taken from element referenced by refid.

 

I have found many ways to control a text of link text here, but all of them as far as I understand working with target link text and do not provide a way for the custom text from the ref element.

 

I can modify my XML in a way it's needed and can manipulate templates in FrameMaker (almost 0 knowledge here).
Any suggestions will be greatly appreciated.

Thanks, Ilya.

This topic has been closed for replies.

1 reply

frameexpert
Community Expert
Community Expert
March 8, 2020

Typically, in a FrameMaker cross-reference, you do not directly specify the test that you want to appear as the cross-reference text. You use building-blocks in your cross-reference format that will determine which text from the target will appear. For example, the <$elemtext> building block displays the target element's text as the cross-reference text.

 

If you want to specify your own text that may be different from the target, you could use the <$attribute[attrname]> building block and specify the desired target text (for example, "actions") as an attribute value. In this case, you could have an attribute on your target element called xref-text. Then the building block for your cross-reference format would be <$attribute[xref-text]> and you would leave it out of your <ref> element.

 

Here is a list of possible building blocks with element and attribute types highlighted. If you need further help setting this up, please let us know. Thanks.

 

www.frameexpert.com
Participant
March 9, 2020

Hello,

 

Thanks for the suggestion, I will try it today. 

Just a quick question.  In your suggestion to add an attribute with link text the attribute needs to be added to the ref element or refid element? 

Is the following XML is an expected input? 

<ref refid="group__ip__class_1gaad23d5c191f1ede03638140cb21ca31f" kindref="member" link_text="actions"/>

And the expected building blocks will be <$attribute[link_text]>

 

Regards,

Ilya. 

frameexpert
Community Expert
Community Expert
March 9, 2020

Your <ref> element is correct, except the link_text attribute doesn't go on it. It will go on the target element that has the matching id of "group__ip__class_1gaad23d5c191f1ede03638140cb21ca31f".

www.frameexpert.com