metanorma / metanorma-docker

Docker container for running the Metanorma toolchain
https://www.metanorma.com
5 stars 3 forks source link

(URGENT) Integrate PDF setup using local Docker volume #62

Closed ronaldtse closed 3 years ago

ronaldtse commented 4 years ago

When using the new PDF functionality, the docker container will need to have fonts downloaded before running some PDF layouts or the output will not have the proper fonts (e.g. ISO flavor requires Cambria).

When using the docker container, there should be a command to setup fonts in a volume before metanorma command runs.

These 3 cases need to be supported:

  1. User chooses not to setup fonts (which takes time) and run with degraded PDF
  2. User chooses to setup fonts (the first time). Subsequent tries will re-use the docker volume.
  3. User chooses to use a local config directory e.g. ~/.metanorma when doing step 2. This allows the user to share the fonts between the metanorma installed in the local (host) system and the docker metanorma.

We can setup a docker volume to store fonts, e.g. /config/fonts. The user can map his/her own ~/.metanorma directory to /config in order not to re-download fonts too.

ronaldtse commented 4 years ago

When in the Docker environment, we can't necessarily store the fonts inside the host homedir because the docker volume may not be shared with local disk.

That's why we need to make the container's ~/.metanorma/fonts a volume and install the fonts there. If the user chooses to mount his real ~/.metanorma/fonts dir to the container's identical path, that's fine.

Otherwise, this docker mechanism will allow caching across metanorma runs.

CAMOBAP commented 4 years ago

@ronaldtse @abunashir as far as I understood this ticket blocked by https://github.com/metanorma/metanorma/issues/95 , can you confirm this?

ronaldtse commented 4 years ago

@CAMOBAP795 yes.

ronaldtse commented 3 years ago

This is relevant to #73 .

CAMOBAP commented 3 years ago

Already done