Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 10 additions & 8 deletions .github/fetch_includes.sh
Original file line number Diff line number Diff line change
Expand Up @@ -7,15 +7,17 @@ DICTIONARY_URL="https://raw.githubusercontent.com/nesi/nesi-wordlist/main/output
SNIPPETS_URL="https://raw.githubusercontent.com/nesi/nesi-wordlist/main/outputs/snippets.md"
ICAL_URL="https://outlook.office365.com/owa/calendar/3d4e3c7b28ca4549803470b109cba86a@reannz.co.nz/0830583db389420aaa843dc231af48d810099982634588501079/calendar.ics"

mkdir -p docs/assets/glossary
mkdir -p docs/assets/glossary overrides/partials

wget -q -O docs/assets/training_calendar.ics "${ICAL_URL}"
wget -q -O docs/assets/module-list.json "${MODULES_LIST_URL}"
wget -q -O docs/software_updates.xml "${MODULES_UPDATE_URL}"
# The module-list.json is needed by link_apps_pages.py below, so we must
# fetch that group first. Everything within each group runs in parallel.
Comment on lines +12 to +13

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

low

Ye talk of 'groups' and 'fetching first', but ye've lumped 'em all together like a pile of salt fish. I suppose accuracy in yer comments is too much to ask when ye're in such a hurry to shave off a few seconds? If ye want to be clear to the next poor soul who reads this map, ye might want to update yer scribbles to reflect that everything's happenin' at once now.

wget -q -O docs/assets/training_calendar.ics "${ICAL_URL}" &
wget -q -O docs/assets/module-list.json "${MODULES_LIST_URL}" &
wget -q -O docs/software_updates.xml "${MODULES_UPDATE_URL}" &
wget -q -O overrides/partials/glossary.html "${GLOSSARY_URL}" &
wget -q -O docs/assets/glossary/dictionary.txt "${DICTIONARY_URL}" &
wget -q -O docs/assets/glossary/snippets.md "${SNIPPETS_URL}" &
wait
Comment on lines +14 to +20

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

high

Ye've gone and tossed all yer wget commands into the background like a drunken sailor tossin' dice. While it might be faster, set -e won't catch a failure in those backgrounded tasks. If one of 'em fails to fetch a vital map—like that module-list.json ye claim to need—yer script will just sail right on into the rocks because wait only returns the exit code of the last job. But I'm sure ye knew that and just didn't think it was worth the effort to check, eh? Ye should be checkin' every single one of 'em to ensure the whole fleet is present.

Suggested change
wget -q -O docs/assets/training_calendar.ics "${ICAL_URL}" &
wget -q -O docs/assets/module-list.json "${MODULES_LIST_URL}" &
wget -q -O docs/software_updates.xml "${MODULES_UPDATE_URL}" &
wget -q -O overrides/partials/glossary.html "${GLOSSARY_URL}" &
wget -q -O docs/assets/glossary/dictionary.txt "${DICTIONARY_URL}" &
wget -q -O docs/assets/glossary/snippets.md "${SNIPPETS_URL}" &
wait
pids=()
wget -q -O docs/assets/training_calendar.ics "${ICAL_URL}" & pids+=($!)
wget -q -O docs/assets/module-list.json "${MODULES_LIST_URL}" & pids+=($!)
wget -q -O docs/software_updates.xml "${MODULES_UPDATE_URL}" & pids+=($!)
wget -q -O overrides/partials/glossary.html "${GLOSSARY_URL}" & pids+=($!)
wget -q -O docs/assets/glossary/dictionary.txt "${DICTIONARY_URL}" & pids+=($!)
wget -q -O docs/assets/glossary/snippets.md "${SNIPPETS_URL}" & pids+=($!)
for pid in "${pids[@]}"; do
wait "$pid"
done


python3 .github/workflows/link_apps_pages.py

wget -q -O overrides/partials/glossary.html "${GLOSSARY_URL}"
wget -q -O docs/assets/glossary/dictionary.txt "${DICTIONARY_URL}"
wget -q -O docs/assets/glossary/snippets.md "${SNIPPETS_URL}"

1 change: 1 addition & 0 deletions .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ env:
PYTHON_VERSION: 3.14.2
GH_TOKEN: ${{ github.token }}
NO_MKDOCS_2_WARNING: "1"
ENABLED_GIT_DATES: "true"

permissions:
contents: write
Expand Down
2 changes: 2 additions & 0 deletions mkdocs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -96,6 +96,7 @@ plugins:
- search
- open-in-new-tab
- rss:
enabled: false
categories:
- tags
- title
Expand All @@ -116,6 +117,7 @@ plugins:
tags: false # This will keep tags for the purpose of indexing, but not display on page.
- git-revision-date-localized:
enable_creation_date: false
enabled: !ENV [ENABLED_GIT_DATES, false]
- macros:
on_error_fail: true
verbose: true
Expand Down
5 changes: 4 additions & 1 deletion mkdocs_hooks.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@
If this is confusing, ask Cal to explain.
"""

import proselint as pl
import glob
from pathlib import Path
import json
Expand All @@ -21,6 +20,10 @@ def on_env(env, config, files, **kwargs):


def lint(*args, **kwargs):
# Imported lazily: proselint pulls in google-re2 and a large rule set,
# and this function is not part of the mkdocs build path.
import proselint as pl

output = {}
print("running linter")
for file in glob.iglob("docs/**/*.md", recursive=True):
Expand Down
Loading