To link to an entity, use the syntax [link-text](<> "unique-name")
(a CommonMark link with empty URL and a title of unique-name
). If you don’t want a special link-text
, this can be shortened to [unique-name]()
(a CommonMark link with empty URL and the name of an entity as text).
You can also use an URL of the following form [link-text](standardese://unique-name/ "optional-title")
(a normal CommonMark link with the standardese://
protocol, the ‘/’ at the end is important).
In either case standardese
will insert the correct URL by searching for the entity with the given unique-name
.
The unique-name
of an entity is the name with all scopes, i.e. foo::bar::baz
.
For templates (but not function templates) you need to append all parameters, i.e. foo<A, B, C>
.
For functions you need to append the signature (parameter types and cv and ref qualifier), i.e. func()
, bar(int,char)
or type::foo() const &&
. If the signature is ()
, you can omit it.
For (template) parameters it is of the form function-unique-name.parameter-name
For base classes it is of the form derived-class::base-class
The unique-name
doesn’t care about whitespace, so bar(const char*)
, bar(const char *)
and bar (constchar*)
are all the same.
Because it is sometimes long and ugly, you can override the unique name via the unique_name
command (see below).
For example you can override
bar(long, list, of, parameters)
tobar()
. But keep in mind that it must be unique with regard to all overloads etc. Usually numbering would be a good choice, sobar() (1)
or similar.
You can also use a short unique-name
if there aren’t multiple entities resolved to the same short name.
The short name is the unique-name
but without a signature or template parameters, i.e. for foo<T>::func<U>(int) const
, the short name is foo::func
.