From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp1 ([2001:41d0:2:bcc0::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms0.migadu.com with LMTPS id cBZzGlM1CGGsQAEAgWs5BA (envelope-from ) for ; Mon, 02 Aug 2021 20:11:31 +0200 Received: from aspmx1.migadu.com ([2001:41d0:2:bcc0::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp1 with LMTPS id qEP+FVM1CGEXJgAAbx9fmQ (envelope-from ) for ; Mon, 02 Aug 2021 18:11:31 +0000 Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by aspmx1.migadu.com (Postfix) with ESMTPS id 9B5CC7712 for ; Mon, 2 Aug 2021 20:11:30 +0200 (CEST) Received: from localhost ([::1]:33534 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1mAcPR-00053v-Jo for larch@yhetil.org; Mon, 02 Aug 2021 14:11:29 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:46530) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mAcP3-00053f-7s for guix-patches@gnu.org; Mon, 02 Aug 2021 14:11:05 -0400 Received: from debbugs.gnu.org ([209.51.188.43]:55902) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1mAcP0-0004CH-Bm for guix-patches@gnu.org; Mon, 02 Aug 2021 14:11:05 -0400 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1mAcP0-00005o-0T for guix-patches@gnu.org; Mon, 02 Aug 2021 14:11:02 -0400 X-Loop: help-debbugs@gnu.org Subject: [bug#48934] [PATCH 0/2] Some improvements to (gnu services configuration) Resent-From: Maxim Cournoyer Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Mon, 02 Aug 2021 18:11:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 48934 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: Xinglu Chen Cc: 48934@debbugs.gnu.org Received: via spool by 48934-submit@debbugs.gnu.org id=B48934.162792780932755 (code B ref 48934); Mon, 02 Aug 2021 18:11:01 +0000 Received: (at 48934) by debbugs.gnu.org; 2 Aug 2021 18:10:09 +0000 Received: from localhost ([127.0.0.1]:39215 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mAcO9-0008WF-EQ for submit@debbugs.gnu.org; Mon, 02 Aug 2021 14:10:09 -0400 Received: from mail-qv1-f42.google.com ([209.85.219.42]:37432) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mAcO8-0008W1-3k for 48934@debbugs.gnu.org; Mon, 02 Aug 2021 14:10:08 -0400 Received: by mail-qv1-f42.google.com with SMTP id js7so6740354qvb.4 for <48934@debbugs.gnu.org>; Mon, 02 Aug 2021 11:10:08 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:references:date:in-reply-to:message-id :user-agent:mime-version:content-transfer-encoding; bh=sNeqlwC1gMtmGo3urky5dt67sIHiJokfOIcNZTC1lek=; b=ukkNrEz4WXCnrBxBTjf/T+WfsKpHLM2/DwUTLn/2ZIlGX0kOqJc7D6oSpl+7+M5NpK cOxy6quRfWcdsi7yVc6mda06+XlHb01Bz9FLSZZWANMq3KvU09oA82R1Yzi7GfcLDG5w VlFwDutlGDM/Y0N/nwGDDkEckcMFkotGrTvKLYaxT0flp6bnRnZjJf4ZcRCHL/QH36E9 uKEhWryIHCultCg2gM8YXKNS+9ZkyTveeBwP0jKKZ4pGugegF9UV3orAxWsLfN3mn11g JPy/Ga/X6HSRFlGrZCprgFKEqwrcSllRuviR9KhaRJcwDzdUZopC6ktRxyh7u4P3Al8G 4wXw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:references:date:in-reply-to :message-id:user-agent:mime-version:content-transfer-encoding; bh=sNeqlwC1gMtmGo3urky5dt67sIHiJokfOIcNZTC1lek=; b=Rp/asqibqZ5f79OSvcncY+K4jj6ShrGQgy9dgU33xoaL/ZPfLYh6YHL1Pa4bDGuof1 yrXpUApMtrs5LNiWyRwBgvGM0xmTu21GU2LomsghZKoDFVKL7IXb4jwj4ypAy3WPhpEk OgCXS8NhfZmOfHho/p+cbrpO9uk4o/4yrgXtKQ3Bhed/kest6vP3beNCX2kwhfef88tw mtVgzYLaiRnEdxpBK0AsV66Vu5qOM8dHQdbDwfftQh8Ep0FpqefTbEpBgE9YqyvTPO+l zLpyPkh5aLghEdw102xpC8OznxFiMevR3+n1l0RY+XQSYIp2MKOwMuqILzWBOtViuFRM CigQ== X-Gm-Message-State: AOAM531cBb7Qm4lP57C7tAR83fm46bqMp746fBJc7N1FQOFzJ8zAbkxA WPI7bfYKDP64vhvWFHreIFHmLT8cdrLTEg== X-Google-Smtp-Source: ABdhPJxhSAZuzr3eTKo3SfwR1yDODeyzsc2/FeZWZwHgdaZ/ASz9rk7HK1UTvvYtDagmNe5OrftW6A== X-Received: by 2002:a0c:aa42:: with SMTP id e2mr17893692qvb.23.1627927802498; Mon, 02 Aug 2021 11:10:02 -0700 (PDT) Received: from hurd ([207.35.94.204]) by smtp.gmail.com with ESMTPSA id j72sm4643491qke.112.2021.08.02.11.10.02 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 02 Aug 2021 11:10:02 -0700 (PDT) From: Maxim Cournoyer References: <07aed2e6ffe6c6fdab4a38207cafb7d3169c6e11.1623243063.git.public@yoctocell.xyz> Date: Mon, 02 Aug 2021 14:10:01 -0400 In-Reply-To: <07aed2e6ffe6c6fdab4a38207cafb7d3169c6e11.1623243063.git.public@yoctocell.xyz> (Xinglu Chen's message of "Wed, 09 Jun 2021 15:06:26 +0200") Message-ID: <87im0n90qu.fsf_-_@gmail.com> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.2 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: guix-patches@gnu.org List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guix-patches-bounces+larch=yhetil.org@gnu.org Sender: "Guix-patches" X-Migadu-Flow: FLOW_IN ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=yhetil.org; s=key1; t=1627927890; h=from:from:sender:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding:resent-cc: resent-from:resent-sender:resent-message-id:in-reply-to:in-reply-to: references:references:list-id:list-help:list-unsubscribe: list-subscribe:list-post:dkim-signature; bh=sNeqlwC1gMtmGo3urky5dt67sIHiJokfOIcNZTC1lek=; b=A+H8TwsIzWIevEx0vKqF3VtvPKhw8noe+Nq3uurR8eCDxuL6OQu1kAtaOZmTYR5Prc2VLt 9iNqtj0KqnGZC1OjgSw80XKxXDcVFrJV+vOFQ3VxES+88DVs92FJJKEFuvGwmGPDUD57BP SC1I25re6Wpn9PkGJREo1KljoWy8OyuWPHhVxJbNrFdi1p3dexrOKWaDFapYFjYOmPTaeA iDf0T7eIoQi8QnkSOtXHOJgKPgVSJolz891yuRWXJlqc+tgzrxE0CorWJomO6r5LmYBstx usOJB4xhu41DJnt+xABEa3bjmARbLlSK4j9b4GeU9E7t1tieeycRPfXM6mqBBg== ARC-Seal: i=1; s=key1; d=yhetil.org; t=1627927890; a=rsa-sha256; cv=none; b=A6/bvGfoZ6u+Cumj139abK/L3sfkavTb11/pASbuxwOM5wI8d97+xXNYb3IiCW1nurQiVn aw1nztWgvuO1mH7qk6N8YiUEkrIACDMIrWw4Hgw4FNqHspSJw/4D3gKTHvQ1MxFxAHFtDN +iuHEIh9K3NGseeP9x1OLpWdkw0hFKkptGLyd6ynv92FZDtqqiKqkpI9eTXVPVnMAWHEPy Uq9dCp49WjbrJ4Log/yURdGbhlYzQs1rbjdsP9qd9fKq3YEue8cueu9tuWzJmzoIfyKbSK r6ziI/XF86E4e7QC6alQkiFHo5GhsJRgwY3vFLRg/2ZqGzC5Y/NXg90eGbZV8A== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=fail ("headers rsa verify failed") header.d=gmail.com header.s=20161025 header.b=ukkNrEz4; dmarc=fail reason="SPF not aligned (relaxed)" header.from=gmail.com (policy=none); spf=pass (aspmx1.migadu.com: domain of guix-patches-bounces@gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=guix-patches-bounces@gnu.org X-Migadu-Spam-Score: -1.32 Authentication-Results: aspmx1.migadu.com; dkim=fail ("headers rsa verify failed") header.d=gmail.com header.s=20161025 header.b=ukkNrEz4; dmarc=fail reason="SPF not aligned (relaxed)" header.from=gmail.com (policy=none); spf=pass (aspmx1.migadu.com: domain of guix-patches-bounces@gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=guix-patches-bounces@gnu.org X-Migadu-Queue-Id: 9B5CC7712 X-Spam-Score: -1.32 X-Migadu-Scanner: scn1.migadu.com X-TUID: iv8Z+fbKW35H Hello Xinglu! Xinglu Chen writes: > * gnu/services/configuration (generate-documentation): Make the formattin= g of > the generated docs more consistent with the rest of the docs in the =E2= =80=9CServices=E2=80=9D > section of the manual. I've modified the commit message to be more in line with the GNU change log style (see 'info (standards) Style of Change Logs'), like so: services: configuration: Uniformize the generated documentation. Make the formatting of the generated docs more consistent with the rest o= f the docs in the =E2=80=9CServices=E2=80=9D section of the manual. * gnu/services/configuration (generate-documentation): Represent the data= type documentation of a field using a DEFTP table rather than DEFTYPEVR elemen= ts. > --- > gnu/services/configuration.scm | 54 ++++++++++++++++++---------------- > 1 file changed, 28 insertions(+), 26 deletions(-) > > diff --git a/gnu/services/configuration.scm b/gnu/services/configuration.= scm > index f23840ee6d..abcbc70520 100644 > --- a/gnu/services/configuration.scm > +++ b/gnu/services/configuration.scm > @@ -239,32 +239,34 @@ does not have a default value" field kind))) > (define (generate configuration-name) > (match (assq-ref documentation configuration-name) > ((fields . sub-documentation) > - `((para "Available " (code ,(str configuration-name)) " fields ar= e:") > - ,@(map > - (lambda (f) > - (let ((field-name (configuration-field-name f)) > - (field-type (configuration-field-type f)) > - (field-docs (cdr (texi-fragment->stexi > - (configuration-field-documentation= f)))) > - (default (catch #t > - (configuration-field-default-value-thunk = f) > - (lambda _ '%invalid)))) > - (define (show-default? val) > - (or (string? val) (number? val) (boolean? val) > - (and (symbol? val) (not (eq? val '%invalid))) > - (and (list? val) (and-map show-default? val)))) > - `(deftypevr (% (category > - (code ,(str configuration-name)) " param= eter") > - (data-type ,(str field-type)) > - (name ,(str field-name))) > - ,@field-docs > - ,@(if (show-default? default) > - `((para "Defaults to " (samp ,(str default)) ".= ")) > - '()) > - ,@(append-map > - generate > - (or (assq-ref sub-documentation field-name) '())))= )) > - fields))))) > + `((deftp (% (category "Data Type") (name ,(str configuration-name= ))) > + (para "Available " (code ,(str configuration-name)) " fields = are:") > + (table (% (formatter (asis))) > + ,@(map > + (lambda (f) > + (let ((field-name (configuration-field-name f)) > + (field-type (configuration-field-type f)) > + (field-docs (cdr (texi-fragment->stexi > + (configuration-field-docu= mentation f)))) > + (default (catch #t > + (configuration-field-default-val= ue-thunk f) > + (lambda _ '%invalid)))) > + (define (show-default? val) > + (or (string? val) (number? val) (boolean? val) > + (and (symbol? val) (not (eq? val '%invali= d))) > + (and (list? val) (and-map show-default? v= al)))) > + `(entry (% (heading (code ,(str field-name)) > + ,@(if (show-default? defaul= t) > + `(" (default: " (code= ,(str default)) ")") > + '()) > + " (type: " > + ,(str field-type) > + ")")) > + (para ,@field-docs) > + ,@(append-map > + generate > + (or (assq-ref sub-documentation fiel= d-name) '()))))) > + fields))))))) > (stexi->texi `(*fragment* . ,(generate documentation-name)))) >=20=20 > (define (configuration->documentation configuration-symbol) I've used this opportunity to re-indent the code a bit, so that it'd fit under 80 characters column width. Thanks for this neat improvement! Maxim