This is a set of scripts which forms the central part of the conversion workflow in the Edition Open Access.
We currently accept and support manuscripts in two different formats: LaTeX and DocX (as used in Microsoft Word).
This repository consists of a set of (mostly python-) scripts. There are basically 2 workflows: one starts with a publication in (eoa-)TEI, the other with (eoa-)latex.
In order to provide a consistent environment we are using docker. A set of python scripts is used for automatisation. Installing and running the project without Docker or the scripts is possible, but not recommended. In this case you are on your own.
- Python 3
- Docker, Docker Compose
- git_deps_py
$ git_deps_py
$ ./scripts/init.py [--build]
This will pull remote repositories and resources, initialize the database, etc.
Force recreating the docker image by adding --build
e.g. if Dockerfile
or requirements.txt
has changed.
$ ./scripts/run.py
The container should now be up and running.
$ ./scripts/exec_in_container.py [-- CMD ...]
Follow your workflow by running the appropriate scripts to compile your publications (see chapter 'Workflow'). Inside the container you have a well defined environment with all necessary evil dependencies available. Don't forget to stop the container when you are done.
$ ./scripts/stop.py
$ ./scripts/exit.py
This should remove all remote repositories and resources not part of this repository. Docker images are not deleted though.
The runtime/input
directory is for unprocessed publications as you might have received them from authors or editors.
The runtime/output
directory is for processed publications and intermediate data.
When entering the docker container conversion scripts are in your $PATH, and can executed like any other executable.
In your HOME
directory you'll find input
and output
directories, which are docker volumes mirroring the directories in runtime/
outside of the container.
In order to compile a publication, just copy them into runtime/input
, enter the docker container, and call the necessary scripts.
For an example, see chapter "Workflows".
-
Environment variables: see file
.env
These variables are available inside the
docker-compose.yaml
file and are also loaded into the python scripts. The file is created with default settings by theinit.py
script. You can also load.env
into your bash terminal, by "sourcing" it:$ source .env
Now the variables (e.g.
INPUT_DIR
,OUTPUT_DIR
) should be defined in your terminal session:$ echo $INPUT_DIR > ...
Compiling your documents involves following a workflow which can consist of several steps.
The following description uses the example publication in runtime/input/example
(copied from the eoa-publication-model
repository).
In order to apply the workflow to any other publication copy it into the runtime/input/
directory and adjust paths in the description accordingly.
-
enter the docker container
$ ./scripts/run.py # run if not yet running $ ./scripts/exec_in_container.py # enter container
-
process eoatex:
$ process_eoa_latex.py input/example/124_eoatex
(adjust filename if necessary)
This script calls several other scripts to compile the input into several different output formats. Every script can be run seperately if needed. Just check the contents of the script for details.
The following description uses the example publication in input/example
(from the eoa-publication-model
repository).
In order to apply the workflow to any other publication copy it into the input/
directory and adjust paths in the description accordingly.
-
enter the docker container
$ ./scripts/run.py # run if not yet running $ ./scripts/exec_in_container.py # enter container
-
process tei
$ process_tei.py input/example/125_tei_part
Convert from DocX to eoaTEI, then continue with the tei workflow (adjust paths accordingly) as described above.