Skip to content
Permalink
master
Switch branches/tags

Name already in use

A tag already exists with the provided branch name. Many Git commands accept both tag and branch names, so creating this branch may cause unexpected behavior. Are you sure you want to create this branch?
Go to file
 
 
Cannot retrieve contributors at this time
# EOASkripts
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).
![The EOA workflow](doc/eoa_intermediate_workflow.png)
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.
# Installation
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.
## Prerequisites
- Python 3
- Docker, Docker Compose
- [git_deps_py](https://github.molgen.mpg.de/EditionOpenAccess/git_deps_py)
## Initialise the Repository
$ 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.
## Run the Docker Container
$ ./scripts/run.py
The container should now be up and running.
## Run Command in the Docker Container
$ ./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.
## Stop the Docker Container
$ ./scripts/stop.py
## Clean the Repository
$ ./scripts/exit.py
This should remove all remote repositories and resources not part of this repository.
Docker images are not deleted though.
# General Usage Information
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".
## Configuration
- 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 the `init.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
> ...
# Workflows
Compiling your documents involves following a workflow which can consist of several steps.
## The LaTeX workflow (eoatex -> pdf, django, epub)
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.
1. enter the docker container
$ ./scripts/run.py # run if not yet running
$ ./scripts/exec_in_container.py # enter container
1. 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 TEI workflow (TEI -> pdf, django, epub)
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.
1. enter the docker container
$ ./scripts/run.py # run if not yet running
$ ./scripts/exec_in_container.py # enter container
1. process tei
$ process_tei.py input/example/125_tei_part
## The DocX workflow (DocX -> TEI -> ...) (TODO: describe how)
Convert from DocX to eoaTEI, then continue with the tei workflow (adjust paths accordingly) as described above.