第一张图是我在epub编辑器里看的,第二张图是我在dictango的IDE里看的,两边的HTML源码是一致,dictango IDE这边却不能保留epub的排版,直接把epub导出为带有HTML源码的txt再做成mdx也没还是没有排版,这种情况该如何解决?
(这个epub是我自己做的,因为需要手修的部分比较多,这几天都在作这个,这个epub做坏了,有些地方的问题太严重了,打算把这个epub重做。)
说实话,现在直接导出来,倒也能看,就是感觉自己费那么大劲整理好的排版一下子就没了,着实有些可惜。
其实这都没有什么问题,原数据主要是乱和问题很多,但本身的排版还是没问题的,我主要是手修了其中乱和有问题的地方,不过我做的这个epub有个大问题,就是我不小心把英文中的空格给删了,还不知道什么时候删的,推倒重来又太花时间了,就干脆不管了。(我是边学正则边做的,实在是手生。)
分词那个我前天问过了,但我主要是想保留原文本的排版,不过我个人实在不懂css,我对编程什么的一窍不通,如果自己实在搞不下来,那就这样了,没排版就没排版吧。
倒也是,要让我先学会好技术再开始作,都不知道也等到几百年后了,都是边做边学,哪里不会就去查,AI确实很好用,我现在有问题就问chatgpt,还好这些都能直接测试,不怕AI胡编。
是不是没有使用 EPUB 里面的 CSS?
我确实没有用css,我看了一下确实有css,这css该怎么当mdx的css,直接用就行了嘛。
也就是说把以下这些文本用正则直接替换到对应的文本行就行了吗?我去试试。
block_ {
display: block;
font-family: serif;
font-size: 1.125em;
line-height: 1.2;
margin: 0;
padding: 0;
}
.block_1 {
display: block;
font-size: 1.66667em;
font-weight: bold;
line-height: 1.73;
page-break-after: avoid;
page-break-inside: avoid;
margin: 13pt 0;
padding: 0;
}
.block_2 {
display: block;
font-weight: bold;
line-height: 12pt;
margin: 0;
padding: 0;
}
.block_3 {
display: block;
font-size: 1.125em;
line-height: 1.2;
margin: 0;
padding: 0;
}
.block_4 {
display: block;
font-size: 1em;
font-weight: bold;
line-height: 1.2;
margin: 0;
padding: 0;
}
.block_5 {
display: block;
line-height: 12pt;
margin: 0;
padding: 0;
}
.block_6 {
display: block;
font-size: 0.75em;
line-height: 12pt;
margin: 0;
padding: 0;
}
.block_7 {
display: block;
font-family: serif;
font-size: 1em;
line-height: 1.2;
margin: 0;
padding: 0;
}
.block_8 {
display: block;
font-size: 1em;
line-height: 1.2;
margin: 0;
padding: 0;
}
.block_9 {
display: block;
font-family: serif;
font-size: 1.66667em;
font-weight: normal;
line-height: 1.73;
page-break-after: avoid;
page-break-inside: avoid;
margin: 13pt 0;
padding: 0;
}
.block_10 {
display: block;
font-size: 1.66667em;
font-weight: normal;
line-height: 1.73;
page-break-after: avoid;
page-break-inside: avoid;
margin: 13pt 0;
padding: 0;
}
.block_11 {
display: block;
font-family: serif;
line-height: 12pt;
margin: 0;
padding: 0;
}
.block_12 {
display: block;
font-size: 0.58333em;
line-height: 12pt;
margin: 0;
padding: 0;
}
.block_13 {
color: #FFF;
display: block;
font-size: 1.125em;
font-weight: bold;
line-height: 1.2;
margin: 0;
padding: 0;
}
.block_14 {
display: block;
font-family: “Arial”, sans-serif;
font-size: 1em;
line-height: 1.2;
margin: 0;
padding: 0;
}
.block_15 {
display: block;
font-size: 1em;
font-style: italic;
font-weight: bold;
line-height: 1.2;
margin: 0;
padding: 0;
}
.block_16 {
display: block;
font-family: “Arial”, sans-serif;
font-size: 1em;
font-style: italic;
font-weight: bold;
line-height: 1.2;
margin: 0;
padding: 0;
}
.block_17 {
display: block;
font-family: serif;
font-size: 0.75em;
line-height: 12pt;
margin: 0;
padding: 0;
}
.block_18 {
display: block;
font-size: 0.75em;
font-style: italic;
line-height: 12pt;
margin: 0;
padding: 0;
}
.block_19 {
display: block;
font-size: 1.125em;
font-weight: normal;
line-height: 1.73;
page-break-after: avoid;
page-break-inside: avoid;
margin: 13pt 0;
padding: 0;
}
.calibre {
color: #231916;
display: block;
font-family: “Times New Roman”, serif;
font-size: 1em;
padding-left: 0;
padding-right: 0;
margin: 0 5pt;
}
.calibre1 {
display: block;
line-height: 1.2;
}
.calibre2 {
font-style: italic;
}
.calibre3 {
font-weight: bold;
}
.calibre4 {
font-size: 0.71429em;
line-height: 1.2;
vertical-align: super;
}
.calibre5 {
font-size: 0.75em;
line-height: 1.2;
vertical-align: super;
}
.text_ {
color: #FFF;
font-size: 1.25926em;
line-height: 1.2;
}
.text_1 {
color: #231916;
font-size: 0.88889em;
line-height: 1.2;
}
.text_2 {
color: #231916;
font-size: 0.88889em;
font-style: italic;
line-height: 1.2;
}
.text_3 {
font-size: 0.88889em;
line-height: 1.2;
}
.text_4 {
font-size: 0.88889em;
font-style: italic;
line-height: 1.2;
}
.text_5 {
color: #231916;
font-size: 0.66667em;
}
.text_6 {
color: #231916;
font-size: 0.66667em;
font-style: italic;
}
.text_7 {
font-size: 1em;
line-height: 1.2;
}
.text_8 {
font-size: 0.88889em;
font-weight: bold;
line-height: 1.2;
}
.text_9 {
font-family: “Times New Roman”, serif;
font-weight: bold;
}
.text_10 {
font-family: “微软雅黑”, sans-serif;
font-weight: bold;
}
.text_11 {
font-family: “Times New Roman”, serif;
font-size: 0.88889em;
line-height: 1.2;
}
.text_12 {
font-family: “宋体”, serif;
font-size: 0.88889em;
line-height: 1.2;
}
.text_13 {
font-family: “Times New Roman”, serif;
font-size: 0.88889em;
font-style: italic;
line-height: 1.2;
}
.text_14 {
font-size: 0.66667em;
}
.text_15 {
font-size: 0.66667em;
font-style: italic;
}
.text_16 {
font-family: “宋体”, serif;
font-weight: bold;
}
.text_17 {
font-style: italic;
vertical-align: 1pt;
}
.text_18 {
font-family: “微软雅黑”, sans-serif;
font-size: 0.88889em;
line-height: 1.2;
}
.text_19 {
color: #231916;
font-size: 0.88889em;
font-weight: bold;
line-height: 1.2;
}
.text_20 {
font-family: “宋体”, serif;
font-size: 1em;
line-height: 1.2;
}
.text_21 {
color: #231916;
font-family: “Times New Roman”, serif;
font-size: 0.88889em;
line-height: 1.2;
}
.text_22 {
font-family: “Times New Roman”, serif;
font-size: 1em;
line-height: 1.2;
}
.text_23 {
color: #231916;
font-family: “微软雅黑”, sans-serif;
font-size: 0.88889em;
line-height: 1.2;
}
.text_24 {
font-size: 0.51852em;
}
.text_25 {
font-family: “Arial”, sans-serif;
font-size: 0.88889em;
line-height: 1.2;
}
.text_26 {
font-family: “Times New Roman”, serif;
font-size: 0.88889em;
font-weight: bold;
line-height: 1.2;
}
.text_27 {
font-family: “Times New Roman”, serif;
}
.text_28 {
font-family: “微软雅黑”, sans-serif;
}
.text_29 {
font-size: 0.51852em;
vertical-align: -0.5pt;
}
.text_30 {
font-family: “Times New Roman”, serif;
font-size: 0.51852em;
}
.text_31 {
font-family: “微软雅黑”, sans-serif;
font-size: 0.51852em;
}
.text_32 {
font-family: “宋体”, serif;
font-size: 0.51852em;
}
.text_33 {
color: #231916;
font-family: “Times New Roman”, serif;
font-size: 0.88889em;
font-weight: bold;
line-height: 1.2;
}
.text_34 {
color: #231916;
font-family: “微软雅黑”, sans-serif;
font-size: 0.88889em;
font-weight: bold;
line-height: 1.2;
}
.text_35 {
font-family: “宋体”, serif;
}
.text_36 {
font-size: 0.88889em;
line-height: 1.2;
text-decoration: underline solid;
}
.text_37 {
color: #010302;
font-size: 1em;
line-height: 1.2;
}
.text_38 {
font-family: “Arial”, sans-serif;
}
.text_39 {
color: #231916;
font-family: “Arial”, sans-serif;
font-size: 0.88889em;
line-height: 1.2;
}
.text_40 {
color: #231916;
}
.text_41 {
font-family: “Times New Roman”, serif;
font-style: italic;
}
.text_42 {
color: #FFF;
font-size: 1em;
font-weight: bold;
}
.text_43 {
font-size: 1.48148em;
line-height: 1.2;
}
感谢hua大指教,解决问题了。
没有,这是我第二次作文字词典,第一次我直接就没管,导出来能看就行,很多东西都属于完全不懂的状态。
epub的原css也可以打包,保持与主文件名相同,制作成mdd文件。