From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp2 ([2001:41d0:2:bcc0::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms0.migadu.com with LMTPS id XWIlFgC9wGBbRAAAgWs5BA (envelope-from ) for ; Wed, 09 Jun 2021 15:07:12 +0200 Received: from aspmx1.migadu.com ([2001:41d0:2:bcc0::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp2 with LMTPS id QJwXEQC9wGBudgAAB5/wlQ (envelope-from ) for ; Wed, 09 Jun 2021 13:07:12 +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 031F12374C for ; Wed, 9 Jun 2021 15:07:12 +0200 (CEST) Received: from localhost ([::1]:36836 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1lqxvL-0000rU-10 for larch@yhetil.org; Wed, 09 Jun 2021 09:07:11 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:52604) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lqxvC-0000r0-LM for guix-patches@gnu.org; Wed, 09 Jun 2021 09:07:02 -0400 Received: from debbugs.gnu.org ([209.51.188.43]:49218) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1lqxvC-0007Ut-Cj for guix-patches@gnu.org; Wed, 09 Jun 2021 09:07:02 -0400 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1lqxvC-0002CQ-9d for guix-patches@gnu.org; Wed, 09 Jun 2021 09:07:02 -0400 X-Loop: help-debbugs@gnu.org Subject: [bug#48934] [PATCH 1/2] services: configuration: Change formatting of generated Resent-From: Xinglu Chen Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Wed, 09 Jun 2021 13:07:02 +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: 48934@debbugs.gnu.org Received: via spool by 48934-submit@debbugs.gnu.org id=B48934.16232439968400 (code B ref 48934); Wed, 09 Jun 2021 13:07:02 +0000 Received: (at 48934) by debbugs.gnu.org; 9 Jun 2021 13:06:36 +0000 Received: from localhost ([127.0.0.1]:60762 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1lqxum-0002BP-C3 for submit@debbugs.gnu.org; Wed, 09 Jun 2021 09:06:36 -0400 Received: from h87-96-130-155.cust.a3fiber.se ([87.96.130.155]:32938 helo=mail.yoctocell.xyz) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1lqxui-0002Ay-M0 for 48934@debbugs.gnu.org; Wed, 09 Jun 2021 09:06:34 -0400 From: Xinglu Chen DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=yoctocell.xyz; s=mail; t=1623243987; bh=YfxPEKFxM9q/JtnqgCSJxmOk2/nv/tOAx9c4HbOVT1s=; h=From:To:Subject:In-Reply-To:References:Date; b=e0zsV8/YWtRxPATytRkQA8pEVVN2HkcZ4EN6vngMmDXebVl7UVoeo1RXatWDFhs9R 6A/uTBhR9kxbdG3f7tG3YIbpet43JsKRPvPUTcNE1c7X26Sw3hTgOMKCwq4/la+qFq BKGM9vDuENeNMh6Y30sRMakYvNAf7Tk12O3rID2g= In-Reply-To: References: Message-Id: <07aed2e6ffe6c6fdab4a38207cafb7d3169c6e11.1623243063.git.public@yoctocell.xyz> Date: Wed, 09 Jun 2021 15:06:26 +0200 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=1623244032; h=from:from:sender:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to: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=giSsT6bjOl3FQ4y1XDAKMuqMnfCCFKGCJmIp/HXaxzs=; b=tZHqJoHY2USEB5gMhxjelVpeFEa0JmiKXxAY34nATPxk2CT7ZylGxrhLt4BuVFTReOX/yv p9E00RKvsf+TkBaWQBhQwPfr7uRAWUzA70vYkbgUjTwOklQU8y7fkuMUuAgv0ZgP8C9Sft HSAO6LA8KttDd8PPUTDgk+3hAcJyARzNYk/DJ9J0ZPsirZnmYacYVw1tJKUWaruBG4IlUx nCutIC6kZOsw+k3oudggAsdxNZf5UDDj7zD3GL+HqTuYCrOrLjrbGNb2y7P8Qz1PAmctw+ JdDTbs5iNHv1q9MF6p3ZH+aHFCwHpsvIB948McLmDmYLAtpWGVeD/RFInTA7FQ== ARC-Seal: i=1; s=key1; d=yhetil.org; t=1623244032; a=rsa-sha256; cv=none; b=GX9bcrV1Dv1F7UrAgaKs2SImd0xIlNPVsQbD3AXAZpWQpVTCNQ1ptxEYlxunnDmbF98LnL 72oph393jHqJPP48hbMF7oqfz7CW+V6MTvRf5UNH54BGEx66+XfR06BFFFUIivuiq88CeX vFcNH2kDJarifPOZYhSZF9X74253SiKC/rpbUHCGNFz8BT0TXH/a6WHgKxjpz1uHb/CRVa 0GJszKkpPtTuCq9RCoShNlsA0Qo1is7CfezX/xVlaXeS/4GXcSU2fwLHSQY82vzIkNJ4QD 2Se8z4vtm+AKy5nUoshDFYJbsbgfgXr78KwH9Lu75jSGCp6sbsjI/ZGe2o0kqg== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=fail ("headers rsa verify failed") header.d=yoctocell.xyz header.s=mail header.b="e0zsV8/Y"; dmarc=fail reason="SPF not aligned (relaxed)" header.from=yoctocell.xyz (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: -0.33 Authentication-Results: aspmx1.migadu.com; dkim=fail ("headers rsa verify failed") header.d=yoctocell.xyz header.s=mail header.b="e0zsV8/Y"; dmarc=fail reason="SPF not aligned (relaxed)" header.from=yoctocell.xyz (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: 031F12374C X-Spam-Score: -0.33 X-Migadu-Scanner: scn1.migadu.com X-TUID: wSt9o1X0uRRN * gnu/services/configuration (generate-documentation): Make the formatting = of the generated docs more consistent with the rest of the docs in the =E2= =80=9CServices=E2=80=9D section of the manual. --- 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 are:= ") - ,@(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)) " paramet= er") - (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 ar= e:") + (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-docume= ntation 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= )))) + `(entry (% (heading (code ,(str field-name)) + ,@(if (show-default? default) + `(" (default: " (code ,= (str default)) ")") + '()) + " (type: " + ,(str field-type) + ")")) + (para ,@field-docs) + ,@(append-map + generate + (or (assq-ref sub-documentation field-= name) '()))))) + fields))))))) (stexi->texi `(*fragment* . ,(generate documentation-name)))) =20 (define (configuration->documentation configuration-symbol) --=20 2.32.0