Skip to content

Commit

Permalink
improve dir structure, small fixes. Workflows seem to work as in README
Browse files Browse the repository at this point in the history
  • Loading branch information
EsGeh authored and EsGeh committed Dec 18, 2019
1 parent eab95cd commit dee98be
Show file tree
Hide file tree
Showing 30 changed files with 16 additions and 14 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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)

Expand Down
2 changes: 1 addition & 1 deletion src/gather_pickledata.py
Original file line number Diff line number Diff line change
Expand Up @@ -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"
)
Expand Down
2 changes: 1 addition & 1 deletion src/imxml2epub.py
Original file line number Diff line number Diff line change
Expand Up @@ -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"]
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
8 changes: 5 additions & 3 deletions src/tei2eoatex.py
Original file line number Diff line number Diff line change
Expand Up @@ -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"
)
Expand Down Expand Up @@ -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 = {
Expand Down
4 changes: 2 additions & 2 deletions src/tei2html.py
Original file line number Diff line number Diff line change
Expand Up @@ -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(
Expand Down Expand Up @@ -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}",
Expand Down
4 changes: 2 additions & 2 deletions src/tei2imxml.py
Original file line number Diff line number Diff line change
Expand Up @@ -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(
Expand All @@ -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(
Expand Down
4 changes: 2 additions & 2 deletions src/tei_add_bibl.py
Original file line number Diff line number Diff line change
Expand Up @@ -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(
Expand Down Expand Up @@ -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
)
4 changes: 2 additions & 2 deletions src/utils/bib2html.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
)
Expand All @@ -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
)

Expand Down

0 comments on commit dee98be

Please sign in to comment.