添加自定义输出文件名称属性
This commit is contained in:
parent
537b2f5aa6
commit
1a6eebf5c1
|
@ -37,6 +37,7 @@ import com.power.doc.template.SpringBootDocBuildTemplate;
|
|||
import com.power.doc.utils.BeetlTemplateUtil;
|
||||
import com.power.doc.utils.MarkDownUtil;
|
||||
import com.thoughtworks.qdox.JavaProjectBuilder;
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
import org.beetl.core.Template;
|
||||
|
||||
import java.util.List;
|
||||
|
@ -79,6 +80,9 @@ public class HtmlApiDocBuilder {
|
|||
if (config.isAllInOne()) {
|
||||
Template indexCssTemplate = BeetlTemplateUtil.getByName(ALL_IN_ONE_CSS);
|
||||
FileUtil.nioWriteFile(indexCssTemplate.render(), config.getOutPath() + FILE_SEPARATOR + ALL_IN_ONE_CSS);
|
||||
if(StringUtils.isNotEmpty(config.getIndexFileName())){
|
||||
INDEX_HTML = config.getIndexFileName();
|
||||
}
|
||||
builderTemplate.buildAllInOne(apiDocList, config, javaProjectBuilder, ALL_IN_ONE_HTML_TPL, INDEX_HTML);
|
||||
} else {
|
||||
List<ApiDocDict> apiDocDictList = builderTemplate.buildDictionary(config, javaProjectBuilder);
|
||||
|
|
|
@ -204,6 +204,19 @@ public class ApiConfig {
|
|||
*/
|
||||
private int recursionLimit = 7;
|
||||
|
||||
/**
|
||||
* name of index
|
||||
*/
|
||||
private String indexFileName;
|
||||
|
||||
|
||||
public String getIndexFileName() {
|
||||
return indexFileName;
|
||||
}
|
||||
|
||||
public void setIndexFileName(String indexFileName) {
|
||||
this.indexFileName = indexFileName;
|
||||
}
|
||||
|
||||
public String getServerUrl() {
|
||||
return serverUrl;
|
||||
|
|
|
@ -4,6 +4,7 @@
|
|||
"allInOne": true,
|
||||
"outPath": "D://md2",
|
||||
"coverOld": true,
|
||||
"indexFileName":"demoProject.html",
|
||||
"packageFilters": "",
|
||||
"md5EncryptedHtmlName": false,
|
||||
"projectName": "smart-doc",
|
||||
|
|
Loading…
Reference in New Issue