dwc/build
Steve Baskauf 8b9c956400 Add link in QRG to list of terms document
Need to check that I did the relative link `list/` correctly.
2020-08-13 13:36:22 -05:00
..
README.md Minor text corrections 2020-08-13 10:14:51 +02:00
build-termlist.ipynb move list of terms build script into dwc repo and run to generate page 2020-08-12 14:40:36 -05:00
build.py Revert to using term_versions.csv for QRG build script 2020-08-13 10:08:11 +02:00
generate_term_versions.py Make changes to script that generates the term versions file 2020-08-07 15:28:43 -05:00
qrg-list.csv Make changes to script that generates the term versions file 2020-08-07 15:28:43 -05:00
requirements.txt Update requirements 2017-12-06 20:29:13 +01:00
termlist-footer.md move list of terms build script into dwc repo and run to generate page 2020-08-12 14:40:36 -05:00
termlist-header.md move list of terms build script into dwc repo and run to generate page 2020-08-12 14:40:36 -05:00
terms.tmpl Add link in QRG to list of terms document 2020-08-13 13:36:22 -05:00

README.md

Build script

The build script build.py uses as input:

And creates:

  • The quick reference guide is a Markdown file at docs/terms/index.md. The guide is build as Markdown (with a lot of included html) rather than html, so it can incorporated by Jekyll in the Darwin Core website (including a header, footer and table of content).
  • Two simple Darwin Core CSV files in dist/

Run the build script

  1. Install the required libraries (once):

    pip install -r requirements.txt
    
  2. Run the script from the command line:

    python build.py
    

Generating the "normative document"

The script generate_normative_csv.py pulls source data from the rs.tdwg.org repository. The local file qrg-list.csv contains a list of the term IRIs in the order that they are to appear in the Quick Reference Guide. This list needs to be changed whenever terms are added to or deprecated from Darwin Core.

It outputs the file term_versions.csv, which is used as the input for the build.py script above.

Generating the "list of terms" document

The Jupyter notebook build-termlist.ipynb inputs the header information from termlist-header.md, then builds the list of terms and their metadata from data in the rs.tdwg.org repository. The script also inputs termlist-footer.md and appends it to the end of the generated document, but currently it has no content. The constructed Markdown document is saved as /docs/list/index.md.

Note: when this is all working, the code can be pulled from the Jupyter notebook cells and just be saved as a .py Python script.