Documentation ¶
Overview ¶
Author:TruthHun Email:TruthHun@QQ.COM Date:2018-01-21
Author:TruthHun Email:TruthHun@QQ.COM Date:2018-01-21
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var MediaType = map[string]string{
".jpeg": "image/jpeg",
".png": "image/png",
".jpg": "image/jpeg",
".gif": "image/gif",
".ico": "image/x-icon",
".bmp": "image/bmp",
".html": "application/xhtml+xml",
".xhtml": "application/xhtml+xml",
".htm": "application/xhtml+xml",
".otf": "application/x-font-opentype",
".ttf": "application/x-font-ttf",
".js": "application/x-javascript",
".ncx": "x-dtbncx+xml",
".txt": "text/plain",
".xml": "text/xml",
".css": "text/css",
}
media-type
Functions ¶
func GetFooterOrHeaderParams ¶ added in v0.7.3
Types ¶
type Config ¶
type Config struct { Charset string `json:"charset"` //字符编码,默认utf-8编码 Cover string `json:"cover"` //封面图片,或者封面html文件 Timestamp string `json:"date"` //时间日期,如“2018-01-01 12:12:21”,其实是time.Time格式,但是直接用string就好 Description string `json:"description"` //摘要 Header string `json:"header"` //pdf的header Identifier string `json:"identifier"` //即uuid,留空即可 Language string `json:"language"` //语言,如zh、en、zh-CN、en-US等 Creator string `json:"creator"` //作者,即author Publisher string `json:"publisher"` //出版单位 Contributor string `json:"contributor"` //同Publisher Title string `json:"title"` //文档标题 Format []string `json:"format"` //导出格式,可选值:pdf、epub、mobi FontSize string `json:"font_size"` //默认的pdf导出字体大小 PaperSize string `json:"paper_size"` //页面大小 MarginLeft string `json:"margin_left"` //PDF文档左边距,写数字即可,默认72pt MarginRight string `json:"margin_right"` //PDF文档左边距,写数字即可,默认72pt MarginTop string `json:"margin_top"` //PDF文档左边距,写数字即可,默认72pt MarginBottom string `json:"margin_bottom"` //PDF文档左边距,写数字即可,默认72pt More []string `json:"more"` //更多导出选项[PDF导出选项,具体参考:https://manual.calibre-ebook.com/generated/en/ebook-convert.html#pdf-output-options] Toc []Toc `json:"toc"` //目录 /////////////////////////////////////////// Order []string `json:"-"` //这个不需要赋值 }
config.json文件解析结构
type Converter ¶
func NewConverter ¶
接口文档 https://manual.calibre-ebook.com/generated/en/ebook-convert.html#table-of-contents 根据json配置文件,创建文档转化对象
type ResolveResult ¶ added in v0.8.1
type ResolveResult struct { }
func Resolve ¶ added in v0.8.1
func Resolve(p string) (ResolveResult, error)
type Toc ¶
type Toc struct { Id int `json:"id"` Link string `json:"link"` Pid int `json:"pid"` Title string `json:"title"` }
目录结构
type XmlContent ¶ added in v0.8.1
type XmlDocTitle ¶ added in v0.8.1
type XmlDocTitle struct {
Text string `xml:"text"`
}
type XmlNavLabel ¶ added in v0.8.1
type XmlNavLabel struct { }
type XmlNavPoint ¶ added in v0.8.1
type XmlNavPoint struct {}
type XmlTocNavMap ¶ added in v0.8.1
type XmlTocNavMap struct {}
Click to show internal directories.
Click to hide internal directories.