guix-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Texinfo in descriptions?


From: Mathieu Lirzin
Subject: Re: Texinfo in descriptions?
Date: Thu, 27 Aug 2015 21:48:24 +0200
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/24.4 (gnu/linux)

Andy Wingo <address@hidden> writes:

> Will all docstrings be parsed as texinfo?  To me this is the proper
> solution, since plain text is mostly a subset of texinfo.

Yes, that's the idea.

>  It could be
> that all descriptions are already texinfo.  You just have to be careful
> about @ { and } when used literally -- they need replacing with @@ @{
> and @}.
>
> In Guile I've had a hack that tries to render docstrings as texinfo,
> falling back to a @verbatim block otherwise, but I don't recommend it:
>
>   (use-modules (texinfo) (texinfo plain-text) (ice-9 regexp))
>
>   (define many-space? (make-regexp "[[:space:]][[:space:]][[:space:]]"))
>   (define initial-space? (make-regexp "^[[:space:]]"))
>   (define (string->stexi str)
>     (or (and (or (not str) (string-null? str))
>              '(*fragment*))
>         (and (or (string-index str #\@)
>                  (and (not (regexp-exec many-space? str))
>                       (not (regexp-exec initial-space? str))))
>              (false-if-exception
>               (texi-fragment->stexi str)))
>         `(*fragment* (verbatim ,str))))
>   (define (string-format str)
>     (stexi->plain-text (string->stexi str)))
>
> Better to just adopt texinfo and fix up any descriptions that need it.
> Probably you could use guix package -s and recutils to grep for
> descriptions that need patching.

Thank you very much for the tips and experience sharing!

--
Mathieu Lirzin



reply via email to

[Prev in Thread] Current Thread [Next in Thread]