From mboxrd@z Thu Jan 1 00:00:00 1970 From: Mathieu Lirzin Subject: Re: Texinfo in descriptions? Date: Thu, 27 Aug 2015 21:48:24 +0200 Message-ID: <87egiofr7b.fsf@openmailbox.org> References: <87wpy0nygt.fsf@gmail.com> <87y4ige2ux.fsf@openmailbox.org> <87wpy0t83c.fsf@gnu.org> <87r3o7pz3h.fsf@openmailbox.org> <87y4ietrdz.fsf_-_@gnu.org> <874mkx8a5o.fsf@openmailbox.org> <87wpxs9ux0.fsf@gnu.org> <87h9ov51j9.fsf@gnu.org> <20150722220825.GA8182@debian> <87vbdb6w6o.fsf@openmailbox.org> <87mvynyo1z.fsf@gnu.org> <876143rpf2.fsf@openmailbox.org> <87k2si32ii.fsf@igalia.com> Mime-Version: 1.0 Content-Type: text/plain Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:44781) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZV3Aa-0003O1-MV for guix-devel@gnu.org; Thu, 27 Aug 2015 15:49:09 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ZV3AW-0000LW-4g for guix-devel@gnu.org; Thu, 27 Aug 2015 15:49:08 -0400 Received: from mail2.openmailbox.org ([62.4.1.33]:55279) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZV3AV-0000Kr-LI for guix-devel@gnu.org; Thu, 27 Aug 2015 15:49:03 -0400 In-Reply-To: <87k2si32ii.fsf@igalia.com> (Andy Wingo's message of "Wed, 26 Aug 2015 09:57:57 +0200") List-Id: "Development of GNU Guix and the GNU System distribution." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guix-devel-bounces+gcggd-guix-devel=m.gmane.org@gnu.org Sender: guix-devel-bounces+gcggd-guix-devel=m.gmane.org@gnu.org To: Andy Wingo Cc: guix-devel@gnu.org Andy Wingo 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