Skip to content

Commit

Permalink
bookstack-auto
Browse files Browse the repository at this point in the history
  • Loading branch information
TruthHun88 committed Feb 11, 2020
1 parent 409a188 commit 00790dc
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 2 deletions.
4 changes: 4 additions & 0 deletions conf/app.conf.example
Original file line number Diff line number Diff line change
@@ -1,6 +1,10 @@
# 程序名称
appname = BookStack

# 内容采集转发。如: https://http-transfer.abc.com
# 需要部署`http-transfer`服务:https://github.com/TruthHun/http-transfer
http_transfer =

# 微信小程序 appid
appId=""

Expand Down
5 changes: 3 additions & 2 deletions controllers/DocumentController.go
Original file line number Diff line number Diff line change
Expand Up @@ -1021,16 +1021,17 @@ func (this *DocumentController) Content() {
if strings.ToLower(doc.Identify) == "summary.md" {
if auto {
icont, _ = newDoc.CreateDocumentTreeForHtml(doc.BookId, doc.DocumentId)
imd = html2md.Convert(icont)
} else {
imd = html2md.Convert(content)
markdown = imd
}
imd = strings.Replace(imd, "(/read/"+identify+"/", "($", -1)
markdown = imd
} else {
imd, icont = newDoc.BookStackAuto(bookId, docId)
}
markdown = strings.Replace(markdown, "<bookstack-auto></bookstack-auto>", imd, -1)
content = strings.Replace(content, "<bookstack-auto></bookstack-auto>", icont, -1)
markdown = strings.Replace(markdown, "(/read/"+identify+"/", "($", -1)
isAuto = true && !isSummary
}

Expand Down

0 comments on commit 00790dc

Please sign in to comment.