https://github.com/unfoldingword-dev/uw-pdf-conversion-tools
Conversion tool for converting uW resources to PDF. Written in Python
https://github.com/unfoldingword-dev/uw-pdf-conversion-tools
Last synced: 12 months ago
JSON representation
Conversion tool for converting uW resources to PDF. Written in Python
- Host: GitHub
- URL: https://github.com/unfoldingword-dev/uw-pdf-conversion-tools
- Owner: unfoldingWord-dev
- License: mit
- Created: 2020-01-14T20:55:23.000Z (over 6 years ago)
- Default Branch: master
- Last Pushed: 2023-03-05T13:06:26.000Z (over 3 years ago)
- Last Synced: 2025-01-19T21:15:58.921Z (over 1 year ago)
- Language: Python
- Size: 58.5 MB
- Stars: 0
- Watchers: 10
- Forks: 0
- Open Issues: 4
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# uW PDF Conversion Tools
Conversion tool for converting uW resources to PDF.
NOTE: Python 3 Only
# To run
```bash
cd /opt && git clone https://github.com/unfoldingWord-dev/uw-pdf-conversion-tools.git
cd /opt/uw-pdf-conversion-tools && pip3 install -r requirements.txt
cd /opt/uw-pdf-conversion-tools
./setup_resources.sh # only needed one time, for tn_* and sn_* PDF converters
./run.sh [-hr] [-l ] [-w ] [-o ] [-p ] [--owner ] [---tag ]
```
`` can be the following:
- obs_pdf_converter
- obs_sn_pdf_converter
- obs_sn_sq_pdf_converter
- obs_sq_pdf_converter
- obs_tn_pdf_converter
- ta_pdf_converter
- tn_pdf_converter
- tn_checking
- tq_pdf_converter
- tw_pdf_converter
- tw_checking
optional arguments:
```
-h, --help show this help message and exit
-r, --regenerate Regenerate PDF even if exists: Default: false
-l LANG_CODE, --lang_code LANG_CODE
Language Code. Can specify multiple -l's. Default: en
-p PROJECT_ID, --project_id PROJECT_ID
Project ID for resources with projects, such as a
Bible book. Can specify multiple -p's. Default: all
-w WORKING_DIR, --working WORKING_DIR
Working Directory. Default: a temp directory that gets
deleted
-o OUTPUT_DIR, --output OUTPUT_DIR
Output Directory. Default:
--owner OWNER Owner of the resource repo on GitHub. Default: unfoldingWord
--offline Do not download repos and images (use local copies)
---tag For every resource used, you can specify a branch or tag.
Default: master (run `./run.sh -h` for possible tags)
```
# Examples
- Run the OBS SN PDF converter for English (default language) but don't generate if PDF already exists in the output dir:
`./run.sh obs_sn_pdf_converter -w ~/working -o ~/output`
- Run the TA PDF converter for English and French and generate even if the latest commit has a PDF file in the output dir
`./run.sh ta_pdf_converter -w ~/working -o ~/output -l en -l fr -r`
- Run the OBS TN PDF converter for English and use release versions v6 of OBS TN, v6 of OBS, v11 of TA and v11 of TW.
`./run.sh obs_tn_pdf_converter -w ~/working -o ~/output -l en --obs-tn-tag v6 --obs-tag v6 --ta-tag v11 --tw-tag v11`
# Notes
- Language being generate must have a locale file in the `./locale` directory. You can copy the `English-en_US.json` file to a new language and update the strings on the right.
(Not needed for OBS PDF)
- A index.php will be linked to in your output dir to list all of the latest versions of the resources generated