mirror of https://github.com/mindoc-org/mindoc.git
parent
7a90148507
commit
0820397f10
|
@ -137,19 +137,22 @@ func (this *Converter) Convert() (err error) {
|
|||
case "epub":
|
||||
if err = this.convertToEpub(); err != nil {
|
||||
errs = append(errs, err.Error())
|
||||
fmt.Println("转换EPUB文档失败:" + err.Error())
|
||||
}
|
||||
case "mobi":
|
||||
if err = this.convertToMobi(); err != nil {
|
||||
errs = append(errs, err.Error())
|
||||
fmt.Println("转换MOBI文档失败:" + err.Error())
|
||||
}
|
||||
case "pdf":
|
||||
if err = this.convertToPdf(); err != nil {
|
||||
fmt.Println(err)
|
||||
fmt.Println("转换PDF文档失败:" + err.Error())
|
||||
errs = append(errs, err.Error())
|
||||
|
||||
}
|
||||
case "docx":
|
||||
if err = this.convertToDocx(); err != nil {
|
||||
fmt.Println(err)
|
||||
fmt.Println("转换WORD文档失败:" + err.Error())
|
||||
errs = append(errs, err.Error())
|
||||
}
|
||||
}
|
||||
|
|
|
@ -199,7 +199,7 @@ func (m *BookResult) Converter(sessionId string) (ConvertBookResult, error) {
|
|||
defer func(p string) {
|
||||
os.RemoveAll(p)
|
||||
}(tempOutputPath)
|
||||
|
||||
|
||||
if utils.FileExists(pdfpath) && utils.FileExists(epubpath) && utils.FileExists(mobipath) && utils.FileExists(docxpath) {
|
||||
convertBookResult.EpubPath = epubpath
|
||||
convertBookResult.MobiPath = mobipath
|
||||
|
@ -245,8 +245,8 @@ func (m *BookResult) Converter(sessionId string) (ConvertBookResult, error) {
|
|||
Cover: m.Cover,
|
||||
Timestamp: time.Now().Format("2006-01-02 15:04:05"),
|
||||
Description: string(blackfriday.MarkdownBasic([]byte(m.Description))),
|
||||
Footer: "<p style='color:#8E8E8E;font-size:12px;'>本文档使用 <a href='https://www.iminho.me' style='text-decoration:none;color:#1abc9c;font-weight:bold;'>MinDoc</a> 构建 <span style='float:right'>- _PAGENUM_ -</span></p>",
|
||||
Header: "<p style='color:#8E8E8E;font-size:12px;'>_SECTION_</p>",
|
||||
Footer: "\"<p style='color:#8E8E8E;font-size:12px;'>本文档使用 <a href='https://www.iminho.me' style='text-decoration:none;color:#1abc9c;font-weight:bold;'>MinDoc</a> 构建 <span style='float:right'>- _PAGENUM_ -</span></p>\"",
|
||||
Header: "\"<p style='color:#8E8E8E;font-size:12px;'>_SECTION_</p>\"",
|
||||
Identifier: "",
|
||||
Language: "zh-CN",
|
||||
Creator: m.CreateName,
|
||||
|
|
|
@ -41,7 +41,7 @@
|
|||
<body>
|
||||
|
||||
<div class="m-manual manual-editor">
|
||||
<div class="manual-head" id="editormd-tools" style="min-width: 1200px;">
|
||||
<div class="manual-head" id="editormd-tools" style="min-width: 1200px; position:absolute;">
|
||||
<div class="editormd-group">
|
||||
<a href="{{urlfor "BookController.Index"}}" data-toggle="tooltip" data-title="返回"><i class="fa fa-chevron-left" aria-hidden="true"></i></a>
|
||||
</div>
|
||||
|
@ -103,7 +103,7 @@
|
|||
<div class="clearfix"></div>
|
||||
</div>
|
||||
<div class="manual-body">
|
||||
<div class="manual-category" id="manualCategory">
|
||||
<div class="manual-category" id="manualCategory" style="position:absolute;">
|
||||
<div class="manual-nav">
|
||||
<div class="nav-item active"><i class="fa fa-bars" aria-hidden="true"></i> 文档</div>
|
||||
<div class="nav-plus pull-right" id="btnAddDocument" data-toggle="tooltip" data-title="创建文档" data-direction="right"><i class="fa fa-plus" aria-hidden="true"></i></div>
|
||||
|
|
Loading…
Reference in New Issue