Apigcc – non intrusive restdoc document generation tool

Time:2021-4-19

Apigcc – non intrusive restdoc document generation tool

Preface — restdoc

Programmers always have a worry, just want to write code, do not want to write documents. The code expresses my mind and soul.

Python comes up with a solution calleddocstringTo try to solve this problem. That is to write code, but also to write documents, keep the code and documents consistent. Docstring is a bunch of comments in code. Python’s docstring can directly output a formatted document through the help function. The idea of this tool is similar to this.

Code is document

Apigcc is aNoninvasiveRestdoc document generation tool based on. The tool obtains document information and generates restdoc document by analyzing code and comments.

Maven User Guide

1. Introduce corresponding dependency

 <!-- https://mvnrepository.com/artifact/com.github.apiggs/apiggs -->
        <dependency>
            <groupId>com.github.apiggs</groupId>
            <artifactId>apiggs</artifactId>
            <version>1.6</version>
        </dependency>

2. Introduce Maven plug-in – configuration

<plugin>
                <groupId>com.github.apiggs</groupId>
                <artifactId>apiggs-maven-plugin</artifactId>
                <version>1.6</version>
                <executions>
                    <execution>
                        <phase>compile</phase>
                        <goals>
                            <goal>apiggs</goal>
                        </goals>
                    </execution>
                </executions>
                <configuration>
                    <!-- options in there -->
                    <id>example</id>
                    <version>${version}</version>
                    < description > sample interface document, using the default template < / description >
                    < title > sample interface document
                </configuration>
            </plugin>

Parameter description

  • ID project ID, generating id.html And so on
  • Title document title
  • Description document description
  • Production output folder, which is apiggs by default
  • Out output directory, target by default
  • Source source directory, which reads Src / main / Java of the current project by default
  • Dependency source code directory, separated by commas
  • Jar source code depends on the jar package directory, separated by commas
  • Ignore ignores certain types, such as userdto
  • Version document version number
  • CSS setting HTML style sheet

matters needing attention:

  • Please comment out the plug-in when you need clean install to execute MVN compile, because there is a conflict

Generation effect

Apigcc - non intrusive restdoc document generation tool