Controlling format of inline xrefs without xreflabel

classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

Controlling format of inline xrefs without xreflabel

oddhack
If I say something like:

----
  * [Anchor1] Some text

Link to <<Anchor1>>
----

I see rendered HTML like:

----
  * Some text

Link to [Anchor1]
----

The user manual says "It’s possible to customize the text that will be used in the cross reference link (called xreflabel). If not defined, Asciidoctor does it best to find suitable text (the solution differs from case to case). In case of an image, the image caption will be used. In case of a section header, the text of the section’s title will be used.". It  doesn't seem to say anything about how "suitable text" is found for inline links like this - although I infer that it takes the anchor name and puts square brackets around it.

Is there a way to suppress the square brackets without adding explicit xreftext? If it was just a couple of links that would be one thing to write <<Anchor1,Anchor1>>, but I have ca. 1300 xrefs to about 1/3 that number of anchors in one document alone, and all that replication is tedious and wasteful.

Jon
Reply | Threaded
Open this post in threaded view
|

Re: Controlling format of inline xrefs without xreflabel

wolandscat
I have the same problem. I have a front page block containing an xref to another file that contains the amendment history of the document.

The xrefs in the front page block is a row in a table:

|*Revision*: <<latest_issue>>
|*Date*: <<latest_issue_date>>

The source is the revision and date on the topmost entry in the amendment history, e.g.

|[[latest_issue]]1.0.0
|description blah blah
|jane smith
|[[latest_issue_date]]10 Jan 2017

The result I want in the HTML (or any output format) is:

Revision: 1.0.0       |Date: 10 Jan 2017

But instead I get:

Revision: [latest_issue]       |Date: [latest_issue_date]

with both of the xref labels being clickable through to the correct locations.

It appears there is no xreflabel defined for text that is not a heading or caption, and even overriding it with something like [[latest_issue,1.0.0]]1.0.0 doesn't work.

Anyone got a solution to this?