Raku/RakuDoc-GAMMA

A<|> example incorrect?

Closed this issue · 1 comments

The use of A<B<this program |> PROGNAME> is subject to the terms and conditions
laid out by A<B<our company |> VENDOR>, as specified at:
A<B<(Please visit our website) |> TERMS_URLS>

I believe this to be wrong, as the | is part of B<>, rather than A<>. I believe the example should be:

    The use of A<B<this program>| PROGNAME> is subject to the terms and conditions
    laid out by A<B<our company>| VENDOR>, as specified at:


        A<B<(Please visit our website) |> TERMS_URLS>

On a related note: having a space before PROGNAME and VENDOR implies whitespace should be trimmed from the A<> key?

I believe the example is correct as it stands.

Note that the =begin code block surrounding those three lines has an :allow< B > option.
So those B<...> markups will be invisible (or, rather, will be prerendered) in the output text.

Each B<...> is being used to highlight the feature being described
in the preceding paragraph, not as an example of actual RakuDoc usage.

In other words, the text is supposed to be rendered:


Alias placement codes may also specify a default display text, before the
alias name and separated from it by a |. When a display is specified,
it will be used if the requested alias cannot be found (and an "unknown alias"
warning will be issued in that case):

    The use of A<this program | PROGNAME> is subject to the terms and conditions
    laid out by A<our company | VENDOR>, as specified at:

        A<(Please visit our website) | TERMS_URLS>


...thereby hightlighting the instances of a "default display text, before the alias name and separated from it by a |".

Of course, in an actual RakuDoc usage of the A<...> code, it would definitely be
an error to close the nested B<...> after the |, instead of before it.

having a space before PROGNAME and VENDOR implies whitespace should be trimmed from the A<> key?

Yes, IMHO whitespace should be ignored both fore and aft of the alias key.