r-imax / imaxguide

The community maintained list of IMAX Screens
https://r-imax.github.io/imaxguide/
Creative Commons Attribution Share Alike 4.0 International
0 stars 0 forks source link

Investigate build time hook for Unit Conversion #1

Closed anthonylavado closed 2 days ago

anthonylavado commented 1 month ago

Instead of focusing on a complicated system of runtime dynamic conversion, and having to override the document template to add a conversion button, we should try a simpler solution.

We can prepare two versions of each table. One with Metric Data and the other with Imperial unit conversions. They can be placed on separate "tabs", and we can use the Linked Content Tabs feature to switch between them. This also already has an HTML 5 local storage system linked to it, which means the preference will be saved across all pages.

This means the data will likely have two copies. We'll need to figure out which unit system will likely be the best to store the "base" data in. This might vary by region, but being the film industry, it'll probably be tied to imperial measurements wherever you go. To prepare a second set of tables, we'll need a build time step that provides a converted version of the data. I don't know if this will be in GitHub Actions exclusively or not. I thought I saw an MkDocs/Material for MkDocs function that allowed a script to run (likely Python) at build time...

anthonylavado commented 1 month ago

An MKDocs pre-build hook script has been added that duplicates the base tables in Metric and converts their data to imperial ft/in measurements.

anthonylavado commented 2 days ago

This script should be enhanced to support potential failure conditions, such as units not being formatted correctly (see #2).

Will capture this as a new item.