doc-apis doc-apis
💋Home
  • v1.0.0(current verison)
  • What's New

    • What' s New In doc-apis v1.0.0 ?
💖Charge
  • Community
  • Project PPT (opens new window)
  • Introduction
  • Member
  • PR
  • Join us
  • Customer
  • Easy-Es (opens new window)
  • Fit-Plan-Generator (opens new window)
  • Gitee (opens new window)
  • Github (opens new window)
  • English (opens new window)
  • 简体中文 (opens new window)

Advs are displayed by random carousel. ❤️Become a sponsor
💋Home
  • v1.0.0(current verison)
  • What's New

    • What' s New In doc-apis v1.0.0 ?
💖Charge
  • Community
  • Project PPT (opens new window)
  • Introduction
  • Member
  • PR
  • Join us
  • Customer
  • Easy-Es (opens new window)
  • Fit-Plan-Generator (opens new window)
  • Gitee (opens new window)
  • Github (opens new window)
  • English (opens new window)
  • 简体中文 (opens new window)
  • Quick Start Guide

    • Introduction
    • Applicable scenarios
    • Concerns rushed
    • Quick start demo
    • Other projects
      • Latest Version: ![Maven Central](https://search.maven.org/search?q=g:io.github.xpc1024%20a:easy-*)
    • Config
    • Annotation
  • Expand function

    • Interface debug
  • Others

    • FAQ
    • Update log
    • Update plan
    • Copyright
    • Acknowledgments
  • v1.xDocument
  • Quick Start Guide
LaoHan
2023-03-18
目录

Other projects

tip

In the previous chapter, we demonstrated how to start with one click in a Springboot project. This chapter will introduce how to use doc-apis to generate API documentation in other projects such as Jfinal.

In all non-Springboot projects, the ease of use may slightly decrease, but the learning curve remains very low, requiring only the essential CV+ modification skills of a skilled coder. Below, I will demonstrate using a spring project as an example:

Firstly, the coordinates introduced in non-SpringBoot projects differ slightly. There's no need to introduce the starter module; merely including the core module suffices:

Maven

        <!-- Introduce the latest version dependency of doc-apis -->
        <dependency>
            <groupId>com.doc-apis</groupId>
            <artifactId>doc-apis-core</artifactId>
            <!-- "Latest Version" here refers to the most recent version of the dependency, for instance, 2.0.0, which can be obtained via the image below -->
            <version>Latest Version</version>
            <!-- The following segment is optional. If you don't wish for doc-apis to be bundled into your project, it's also feasible to start the project with the test module to automatically generate the API documentation -->
            <!--<scope>test</scope>-->
        </dependency>

1
2
3
4
5
6
7
8
9
10

Gradle

compile group: 'com.doc-apis', name: 'doc-apis-core', version: 'Latest Version'
1

# Latest Version: Maven Central (opens new window)

    public static void main(String[] args) {
        DocsConfig docsConfig = new DocsConfig();
        // Specify the path of the project to be generated
        docsConfig.setProjectPath("E:\\doc-apis-test\\springDemo");
        // Document version number (optional)
        docsConfig.setApiVersion("V1.0");
        // Whether to auto-generate
        docsConfig.setAutoGenerate(Boolean.TRUE);
        // Path to store the generated document
        docsConfig.setDocsPath("E:\\tmp");
        // Generate additional markdown documents
        docsConfig.addPlugin(new MarkdownDocPlugin());
        // Execute the generation
        Docs.buildHtmlDocs(docsConfig);
    }

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16

Feel free to copy this code snippet into your project, then simply modify the path of the project to be generated and the document storage path, and run the main method.If you need to modify other personalized configurations, refer to the config chapter, where related configurations can be set directly through the set methods provided by DocsConfig.The usage in other niche types of projects like Jfinal, player, etc., is similar to spring projects and will not be repeated here.

Help us improve this document (opens new window)
lastUpdated: 2024/08/13
Quick start demo
Config

← Quick start demo Config→

Theme by Vdoing | Copyright © 2024-2024 LaoHan | MIT License
  • 跟随系统
  • 浅色模式
  • 深色模式
  • 阅读模式