accumulo-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ctubbsii <...@git.apache.org>
Subject [GitHub] accumulo pull request #259: ACCUMULO-4630 Move user manual to Accumulo websi...
Date Thu, 18 May 2017 20:07:44 GMT
Github user ctubbsii commented on a diff in the pull request:

    https://github.com/apache/accumulo/pull/259#discussion_r117340009
  
    --- Diff: core/src/main/java/org/apache/accumulo/core/conf/ConfigurationDocGen.java ---
    @@ -37,174 +31,115 @@
     
         abstract void beginSection(String section);
     
    -    void endSection() {}
    -
         void generate() {
           pageHeader();
     
    -      beginSection("Available Properties");
    -      propertyQuickLinks();
    -      for (Property prefix : prefixes) {
    -        if (!prefix.isExperimental()) {
    -          prefixSection(prefix);
    -          for (Property prop : sortedProps.values()) {
    -            if (!prop.isExperimental()) {
    -              property(prefix, prop);
    -            }
    +      beginTable("Property");
    +      for (Property prop : sortedProps.values()) {
    +        if (!prop.isExperimental()) {
    +          if (prop.getType() == PropertyType.PREFIX) {
    +            prefixSection(prop);
    +          } else {
    +            property(prop);
               }
             }
           }
    -      endSection();
     
           beginSection("Property Types");
    +      beginTable("Type");
           propertyTypeDescriptions();
    -      endSection();
     
    -      pageFooter();
           doc.close();
         }
     
    -    abstract String getExt();
    -
    -    void pageFooter() {}
    +    abstract void beginTable(String name);
     
    -    // read static header content from resources and output
    -    void pageHeader() {
    -      appendResource("config-header." + getExt());
    -      doc.println();
    -    }
    +    abstract void pageHeader();
     
         abstract void prefixSection(Property prefix);
     
    -    abstract void property(Property prefix, Property prop);
    +    abstract void property(Property prop);
     
         abstract void propertyTypeDescriptions();
     
    -    abstract void propertyQuickLinks();
    -
    -    abstract String sanitize(String str);
    -
       }
     
    -  private class Asciidoc extends Format {
    +  private class Markdown extends Format {
    +
         @Override
         void beginSection(String section) {
    -      doc.println("=== " + section);
    +      doc.println("\n### " + section + "\n");
         }
     
         @Override
    -    String getExt() {
    -      return "txt";
    +    void beginTable(String name) {
    +      doc.println("| " + name + " | Description |");
    +      doc.println("|--------------|-------------|");
         }
     
         @Override
    -    void propertyQuickLinks() {
    -      doc.println("Jump to: ");
    -      String delimiter = "";
    -      for (Property prefix : prefixes) {
    -        if (!prefix.isExperimental()) {
    -          doc.print(delimiter + "<<" + prefix.name() + ">>");
    -          delimiter = " | ";
    -        }
    -      }
    -      doc.println();
    -      doc.println();
    +    void pageHeader() {
    +      doc.println("---");
    +      doc.println("title: Configuration Properties");
    +      doc.println("category: administration");
    +      doc.println("order: 3");
    +      doc.println("---\n");
    +      doc.println("<!-- WARNING: Do not edit this file. It is a generated file that
is copied from Accumulo build (from core/target/generated-docs) -->\n");
         }
     
         @Override
         void prefixSection(Property prefix) {
           boolean depr = prefix.isDeprecated();
    -      doc.println("[[" + prefix.name() + "]]");
    -      doc.println("==== " + prefix.getKey() + "*" + (depr ? " (Deprecated)" : ""));
    -      doc.println(strike((depr ? "_Deprecated._ " : "") + sanitize(prefix.getDescription()),
depr));
    -      doc.println();
    +      doc.print("| <a name=\"" + prefix.getKey().replace(".", "_") + "prefix\"></a>
**" + prefix.getKey() + "*** | ");
    +      doc.println((depr ? "**Deprecated.** " : "") + strike(sanitize(prefix.getDescription()),
depr) + " |");
    --- End diff --
    
    Could also make the `**` a `bold(String)`


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

Mime
View raw message