]> git.ipfire.org Git - thirdparty/libvirt.git/commit
docs: Format @variable properly
authorMichal Privoznik <mprivozn@redhat.com>
Fri, 10 Sep 2021 12:55:02 +0000 (14:55 +0200)
committerMichal Privoznik <mprivozn@redhat.com>
Wed, 15 Sep 2021 06:37:40 +0000 (08:37 +0200)
commitbdd3dfba1518567475630140135b4ae69c3820f0
treeaf5e0973ec6211bdb5f2601b60dbe82c21a66c78
parent0cb4550305e5a798439f06c3023da00e0e3b5b7c
docs: Format @variable properly

When documenting our public API in some places we use '@' to
refer to the variable. For instance:

 * This API tries to set guest time to the given value. The time
 * to set (@seconds and @nseconds) should be in seconds relative
 * to the Epoch of 1970-01-01 00:00:00 in UTC.

However, when generating HTML documentation these tokens are
copied verbatim. What we can do is drop the '@' character and
wrap the variable in <code/> so that it is formatted properly.

Due to the way we 'parse' docs a token might actually be slightly
more than just '@variable'. For instance in the example above we
will have the following tokens: '(@seconds' and '@nseconds)'.
Thus we need to handle possible substring before and after
variable.

Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
docs/newapi.xsl