编写文档

1.x
tanghc 6 years ago
parent 08bf664117
commit a5eb49ab6e
  1. 2
      README.md
  2. 8
      doc/docs/_sidebar.md
  3. 10
      doc/src/main/java/com/gitee/sop/doc/SidebarTest.java

@ -68,7 +68,7 @@ SOP封装了开放平台大部分功能包括:签名验证、统一异常处
## 相关文档 ## 相关文档
待完善 [开发文档](http://durcframework.gitee.io/sop)
## 沟通交流 ## 沟通交流

@ -1,6 +1,6 @@
* 文档目录 * 文档目录
* [错误处理](files/1004_错误处理.md?t=1553335182242) * [快速体验](files/1001_快速体验.md?t=1553335685610)
* [新增接口](files/1002_新增接口.md?t=1553335182268) * [新增接口](files/1002_新增接口.md?t=1553335685628)
* [快速体验](files/1001_快速体验.md?t=1553335182268) * [业务参数校验](files/1003_业务参数校验.md?t=1553335685628)
* [业务参数校验](files/1003_业务参数校验.md?t=1553335182268) * [错误处理](files/1004_错误处理.md?t=1553335685628)

@ -2,6 +2,10 @@ package com.gitee.sop.doc;
import java.io.File; import java.io.File;
import java.io.FileOutputStream; import java.io.FileOutputStream;
import java.util.Comparator;
import java.util.List;
import java.util.stream.Collectors;
import java.util.stream.Stream;
/** /**
* 生成_sidebar.md文件直接运行即可 * 生成_sidebar.md文件直接运行即可
@ -18,8 +22,12 @@ public class SidebarTest {
String fileDir = root + "/docs/files"; String fileDir = root + "/docs/files";
File dir = new File(fileDir); File dir = new File(fileDir);
File[] files = dir.listFiles(); File[] files = dir.listFiles();
Stream<File> filesStream = Stream.of(files);
List<File> fileList = filesStream
.sorted(Comparator.comparing(File::getName))
.collect(Collectors.toList());
StringBuilder output = new StringBuilder(); StringBuilder output = new StringBuilder();
for (File file : files) { for (File file : fileList) {
String filename = file.getName(); String filename = file.getName();
String title = filename.substring(filename.indexOf("_") + 1, filename.length() - 3); String title = filename.substring(filename.indexOf("_") + 1, filename.length() - 3);
String line = String.format(format, title, filename, System.currentTimeMillis()); String line = String.format(format, title, filename, System.currentTimeMillis());

Loading…
Cancel
Save