Skip to content
The conversion workflow scripts for creating epub and Django XML input files
Python TeX XSLT HTML Roff CSS Other
Branch: master
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
doc
scripts
src
.dockerignore
.gitignore
.init-container.sh
Dockerfile
LICENSE
README.md
dependencies.conf
docker-compose.yaml
requirements.txt

README.md

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

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

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
    
  2. eoatex -> pdf

     $ process_eoa_latex.py -f input/example/eoatex/EOASample.tex
    

    (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 DocX workflow (docx -> TEI -> pdf, django, epub) (TODO: complete documentation, test and fix workflow)

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
    
  2. eoatei -> eoatex

     $ tei2eoatex.py -f input/example/tei/exampleTEI.xml
    
  3. eoatex -> pdf

     $ eoatex2pdf.py -f output/eoatex_from_tei/main.tex -o output/pdf_from_tei
    

    (adjust filename if necessary)

  4. eoatex -> imxml (to intermediate xml)

     $ gather_pickledata.py input/example/tei/exampleTEI.xml input/example/tei/example.bib
     $ tei2imxml.py -f input/example/tei/exampleTEI.xml
    
You can’t perform that action at this time.