Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
EPUB: divider milestone
  • Loading branch information
kthoden committed Mar 3, 2020
1 parent 97efb0f commit 0e11d13
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 1 deletion.
4 changes: 4 additions & 0 deletions src/data/epub_files/eoa-epub-libertine.css
Expand Up @@ -22,6 +22,10 @@ i > i {
padding-left: 4em;
}

.divider {
text-align: center;
}

p.centered_image {
width: 100%;
margin: 1em 20%;
Expand Down
4 changes: 4 additions & 0 deletions src/data/epub_files/eoa-epub-termes.css
Expand Up @@ -22,6 +22,10 @@ i > i {
padding-left: 4em;
}

.divider {
text-align: center;
}

p.centered_image {
width: 100%;
margin: 1em 20%;
Expand Down
8 changes: 7 additions & 1 deletion src/imxml2epub.py
@@ -1,6 +1,6 @@
#!/usr/bin/env python3
# -*- coding: utf-8; mode: python -*-
# Time-stamp: <2020-02-28 18:10:10 (kthoden)>
# Time-stamp: <2020-03-03 16:56:55 (kthoden)>

""" Convert a customized DocBook XML file into a set of files that
constitute the contents of an EPUB file.
Expand Down Expand Up @@ -754,6 +754,12 @@ def add_css_snippet(css_snippet, css_file):
logging.info("Found a paragraph.")
xmlParagraph.find("head").tag = "h5"

logging.info(f"{logseparator}Dealing with dividing milestone")
xmlParagraphs = xmlEbookTree.findall(".//p[@class='divider']")
for xmlParagraph in xmlParagraphs:
logging.info("Found a divider.")
xmlParagraph.text = "*"

logging.info(f"{logseparator}Preparing Figures")
xmlFigures = xmlEbookTree.xpath(".//EOAfigure[not(contains(@type,'hionly'))]")
logging.info("Found %s figures", len(xmlFigures))
Expand Down

0 comments on commit 0e11d13

Please sign in to comment.