GNU bug report logs -
#47741
[PATCH 0/3] Add a service for OpenDHT
Previous Next
Full log
Message #11 received at 47741 <at> debbugs.gnu.org (full text, mbox):
I found the original (undocumented) interface difficult to understand, which
was the rationale for adding a simpler one on top of it.
* gnu/services/configuration.scm (configuration->documentation): New procedure.
---
gnu/services/configuration.scm | 13 +++++++++++++
1 file changed, 13 insertions(+)
diff --git a/gnu/services/configuration.scm b/gnu/services/configuration.scm
index 90f12a8d39..750535342d 100644
--- a/gnu/services/configuration.scm
+++ b/gnu/services/configuration.scm
@@ -43,6 +43,7 @@
define-configuration
validate-configuration
generate-documentation
+ configuration->documentation
serialize-package))
;;; Commentary:
@@ -188,3 +189,15 @@
(or (assq-ref sub-documentation field-name) '())))))
fields)))))
(stexi->texi `(*fragment* . ,(generate documentation-name))))
+
+(define (configuration->documentation configuration-symbol)
+ "Takes CONFIGURATION-SYMBOL, the symbol used when defining a configuration
+record with DEFINE-CONFIGURATION, and outputs the Texinfo documentation of its
+fields."
+ ;; This is syntax sugar for a simple, straight-forward application of
+ ;; GENERATE-DOCUMENTATION.
+ (let ((fields-getter (module-ref (current-module)
+ (symbol-append configuration-symbol
+ '-fields))))
+ (format #t (generate-documentation `((,configuration-symbol ,fields-getter))
+ configuration-symbol))))
--
2.31.1
This bug report was last modified 4 years and 60 days ago.
Previous Next
GNU bug tracking system
Copyright (C) 1999 Darren O. Benham,
1997,2003 nCipher Corporation Ltd,
1994-97 Ian Jackson.