Loading... |
Reply to author |
Edit post |
Move post |
Delete this post |
Delete this post and replies |
Change post date |
Print post |
Permalink |
Raw mail |
![]() ![]() ![]() ![]() ![]() ![]() ![]() |
I'm trying to reproduce the functionality of LaTeX glossary package \glspl{term}, which produces a link to the glossary for the specified term, but puts it in text as pluralized (e.g. "terms" would link to the glossary "term" entry). My first thought was
[[terms]]term:: A term But while <<term>> and <<terms>> do both link to this, the former shows up with the rendered "[term]" style in HTML output. I can say <<term,term>> and avoid this ugliness, but that makes markup considerably longer to write. There doesn't seem to be a way to specify multiple anchors on a list item, so I can't say something like [[term]]term[[terms]]:: A term AFAICT. Are there better / different options that allow interchangeable use of the singular and plural terms to link to the same glossary term? Writing a Ruby macro is off the table learning curve-wise. |
Loading... |
Reply to author |
Edit post |
Move post |
Delete this post |
Delete this post and replies |
Change post date |
Print post |
Permalink |
Raw mail |
![]() ![]() ![]() ![]() ![]() ![]() ![]() |
On 22.05.2020 17:33, oddhack [via Asciidoctor :: Discussion] wrote: > I'm trying to reproduce the functionality of LaTeX glossary package > \glspl{term}, which produces a link to the glossary for the specified > term, but puts it in text as pluralized (e.g. "terms" would link to > the glossary "term" entry). My first thought was > > [[terms]]term:: A term > > But while <<term>> and <<terms>> do both link to this, the former > shows up with the rendered "[term]" style in HTML output. I can say > <<term,term>> and avoid this ugliness, but that makes markup > considerably longer to write. There doesn't seem to be a way to > specify multiple anchors on a list item, so I can't say something like > it is rendered as [term] in your html. > > Are there better / different options that allow interchangeable use of > the singular and plural terms to link to the same glossary term? > Writing a Ruby macro is off the table learning curve-wise. > Why wouldn't you use [[term, terms]] and use <<term>> to show urls as terms? And if you need to name it differently, use <<term, Longer description of the url>> ? |
Loading... |
Reply to author |
Edit post |
Move post |
Delete this post |
Delete this post and replies |
Change post date |
Print post |
Permalink |
Raw mail |
![]() ![]() ![]() ![]() ![]() ![]() ![]() |
Interesting. I see different behavior between command-line client 2.0.10 and Asciidoctor.js Live Preview 2.5.0. The former does as you say but the latter does have both link to the glossary entry. > > Are there better / different options that allow interchangeable use of > the singular and plural terms to link to the same glossary term? > Writing a Ruby macro is off the table learning curve-wise. > Because it does entirely the wrong thing? If I say <<term>>, <<terms>> [[term,terms]]term:: A term then the rendered result is [term], term of which the first link is broken, and the second is not pluralized. |
Loading... |
Reply to author |
Edit post |
Move post |
Delete this post |
Delete this post and replies |
Change post date |
Print post |
Permalink |
Raw mail |
![]() ![]() ![]() ![]() ![]() ![]() ![]() |
Because it does entirely the wrong thing? If I say
Well, that is how asciidoctor works I believe. You have defined
one anchor named [[term]] and can not link to it with
<<terms>> because there is no such anchor defined. I don't think it is possible to do in a general way (there are a lot of languages you have to take into account). As for english you will have to extend asciidoctor with ruby to make it happen. I am not sure it is feasible, but you, of course can try.
I would stop at a single [[term]] or [[terms]] depending on frequency use in your text and use either <<term, terms>> or <<terms, term>> for the rest of urls. On the other hand it should be possible to use multiple anchors
on the same place as described in
manual:https://asciidoctor.org/docs/user-manual/#multiple-anchors
But it looks like it is broken and there should be issue registerd on asciidoctor github. == [[term]][[terms]] As in manual example link to <<term>> and another one to <<terms>> are rendered as [term] and [terms] which according to manual should not happen. Even more funny it works differently with exported PDF --
rendered with the same issue but links to table of contents.
|
Loading... |
Reply to author |
Edit post |
Move post |
Delete this post |
Delete this post and replies |
Change post date |
Print post |
Permalink |
Raw mail |
![]() ![]() ![]() ![]() ![]() ![]() ![]() |
I believe multiple IDs are only supposed to work for sections, not for blocks (I am unsure if a description list item counts as a "block", but pretty sure it does not count as a "section"). |
Loading... |
Reply to author |
Edit post |
Move post |
Delete this post |
Delete this post and replies |
Change post date |
Print post |
Permalink |
Raw mail |
![]() ![]() ![]() ![]() ![]() ![]() ![]() |
In reply to this post by habamax
> But it looks like it is broken and there should be issue registerd on > asciidoctor github. > > == [[term]][[terms]] As in manual example > > link to <<term>> and another one to <<terms>> > > are rendered as [term] and [terms] which according to manual should > not happen. > > Even more funny it works differently with exported PDF -- rendered > with the same issue but links to table of contents. > > Issue is created https://github.com/asciidoctor/asciidoctor-pdf/issues/1702 |
Loading... |
Reply to author |
Edit post |
Move post |
Delete this post |
Delete this post and replies |
Change post date |
Print post |
Permalink |
Raw mail |
![]() ![]() ![]() ![]() ![]() ![]() ![]() |
In reply to this post by oddhack
On 22.05.2020 18:18, oddhack [via
Asciidoctor :: Discussion] wrote:
I believe multiple IDs are only supposed to work for sections, not for blocks (I am unsure if a description list item counts as a "block", but pretty sure it does not count as a "section"). I don't know for sure and manual do not state it explicitly, so let's wait till @mojavelinux comment on it. But anyway it doesn't work for sections too, see my issue
created. |
Loading... |
Reply to author |
Edit post |
Move post |
Delete this post |
Delete this post and replies |
Change post date |
Print post |
Permalink |
Raw mail |
![]() ![]() ![]() ![]() ![]() ![]() ![]() |
Administrator
|
In reply to this post by oddhack
Currently, Asciidoctor supports exactly one anchor on a description list term. It must come at the beginning: [[term]]name of term:: desc of term <<< see <<term>> If you add any more anchors, it will not work. -Dan -- Dan Allen | @mojavelinux | https://twitter.com/mojavelinux |
Loading... |
Reply to author |
Edit post |
Move post |
Delete this post |
Delete this post and replies |
Change post date |
Print post |
Permalink |
Raw mail |
![]() ![]() ![]() ![]() ![]() ![]() ![]() |
Administrator
|
In reply to this post by oddhack
I forgot to add that you can define alternate ref text at the location of the anchor: [[term,alt text]]name of term:: desc of term <<< see <<term>> Best Regards, -Dan -- Dan Allen | @mojavelinux | https://twitter.com/mojavelinux |
Free forum by Nabble | Edit this page |