diff --git a/README.md b/README.md index 1631e46..2a6fba7 100644 --- a/README.md +++ b/README.md @@ -117,7 +117,7 @@ In order to apply the workflow to any other publication copy it into the `input/ 1. eoatex -> pdf - $ eoatex2pdf.py -f output/eoatex_from_tei/main.tex -o output/pdf_from_tei + $ eoatex2pdf.py -f output/from_tei/eoatex/main.tex -o output/from_tei/pdf (adjust filename if necessary) diff --git a/src/gather_pickledata.py b/src/gather_pickledata.py index 9fce492..5fbcfd0 100755 --- a/src/gather_pickledata.py +++ b/src/gather_pickledata.py @@ -62,7 +62,7 @@ def main( ) parser.add_argument( "-o", "--output-dir", - default = DEFAULT_OUTPUT_DIR / "pickle_from_tei", + default = DEFAULT_OUTPUT_DIR / "from_tei/pickle", metavar = "OUTPUT_DIR", help="output directory" ) diff --git a/src/imxml2epub.py b/src/imxml2epub.py index 82a86e6..268445c 100755 --- a/src/imxml2epub.py +++ b/src/imxml2epub.py @@ -165,7 +165,7 @@ xmlTree = etree.parse( str(INPUT_DIR / "IntermediateXMLFile.xml") ) -with open(INPUT_DIR / 'data.pickle', 'rb') as f: +with open(INPUT_DIR / 'tmp_files/data.pickle', 'rb') as f: data = pickle.load(f) dictSections = data["secdict"] diff --git a/src/utils/insert_bibliography.xsl b/src/stylesheets/insert_bibliography.xsl similarity index 100% rename from src/utils/insert_bibliography.xsl rename to src/stylesheets/insert_bibliography.xsl diff --git a/src/tei2eoatex.xsl b/src/stylesheets/tei2eoatex.xsl similarity index 100% rename from src/tei2eoatex.xsl rename to src/stylesheets/tei2eoatex.xsl diff --git a/src/tei2eoatex/eoatex_contributors.xsl b/src/stylesheets/tei2eoatex/eoatex_contributors.xsl similarity index 100% rename from src/tei2eoatex/eoatex_contributors.xsl rename to src/stylesheets/tei2eoatex/eoatex_contributors.xsl diff --git a/src/tei2eoatex/eoatex_frontmatter.xsl b/src/stylesheets/tei2eoatex/eoatex_frontmatter.xsl similarity index 100% rename from src/tei2eoatex/eoatex_frontmatter.xsl rename to src/stylesheets/tei2eoatex/eoatex_frontmatter.xsl diff --git a/src/tei2eoatex/eoatex_functions.xsl b/src/stylesheets/tei2eoatex/eoatex_functions.xsl similarity index 100% rename from src/tei2eoatex/eoatex_functions.xsl rename to src/stylesheets/tei2eoatex/eoatex_functions.xsl diff --git a/src/tei2eoatex/eoatex_persons.xsl b/src/stylesheets/tei2eoatex/eoatex_persons.xsl similarity index 100% rename from src/tei2eoatex/eoatex_persons.xsl rename to src/stylesheets/tei2eoatex/eoatex_persons.xsl diff --git a/src/tei2eoatex/eoatex_processinginstructions.xsl b/src/stylesheets/tei2eoatex/eoatex_processinginstructions.xsl similarity index 100% rename from src/tei2eoatex/eoatex_processinginstructions.xsl rename to src/stylesheets/tei2eoatex/eoatex_processinginstructions.xsl diff --git a/src/tei2eoatex/eoatex_textparts.xsl b/src/stylesheets/tei2eoatex/eoatex_textparts.xsl similarity index 100% rename from src/tei2eoatex/eoatex_textparts.xsl rename to src/stylesheets/tei2eoatex/eoatex_textparts.xsl diff --git a/src/tei2html/tei2html.xsl b/src/stylesheets/tei2html/tei2html.xsl similarity index 100% rename from src/tei2html/tei2html.xsl rename to src/stylesheets/tei2html/tei2html.xsl diff --git a/src/tei2html/tei2html_chapter.xsl b/src/stylesheets/tei2html/tei2html_chapter.xsl similarity index 100% rename from src/tei2html/tei2html_chapter.xsl rename to src/stylesheets/tei2html/tei2html_chapter.xsl diff --git a/src/tei2html/tei2html_chapter_utils.xsl b/src/stylesheets/tei2html/tei2html_chapter_utils.xsl similarity index 100% rename from src/tei2html/tei2html_chapter_utils.xsl rename to src/stylesheets/tei2html/tei2html_chapter_utils.xsl diff --git a/src/tei2html/tei2html_publ_frontpage.xsl b/src/stylesheets/tei2html/tei2html_publ_frontpage.xsl similarity index 100% rename from src/tei2html/tei2html_publ_frontpage.xsl rename to src/stylesheets/tei2html/tei2html_publ_frontpage.xsl diff --git a/src/tei2html/tei2html_publ_frontpage_utils.xsl b/src/stylesheets/tei2html/tei2html_publ_frontpage_utils.xsl similarity index 100% rename from src/tei2html/tei2html_publ_frontpage_utils.xsl rename to src/stylesheets/tei2html/tei2html_publ_frontpage_utils.xsl diff --git a/src/tei2html/utils/common.xsl b/src/stylesheets/tei2html/utils/common.xsl similarity index 100% rename from src/tei2html/utils/common.xsl rename to src/stylesheets/tei2html/utils/common.xsl diff --git a/src/tei2html/utils/html_container.xsl b/src/stylesheets/tei2html/utils/html_container.xsl similarity index 100% rename from src/tei2html/utils/html_container.xsl rename to src/stylesheets/tei2html/utils/html_container.xsl diff --git a/src/tei2html/utils/html_inline.xsl b/src/stylesheets/tei2html/utils/html_inline.xsl similarity index 100% rename from src/tei2html/utils/html_inline.xsl rename to src/stylesheets/tei2html/utils/html_inline.xsl diff --git a/src/tei2html/utils/index.xsl b/src/stylesheets/tei2html/utils/index.xsl similarity index 100% rename from src/tei2html/utils/index.xsl rename to src/stylesheets/tei2html/utils/index.xsl diff --git a/src/tei2html/utils/numbering.xsl b/src/stylesheets/tei2html/utils/numbering.xsl similarity index 100% rename from src/tei2html/utils/numbering.xsl rename to src/stylesheets/tei2html/utils/numbering.xsl diff --git a/src/tei2html/utils/print.xsl b/src/stylesheets/tei2html/utils/print.xsl similarity index 100% rename from src/tei2html/utils/print.xsl rename to src/stylesheets/tei2html/utils/print.xsl diff --git a/src/tei2html/utils/render.xsl b/src/stylesheets/tei2html/utils/render.xsl similarity index 100% rename from src/tei2html/utils/render.xsl rename to src/stylesheets/tei2html/utils/render.xsl diff --git a/src/utils/teibib_to_eoa1.xsl b/src/stylesheets/teibib_to_eoa1.xsl similarity index 100% rename from src/utils/teibib_to_eoa1.xsl rename to src/stylesheets/teibib_to_eoa1.xsl diff --git a/src/utils/tex4ht_2_tei.xsl b/src/stylesheets/tex4ht_2_tei.xsl similarity index 100% rename from src/utils/tex4ht_2_tei.xsl rename to src/stylesheets/tex4ht_2_tei.xsl diff --git a/src/tei2eoatex.py b/src/tei2eoatex.py index 80a244b..1010bc7 100755 --- a/src/tei2eoatex.py +++ b/src/tei2eoatex.py @@ -78,7 +78,7 @@ def copy_cmd(src, dst): ) parser.add_argument( "-o", "--output-dir", - default = DEFAULT_OUTPUT_DIR / "eoatex_from_tei", + default = DEFAULT_OUTPUT_DIR / "from_tei/eoatex", metavar = "OUTPUT_DIR", help="output directory" ) @@ -127,11 +127,13 @@ def copy_cmd(src, dst): else: raise( Exception( f"output directory already existing: '{OUTPUT_DIR}'!" ) ) if not OUTPUT_DIR.exists(): - os.mkdir( OUTPUT_DIR ) + OUTPUT_DIR.mkdir( + parents=True + ) run_xslt( input_file = input_file, - xslt_file = EOA_SCRIPTS_DIR / "tei2eoatex.xsl", + xslt_file = EOA_SCRIPTS_DIR / "stylesheets/tei2eoatex.xsl", output_file = output_file, params = args.param, exec_command_args = { diff --git a/src/tei2html.py b/src/tei2html.py index 5346a50..c0baf6e 100755 --- a/src/tei2html.py +++ b/src/tei2html.py @@ -104,7 +104,7 @@ def copy_dir( parser.add_argument( "-o", "--output-dir", type = Path, - default = DEFAULT_OUTPUT_DIR / "html_from_tei", + default = DEFAULT_OUTPUT_DIR / "from_tei/html", help="the main stylesheet 'tei2html.xsl' will write html files here" ) parser.add_argument( @@ -201,7 +201,7 @@ def copy_dir( run_xslt( input_file = tei_filename, - xslt_file = BASE_DIR / "tei2html" / args.xsl, + xslt_file = BASE_DIR / "stylesheets/tei2html" / args.xsl, params = [ f"output_dir={output_dir}", diff --git a/src/tei2imxml.py b/src/tei2imxml.py index 9e52b7a..101ba90 100755 --- a/src/tei2imxml.py +++ b/src/tei2imxml.py @@ -1482,7 +1482,7 @@ def main(): ) parser.add_argument( "-o", "--output-dir", - default = DEFAULT_OUTPUT_DIR / "imxml_from_tei", + default = DEFAULT_OUTPUT_DIR / "from_tei/imxml", help="output directory" ) parser.add_argument( @@ -1497,7 +1497,7 @@ def main(): ) parser.add_argument( "-d", "--pickleddata", - default= DEFAULT_OUTPUT_DIR / "pickle_from_tei" / "data.pickle", + default= DEFAULT_OUTPUT_DIR / "from_tei/pickle/data.pickle", help="Pickled data file to be used." ) parser.add_argument( diff --git a/src/tei_add_bibl.py b/src/tei_add_bibl.py index a92f42d..c0502af 100755 --- a/src/tei_add_bibl.py +++ b/src/tei_add_bibl.py @@ -134,7 +134,7 @@ def info_from_tei( ) parser.add_argument( "-o", "--output-dir", - default = DEFAULT_OUTPUT_DIR / "tei_with_bibl", + default = DEFAULT_OUTPUT_DIR / "from_tei/with_bibl", help="output directory" ) parser.add_argument( @@ -219,7 +219,7 @@ def info_from_tei( run_xslt( tei_file, - BASE_DIR / "utils/insert_bibliography.xsl", + BASE_DIR / "stylesheets/insert_bibliography.xsl", params = [ f"tei_bib_file={tei_bib_file}" ], output_file = output_dir / tei_file.name ) diff --git a/src/utils/bib2html.py b/src/utils/bib2html.py index 646bde7..d936e11 100755 --- a/src/utils/bib2html.py +++ b/src/utils/bib2html.py @@ -355,7 +355,7 @@ def __imhtml_2_tei( ): run_xslt( imhtml_file, - BASE_DIR / "utils/tex4ht_2_tei.xsl", + BASE_DIR / "stylesheets/tex4ht_2_tei.xsl", params = [ f"dashed_file={imhtml_dashed_file}" ], output_file = output_file ) @@ -366,7 +366,7 @@ def teibib_to_eoa1( ): run_xslt( tei_bibl_file, - BASE_DIR / "utils/teibib_to_eoa1.xsl", + BASE_DIR / "stylesheets/teibib_to_eoa1.xsl", output_file = output_file )