Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Make tex4ht run optional
  • Loading branch information
kthoden committed Jul 19, 2019
1 parent 4ea86ad commit 03c1a5d
Showing 1 changed file with 26 additions and 5 deletions.
31 changes: 26 additions & 5 deletions tei2imxml.py
Expand Up @@ -1223,9 +1223,20 @@ def main():
action="store_true",
help="In floats, only print number of figure, not chapter before."
)

parser.add_argument("-d", "--pickleddata", default="./output/imxml/tmp_files/data.pickle", help="Pickled data file to be used.")
parser.add_argument("-him", "--hyperimage", action="store_true")
parser.add_argument(
"-d", "--pickleddata",
default="./output/imxml/tmp_files/data.pickle",
help="Pickled data file to be used."
)
parser.add_argument(
"-him", "--hyperimage",
action="store_true"
)
parser.add_argument(
"-n", "--no-bib4ht",
action="store_true",
help="Skip creation of bibliography, rely on already present HTML files."
)
args = parser.parse_args()
config_file = args.CONFIG_FILE
print("The config file is ", config_file)
Expand Down Expand Up @@ -1279,7 +1290,13 @@ def main():
used_citekeys = get_all_citations(xml_tree)
citations_filename_root = Path(TEMP_DIR, "formatted_citations_monograph")
# citations_filename_html = make_bibliography_pandoc(used_citekeys, bib_data, citations_json, citations_filename_root, CSL_FILE)
citations_filename_html = make_bibliography_tex4ht(used_citekeys, bib_data, citations_filename_root, publication_language, TEMP_DIR, LOG_DIR)

if args.no_bib4ht:
citations_filename_html = citations_filename_root.with_suffix(".html")
logging.info("Skipping creation of HTML bibliography files. Using the existing ones.")
else:
citations_filename_html = make_bibliography_tex4ht(used_citekeys, bib_data, citations_filename_root, publication_language, TEMP_DIR, LOG_DIR)

logging.info("Formatting citations now.")
cited_dict = format_citations(used_citekeys, citations_dict, citations_filename_html)
refs_for_bib_chapter = format_reference_list(used_citekeys, citations_filename_html)
Expand All @@ -1298,7 +1315,11 @@ def main():
else:
citations_filename_root = Path(TEMP_DIR, f"formatted_citations_{chapter_id}")
# citations_filename_html_per_chapter = make_bibliography_pandoc(used_citekeys_per_chapter, bib_data, citations_json, citations_filename_root, CSL_FILE)
citations_filename_html_per_chapter = make_bibliography_tex4ht(used_citekeys_per_chapter, bib_data, citations_filename_root, publication_language, TEMP_DIR, LOG_DIR)
if args.no_bib4ht:
citations_filename_html_per_chapter = citations_filename_root.with_suffix(".html")
logging.info("Skipping creation of HTML bibliography files. Using the existing ones.")
else:
citations_filename_html_per_chapter = make_bibliography_tex4ht(used_citekeys_per_chapter, bib_data, citations_filename_root, publication_language, TEMP_DIR, LOG_DIR)

logging.info("Formatting citations now.")
cited_dict_per_chapter = format_citations(used_citekeys_per_chapter, citations_dict, citations_filename_html_per_chapter)
Expand Down

0 comments on commit 03c1a5d

Please sign in to comment.