io.github.swagger2markup
swagger2markup
1.3.1
nl.jworks.markdown_to_asciidoc
markdown_to_asciidoc
1.0
org.pegdown
pegdown
1.6.0
test
io.github.swagger2markup
swagger2markup-maven-plugin
1.2.0
http://127.0.0.1:9092
src/docs/asciidoc/generated
ASCIIDOC
org.asciidoctor
asciidoctor-maven-plugin
1.5.3
org.asciidoctor
asciidoctorj-pdf
1.5.0-alpha.10.1
org.jruby
jruby-complete
1.7.21
src/docs/asciidoc/generated
coderay
left
output-html
generate-resources
process-asciidoc
html5
src/docs/asciidoc/html
output-pdf
generate-resources
process-asciidoc
pdf
src/docs/asciidoc/pdf
@RunWith(SpringRunner.class)
創(chuàng)新互聯(lián)是一家專注于成都網(wǎng)站建設(shè)、成都網(wǎng)站制作與策劃設(shè)計(jì),碑林網(wǎng)站建設(shè)哪家好?創(chuàng)新互聯(lián)做網(wǎng)站,專注于網(wǎng)站建設(shè)十余年,網(wǎng)設(shè)計(jì)領(lǐng)域的專業(yè)建站公司;建站業(yè)務(wù)涵蓋:碑林等地區(qū)。碑林做網(wǎng)站價(jià)格咨詢:13518219792
@SpringBootTest(webEnvironment = SpringBootTest.WebEnvironment.DEFINED_PORT)
public class GneratorSwaggerPdfAndHtml {
public void generateAsciiDocs() throws Exception {
// 輸出Ascii格式
Swagger2MarkupConfig config = new Swagger2MarkupConfigBuilder()
.withMarkupLanguage(MarkupLanguage.ASCIIDOC)
.build();
Swagger2MarkupConverter.from(new URL("http://localhost:9092/v2/api-docs"))
.withConfig(config)
.build()
.toFolder(Paths.get("src/docs/asciidoc/generated"));
}
}
本地 Swagger2AutoConfiguration類,繼承WebMvcConfigurationSupport,并重寫addResourceHandlers方法
@Override
protected void addResourceHandlers(ResourceHandlerRegistry registry) {
registry.addResourceHandler("swagger-ui.html")
.addResourceLocations("classpath:/META-INF/resources/");
registry.addResourceHandler("/webjars/**")
.addResourceLocations("classpath:/META-INF/resources/webjars/");
}
先執(zhí)行命令mvn asciidoctor:process-asciidoc
Run 此UT,會(huì)生成Adoc文件。
然后執(zhí)行 命令mvn generate-resources
生成PDF和HTML
創(chuàng)新互聯(lián)www.cdcxhl.cn,專業(yè)提供香港、美國(guó)云服務(wù)器,動(dòng)態(tài)BGP最優(yōu)骨干路由自動(dòng)選擇,持續(xù)穩(wěn)定高效的網(wǎng)絡(luò)助力業(yè)務(wù)部署。公司持有工信部辦法的idc、isp許可證, 機(jī)房獨(dú)有T級(jí)流量清洗系統(tǒng)配攻擊溯源,準(zhǔn)確進(jìn)行流量調(diào)度,確保服務(wù)器高可用性。佳節(jié)活動(dòng)現(xiàn)已開啟,新人活動(dòng)云服務(wù)器買多久送多久。