You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@isis.apache.org by da...@apache.org on 2020/02/16 19:23:16 UTC

[isis] 03/07: ISIS-2062: docs

This is an automated email from the ASF dual-hosted git repository.

danhaywood pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/isis.git

commit f2f2e5375fc94d229bda47bc921529b054d71d58
Author: danhaywood <da...@haywood-associates.co.uk>
AuthorDate: Thu Feb 13 09:47:09 2020 +0000

    ISIS-2062: docs
---
 scripts/generateConfigDocs.groovy | 32 +++++++++++++++++++++++---------
 1 file changed, 23 insertions(+), 9 deletions(-)

diff --git a/scripts/generateConfigDocs.groovy b/scripts/generateConfigDocs.groovy
index eb4ea25..bfb023f 100644
--- a/scripts/generateConfigDocs.groovy
+++ b/scripts/generateConfigDocs.groovy
@@ -257,33 +257,47 @@ for (PropertyGroup group in groups) {
                 buf << "\n"
             }
 
-            String configFilePath = property.name.replace('.', File.separatorChar) + ".adoc";
-            def dirBaseSplitAt = configFilePath.lastIndexOf(File.separatorChar)
+            String configFilePath = property.name.replace(".", File.separator) + ".adoc";
+            def dirBaseSplitAt = configFilePath.lastIndexOf(File.separator)
             def configFileParentDir = outputDir + File.separator + configFilePath.substring(0, dirBaseSplitAt)
             def configFileName = configFilePath.substring(dirBaseSplitAt+1)
 
-            def configFile = new File(configFileParentDir, configFileName)
-
             def buf2 = StringBuilder.newInstance()
             buf2 << "= `${property.name}`"
             buf2 << "\n"
             buf2 << "\n"
+            buf2 << "== Description\n"
+            buf2 << "\n"
             if(propertyDescription) {
                 buf2 << propertyDescription
             } else {
                 buf2 << "No description available."
             }
             buf2 << "\n"
+            buf2 << "== Type\n"
+            buf2 << "\n"
             if(property.type) {
-                buf2 << "Type:: ${property.type}"
-                buf2 << "\n"
+                buf2 << "${property.type}"
+            } else {
+                buf2 << "Type not specified (assume string)."
             }
+            buf2 << "\n"
+            buf2 << "\n"
+            buf2 << "== Default Value\n"
+            buf2 << "\n"
             if(property.defaultValue) {
-                buf2 << "Default value:: ${property.defaultValue}"
-                buf2 << "\n"
+                buf2 << "${property.defaultValue}"
+            } else {
+                buf2 << "No default value."
             }
+            buf2 << "\n"
 
-            outputFile.write(buf2.toString())
+//            System.out.println(outputDir)
+//            System.out.println(configFileParentDir)
+//            System.out.println(configFileName)
+            def configFile = new File(configFileParentDir, configFileName)
+            new File(configFileParentDir).mkdirs()
+            configFile.write(buf2.toString())
         }
 
         def outputFile = new File(outputDir, "${group.fileName()}.adoc")