获取书籍的根目录
(fl []filetil.FileList)
| 1226 | |
| 1227 | // 获取书籍的根目录 |
| 1228 | func (this *BookController) getProjectRoot(fl []filetil.FileList) (root string) { |
| 1229 | var strs []string |
| 1230 | for _, f := range fl { |
| 1231 | if !f.IsDir { |
| 1232 | strs = append(strs, f.Path) |
| 1233 | } |
| 1234 | } |
| 1235 | return utils.LongestCommonPrefix(strs) |
| 1236 | } |
| 1237 | |
| 1238 | // 查找并替换markdown文件中的路径,把图片链接替换成url的相对路径,把文档间的链接替换成【$+文档标识链接】 |
| 1239 | func (this *BookController) fixFileLinks(projectRoot string, identify string) { |
no test coverage detected