Re: Texinfo in Guile Scheme docstrings?

Tomas Volf <[email protected]> Sun, 16 Feb 2025 16:27:41 +0100
Newsgroups gmane.lisp.guile.devel
Message-ID <[email protected]>
Maxim Cournoyer <[email protected]> writes:

> Hi Yuval,
>
> Yuval Langer <[email protected]> writes:
>
>> Hi,
>>
>> I am writing docstrings to guile-srfi-189 currently[1] and looking for
>> good docstring style practices (that's another topic for another
>> thread).
>>
>> I have noticed that there are some modules with Texinfo markup in
>> their docstrings, but I haven't found these markups being used in any
>> meaningful way.  I looked up two docstrings inside the Guile manual,
>> but couldn't find it there, so these docstrings are not used to
>> de-duplicate documentation.  The two I've searched are (srfi srfi-1)'s
>> assoc and (ice-9 popen)'s open-pipe*.
>>
>> Someone had suggested the `guild doc-snarf` command, but it doesn't
>> output any of the docstrings.  What I did notice is that the text in
>> the docstrings defined in the /libguile/ C files can be found in the
>> Guile manual.  There is a tool called `guile-snarf` for the C code
>> docstrings, but that doesn't explain the Guile Scheme docstrings.
>>
>> I am extremely confused.  Why have Texinfo in the docstrings of the
>> Scheme source when the docstrings defined in the C files are used?
>> Are there plans for developing tools that will display docstring in a
>> more intelligent way using those markups, like in the interactive
>> environment, or maybe assist in navigating the documentation?
>
> Sorry for not being helpful, but I've asked myself these questions
> before, and would also like to know the answer.  I assume there was a
> plan to render some of the the Texinfo markup in the interactive
> environment, but that's speculation :-).

While the built-in ,d in the REPL does not process the Texinfo, some
third party tools do.  For example geiser-doc-symbol-at-point.  I think
we should modify the ,d to support it as well.

In my personal library, I wrote a script[0] to extract the documentation
strings into the manual[1].

So in my experience having the Texinfo in docstrings is nice.  Only
gripe I have with it is that (texinfo) module is bit limited, and
rejects a lot (for some value of "lot" :)) of valid texinfo.

Tomas

0: https://git.wolfsden.cz/guile-wolfsden/tree/build-aux/doc-snarf.scm
1: https://files.wolfsden.cz/manuals/guile-wolfsden/guile-wolfsden-0.0.7.html#Auto_002dgenerated-documentation

-- 
There are only two hard things in Computer Science:
cache invalidation, naming things and off-by-one errors.
signature.asc (application/pgp-signature, 853 B)
-----BEGIN PGP SIGNATURE-----

iQJCBAEBCgAsFiEEt4NJs4wUfTYpiGikL7/ufbZ/wakFAmeyA+0OHH5Ad29sZnNk
ZW4uY3oACgkQL7/ufbZ/wambLA/9HAmdYhckFqVR4Hr9iAdogC0w0hXa4JtwvvNr
7eEgm31HNYUKqqBO3YTK7C3/VrFpZbnwPwfNvFvRJg5EqSfjHDP89EseegMoc3Tr
yLE8+okhxMPpaq7Pg28rBs/R0ZKzzR6SqvxU8tB25XhBS2Je/EMnl+78Y8yWlk1+
RBnplgHYR3LKTmQVHJG5EGofVzS9MmXx4LVnwdqL4JbetbJUT2etTzMj5RBV/s1o
0kCvNDv2+rt4gh845OBotA4gPfj8nK3g1er2zJhJ1XVlw2EU4Qz7aNa9rZo3XVWL
sRPGYIOodEu2BvLW9EtL9EQaQ8XSBjPiEGLCtPMgyc2GHuV8XC1TwqOKjKf9BUuw
dDtmI1rXwxRive95ylRqBmtjALCZYb1vvPS3FoGutkVYaLjU1BE0nXJ4Y8LvcSh5
Urnhwa+EOWgjX/ie6J3Xbwy/rJ3P1zvSsaG2m02MheA0rNQJEk4fBbpPg9iMqU+e
he1NRYpUzWRDj2x43xM6WOD7rOHAHiUKzDSl3mKpSbQIivgC5rmHzrLrctsKSZ18
kG7ZrBWJbQxl4s4fadiRyw4EZ1knYyejrmiTwVeR1Tp+rJMlnco4a+wrKmu1/XPF
jlubDzRZ1AVOCXXzR4u5kfFqw02dwEf0KO9hHuejS4tca4RkTYK+H4GhygJ1BenT
/x4qs54=
=ELxT
-----END PGP SIGNATURE-----