Minor improvement to asciidoc doc generator (#3889)

* minor improvement to asciidoc geneator

* remove empty line
This commit is contained in:
William Cheng 2019-09-14 20:30:34 +08:00 committed by GitHub
parent 8055231400
commit e0b56502a3
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 1818 additions and 1494 deletions

0
bin/asciidoc-documentation-petstore.sh Normal file → Executable file
View File

View File

@ -1,3 +1,19 @@
/*
* Copyright 2018 OpenAPI-Generator Contributors (https://openapi-generator.tech)
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.openapitools.codegen.languages;
import org.openapitools.codegen.*;
@ -21,7 +37,7 @@ import io.swagger.v3.oas.models.OpenAPI;
/**
* basic asciidoc markup generator.
*
*
* @see <a href="https://asciidoctor.org">asciidoctor</a>
*/
public class AsciidocDocumentationCodegen extends DefaultCodegen implements CodegenConfig {
@ -34,7 +50,7 @@ public class AsciidocDocumentationCodegen extends DefaultCodegen implements Code
/**
* Lambda emitting an asciidoc "include::filename.adoc[]" if file is found in
* path. Use:
*
*
* <pre>
* {{#includemarkup}}{{name}}/description.adoc{{/includemarkup}}
* </pre>
@ -75,7 +91,7 @@ public class AsciidocDocumentationCodegen extends DefaultCodegen implements Code
/**
* Lambda emitting an asciidoc "http link" if file is found in path. Use:
*
*
* <pre>
* {{#snippetLink}}markup until koma, /{{name}}.json{{/snippetLink}}
* </pre>
@ -136,7 +152,7 @@ public class AsciidocDocumentationCodegen extends DefaultCodegen implements Code
/**
* extracted filter value should be relative to be of use as link or include
* file.
*
*
* @param name filename to sanitize
* @return trimmed and striped path part or empty string.
*/
@ -184,10 +200,10 @@ public class AsciidocDocumentationCodegen extends DefaultCodegen implements Code
cliOptions.add(new CliOption(SNIPPET_DIR,
"path with includable markup snippets (e.g. test output generated by restdoc, default: .")
.defaultValue("."));
.defaultValue("."));
cliOptions.add(new CliOption(SPEC_DIR,
"path with includable markup spec files (e.g. handwritten additional docs, default: .")
.defaultValue(".."));
.defaultValue(".."));
additionalProperties.put("appName", "OpenAPI Sample description");
additionalProperties.put("appDescription", "A sample OpenAPI documentation");
@ -227,7 +243,6 @@ public class AsciidocDocumentationCodegen extends DefaultCodegen implements Code
LOGGER.warn("base part for include markup lambda not found: " + specDir + " as "
+ Paths.get(specDir).toAbsolutePath());
}
;
this.includeSpecMarkupLambda = new IncludeMarkupLambda(specDir);
additionalProperties.put("specinclude", this.includeSpecMarkupLambda);
@ -237,7 +252,6 @@ public class AsciidocDocumentationCodegen extends DefaultCodegen implements Code
LOGGER.warn("base part for include markup lambda not found: " + snippetDir + " as "
+ Paths.get(snippetDir).toAbsolutePath());
}
;
this.includeSnippetMarkupLambda = new IncludeMarkupLambda(snippetDir);
additionalProperties.put("snippetinclude", this.includeSnippetMarkupLambda);
@ -249,10 +263,10 @@ public class AsciidocDocumentationCodegen extends DefaultCodegen implements Code
@Override
public void processOpenAPI(OpenAPI openAPI) {
if (this.includeSpecMarkupLambda != null) {
LOGGER.info("specs: " + ": " + this.includeSpecMarkupLambda.resetCounter());
LOGGER.debug("specs: " + ": " + this.includeSpecMarkupLambda.resetCounter());
}
if (this.includeSnippetMarkupLambda != null) {
LOGGER.info("snippets: " + ": " + this.includeSnippetMarkupLambda.resetCounter());
LOGGER.debug("snippets: " + ": " + this.includeSnippetMarkupLambda.resetCounter());
}
super.processOpenAPI(openAPI);
}

View File

@ -1 +1 @@
unset
4.1.3-SNAPSHOT

File diff suppressed because it is too large Load Diff