Generate a licenseDB static website and dump license data at ``build_location`` given a license directory ``licenses_data_dir`` using templates from ``template_dir``. ``test`` is to generate a stable output for testing only
(
doc_location,
template_dir=TEMPLATES_DIR,
)
| 26 | |
| 27 | |
| 28 | def regenerate( |
| 29 | doc_location, |
| 30 | template_dir=TEMPLATES_DIR, |
| 31 | ): |
| 32 | """ |
| 33 | Generate a licenseDB static website and dump license data at |
| 34 | ``build_location`` given a license directory ``licenses_data_dir`` using |
| 35 | templates from ``template_dir``. ``test`` is to generate a stable output for |
| 36 | testing only |
| 37 | """ |
| 38 | environment = Environment( |
| 39 | loader=FileSystemLoader(template_dir), |
| 40 | autoescape=True, |
| 41 | ) |
| 42 | doc_path = pathlib.Path(doc_location) |
| 43 | |
| 44 | all_available_packages = get_available_package_parsers(docs=True) |
| 45 | |
| 46 | license_list_template = environment.get_template("available_package_parsers.rst") |
| 47 | packages_doc = license_list_template.render( |
| 48 | all_available_packages=all_available_packages, |
| 49 | ) |
| 50 | write_file(file_path=doc_path, content=packages_doc) |
| 51 | |
| 52 | |
| 53 |
no test coverage detected