diff --git a/.github/workflows/validate-index_html.yml b/.github/workflows/validate-site-sources.yml similarity index 74% rename from .github/workflows/validate-index_html.yml rename to .github/workflows/validate-site-sources.yml index 5e8cbb9631..9e83c00770 100644 --- a/.github/workflows/validate-index_html.yml +++ b/.github/workflows/validate-site-sources.yml @@ -1,4 +1,4 @@ -name: Validate index_html +name: Validate site sources on: push: @@ -7,8 +7,8 @@ on: branches: [ master ] jobs: - validate_index_html: - name: Validate index html + validate_site_sources: + name: Validate site sources runs-on: ubuntu-latest permissions: contents: read @@ -17,13 +17,13 @@ jobs: - name: Checkout code uses: actions/checkout@v3 - - name: Validate HTML generation + - name: Validate site sources generation run: | node scripts/generate_sources.js - name: Assert git diff run: | if [[ `git status --porcelain` ]]; then - echo "Differences found after (re)generation of the index.html" - echo "Please refer to the README in order to learn how to generate the index.html properly." + echo "Differences found after (re)generation of the site sources" + echo "Please refer to the README in order to learn how to generate the site's sources properly." exit -1 fi diff --git a/README.md b/README.md index d8313d47db..2c6255c407 100755 --- a/README.md +++ b/README.md @@ -118,12 +118,39 @@ Finally, to get your sheet to appear, in `source_index.html`, add your new categ Make sure the name starts with `div_sheet_`, and match the postfix with the name of your json, in this case `body_robot`. At this point, you will need to run a script that will generate the final `index.html`. -In order to do that, run `node scripts/generate_sources.js` from the root folder. +In order to do that, run: + +`node scripts/generate_sources.js` + This will generate the `index.html` from the `source_index.html`. In case you want to push your changes, be sure to run this script and never change the `index.html` manually. The CI will reject any PR's that contain manual changes made on the `index.html`. +#### z-positions + +In order to facilitate easier management of the z-positions of the assets in this repo, there is a [script](/scripts/zPositioning/parse_zpos.js) that traverses all JSON files and write's the layer's z-position to a CSV. + +To run this script, use: + +`node scripts/zPositioning/parse_zpos.js` + +This [CSV file](/scripts/zPositioning/z_positions.csv) will be regenerated each time one invokes: + +`node scripts/generate_sources.js` + +Therefore, before creating a PR, make sure you have committed the CSV to the repo as well. + +Using this CSV, one can more clearly see the overview of all the z-position used per asset's layer. + +Moreover, one can adjust the z-position from within the CSV, and then run: + +`node scripts/zPositioning/update_zpos.js` + +In order to reflect the changes made back into the JSON files. + +**Concluding, please remember that the JSON files will always contain the source of truth with regard to the z-position an asset will be rendered at. The CSV is there to give an overview of the z-positions in use, and provides a mean to easily alter them from a single file.** + ### Run To run this project, just clone the repo and open `index.html` in your browser of choice. diff --git a/index.html b/index.html index 2830776837..eeb47bb7dc 100644 --- a/index.html +++ b/index.html @@ -10203,199 +10203,199 @@

Head