Log in

HCMC Journal

State of the D&I (This is Not a Canon) Project:

: Deniz Aydin
Minutes: 10

The project repository is here.

Methods in src/pythonhtml/run_scripts.py, which is the main script that is exercised by the build process:

copytree():

main():

Components in the main part of the script:

converter.Converter:

format_html.FormatHTML:

generate_biblio.Biblio:

Content Copying:

Note that this script is integrated into the build process, and needs additional steps to be able to run as a standalone.

Dependencies:

Example Workflow:

run_scripts.py is called by the build process. This script makes calls to the three methods mentioned above in that order. The first call is to a converter, which has hard-coded API calls to KMLF’s two Zotero libraries, 25 Literary Works and 25 Critical Works (in src/pythonhtml/converter.py). These Zotero libraries are still under works, in that they do not both have all of their 25 entries yet. That is to be expected. This particular Python file also deals with changing the Roman-numeral page numbers into Arabic numerals for standardization. create_webpage() method calls out to a JSON-to-HTML converter which I’ve developed based on someone’s open source code. This is the crux of the code, and is also the part which makes use of the entry.html Jinja template (Information on Jinja templating engine can be found here.). The second call is to src/pythonhtml/format_html.py, which simply prettifies the individual entry HTMLs. Finally, there is a call out to src/pythonhtml/generate_biblio.py, which compiles 25 Critical Works and 25 Literary Works bibliographies from individual entry pages, using a biblio.html Jinja template.