forked from LiveCarta/BookConverter
epub presets improves
This commit is contained in:
@@ -48,17 +48,23 @@
|
||||
{
|
||||
"tags": ["^h[6-9]$", "^figure$", "^section$", "^div$", "blockquote"],
|
||||
"condition": null,
|
||||
"tag_to_replace": "p"
|
||||
"tag_to_replace": {
|
||||
"name": "p"
|
||||
}
|
||||
},
|
||||
{
|
||||
"tags": ["^aside$"],
|
||||
"condition": null,
|
||||
"tag_to_replace": "div"
|
||||
"tag_to_replace": {
|
||||
"name": "div"
|
||||
}
|
||||
},
|
||||
{
|
||||
"tags": ["^header$", "^footer$"],
|
||||
"condition": null,
|
||||
"tag_to_replace": "span"
|
||||
"tag_to_replace": {
|
||||
"name": "span"
|
||||
}
|
||||
},
|
||||
{
|
||||
"tags": ["^code$", "^kbd$", "^var$"],
|
||||
@@ -67,22 +73,30 @@
|
||||
"child_tags": null,
|
||||
"attrs": null
|
||||
},
|
||||
"tag_to_replace": "span"
|
||||
"tag_to_replace": {
|
||||
"name": "span"
|
||||
}
|
||||
},
|
||||
{
|
||||
"tags": ["^em$"],
|
||||
"condition": null,
|
||||
"tag_to_replace": "i"
|
||||
"tag_to_replace": {
|
||||
"name": "i"
|
||||
}
|
||||
},
|
||||
{
|
||||
"tags": ["^b$"],
|
||||
"condition": null,
|
||||
"tag_to_replace": "strong"
|
||||
"tag_to_replace": {
|
||||
"name": "strong"
|
||||
}
|
||||
},
|
||||
{
|
||||
"tags": ["^image$"],
|
||||
"condition": null,
|
||||
"tag_to_replace": "img"
|
||||
"tag_to_replace": {
|
||||
"name": "img"
|
||||
}
|
||||
}
|
||||
]
|
||||
},
|
||||
@@ -90,12 +104,14 @@
|
||||
"preset_name": "attr_replacer",
|
||||
"rules": [
|
||||
{
|
||||
"attr": {
|
||||
"name": "xlink:href",
|
||||
"value": ".*"
|
||||
},
|
||||
"tags": ["^img$"],
|
||||
"condition": {
|
||||
"tags": ["^img$"]
|
||||
"attrs": [
|
||||
{
|
||||
"name": "xlink:href",
|
||||
"value": ".*"
|
||||
}
|
||||
]
|
||||
},
|
||||
"attr_to_replace": {
|
||||
"name": "src",
|
||||
@@ -140,12 +156,18 @@
|
||||
"child_tags": ":not(:has(code, kbd, var))",
|
||||
"attrs": null
|
||||
},
|
||||
"tag_to_insert": "code"
|
||||
"tag_to_insert": {
|
||||
"name": "code",
|
||||
"attrs": []
|
||||
}
|
||||
},
|
||||
{
|
||||
"tags": ["^h[1-5]$"],
|
||||
"condition": null,
|
||||
"tag_to_insert": "strong"
|
||||
"tag_to_insert": {
|
||||
"name":"strong",
|
||||
"attrs": []
|
||||
}
|
||||
}
|
||||
]
|
||||
}
|
||||
|
||||
@@ -43,7 +43,7 @@ class EpubBook(BookSolver):
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
epub_file_path = "../../books/epub/9780763774134.epub"
|
||||
epub_file_path = "../../books/epub/9781634259804.epub"
|
||||
logger_object = BookLogger(
|
||||
name="epub", book_id=epub_file_path.split("/")[-1])
|
||||
|
||||
|
||||
Reference in New Issue
Block a user