Skip to content

Commit

Permalink
linting fixups, exclude mods collection
Browse files Browse the repository at this point in the history
changed all these unknown licenses since that was creating empty a tags htmlproofer was catching
there were plenty of other, mod specific, linting issues though, hence exlcuding it from everything
  • Loading branch information
apple1417 committed Nov 30, 2024
1 parent 7103a7d commit d0a9f46
Show file tree
Hide file tree
Showing 26 changed files with 39 additions and 68 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/jekyll.yml
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ jobs:
base_path="${{ steps.pages.outputs.base_path }}"
base_url="${{ steps.pages.outputs.base_url }}"
bundle exec htmlproofer _site --swap-urls "^$base_path/:/,^${base_url/:/\\:}/:/"
bundle exec htmlproofer _site --swap-urls "^$base_path/:/,^${base_url/:/\\:}/:/" --ignore-files "/_site\\/mods/"
- name: Upload artifact
if: github.ref == 'refs/heads/master' && github.repository == 'bl-sdk/willow2-mod-db'
Expand Down
4 changes: 4 additions & 0 deletions .typos.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
[files]
extend-exclude = [
"_mods/"
]
4 changes: 1 addition & 3 deletions _mods/BackpackManager.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,7 @@ coop_support: Unknown
dependencies: []
download: https://github.com/bl-sdk/former-default-mods/raw/master/BackpackManager/BackpackManager.zip
legacy: true
license:
name: Unknown
url: ''
license: {}
supported_games:
- BL2
- TPS
Expand Down
4 changes: 1 addition & 3 deletions _mods/BorderlandsCommander.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,7 @@ dependencies:
- UserFeedback>=1.5
download: https://github.com/mopioid/Borderlands-Commander/releases/tag/2.5
legacy: true
license:
name: Unknown
url: ''
license: {}
supported_games:
- BL2
- TPS
Expand Down
4 changes: 1 addition & 3 deletions _mods/CleaningUpPandora.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,7 @@ coop_support: Unknown
dependencies: []
download: https://github.com/Decept1x/Borderlands-Cleaning-Up-Pandora/releases/tag/1.1
legacy: true
license:
name: Unknown
url: ''
license: {}
supported_games:
- BL2
- TPS
Expand Down
4 changes: 1 addition & 3 deletions _mods/ComboCounter.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,7 @@ coop_support: Unknown
dependencies: []
download: https://github.com/Sartick/bl-sdk-mods/blob/main/ComboCounter/ComboCounter.zip
legacy: true
license:
name: Unknown
url: ''
license: {}
supported_games:
- BL2
- TPS
Expand Down
4 changes: 1 addition & 3 deletions _mods/CrossClassSkillRandomizer.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,7 @@ coop_support: Unknown
dependencies: []
download: https://github.com/bl-sdk/former-default-mods/raw/master/SkillRandomizer/SkillRandomizer.zip
legacy: true
license:
name: Unknown
url: ''
license: {}
supported_games:
- BL2
title: Cross Class Skill Randomizer
Expand Down
4 changes: 1 addition & 3 deletions _mods/CustomScopedSensitivity.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,7 @@ coop_support: Unknown
dependencies: []
download: https://github.com/Decept1x/Borderlands-Custom-Scoped-Sensitivity/releases/tag/1.0
legacy: true
license:
name: Unknown
url: ''
license: {}
supported_games:
- BL2
- TPS
Expand Down
4 changes: 1 addition & 3 deletions _mods/EasyReadOnly.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,7 @@ coop_support: Unknown
dependencies: []
download: https://github.com/bl-sdk/former-default-mods/raw/master/ReadOnly/ReadOnly.zip
legacy: true
license:
name: Unknown
url: ''
license: {}
supported_games:
- BL2
- TPS
Expand Down
4 changes: 1 addition & 3 deletions _mods/ExpAdjuster.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,7 @@ coop_support: Unknown
dependencies: []
download: https://github.com/plu5/p-borderlands/releases/latest
legacy: true
license:
name: Unknown
url: ''
license: {}
supported_games:
- BL2
title: Exp Adjuster
Expand Down
2 changes: 1 addition & 1 deletion _mods/ItemLevelUncapper.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,5 +20,5 @@ This mod is useless by itself, it should be used alongside the hexedit to increa

Fixes the level cap of most items so that they continue spawning past level 100.

Note that past level 127, items cannot be serialized corrently, and will revert to a lower level on SQ. Use [Sanity Saver](/mods/SanitySaver) to fix this.
Note that past level 127, items cannot be serialized corrently, and will revert to a lower level on SQ. Use [Sanity Saver]({{- "/mods/sanitysaver" | relative_url -}}) to fix this.
Also note that there may still be various other issues with an increased level cap, this only fixes that most items stop spawning.
4 changes: 1 addition & 3 deletions _mods/KeepAnarchy.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,7 @@ coop_support: Unknown
dependencies: []
download: https://github.com/Sampletext282/bl2-mods/blob/main/KeepAnarchy/KeepAnarchy.zip?raw=true
legacy: true
license:
name: Unknown
url: ''
license: {}
supported_games:
- BL2
title: KeepAnarchy
Expand Down
4 changes: 1 addition & 3 deletions _mods/KeyboardChange.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,7 @@ coop_support: Unknown
dependencies: []
download: https://gitlab.com/Ceiyne/borderlands-mods/-/raw/main/Keyboard%20Change/KBChange.zip?inline=false
legacy: true
license:
name: Unknown
url: ''
license: {}
supported_games:
- BL2
- TPS
Expand Down
4 changes: 1 addition & 3 deletions _mods/LiveFeed.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,7 @@ coop_support: Unknown
dependencies: []
download: https://github.com/mopioid/Borderlands-Live-Feed/releases/tag/1.2
legacy: true
license:
name: Unknown
url: ''
license: {}
supported_games:
- BL2
title: Live Feed
Expand Down
4 changes: 1 addition & 3 deletions _mods/LootRandomizer.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,7 @@ coop_support: Unknown
dependencies: []
download: https://github.com/mopioid/Borderlands-Loot-Randomizer/releases/tag/1.5.2
legacy: true
license:
name: Unknown
url: ''
license: {}
supported_games:
- BL2
- TPS
Expand Down
4 changes: 1 addition & 3 deletions _mods/MapReloader.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,7 @@ coop_support: Unknown
dependencies: []
download: https://github.com/bl-sdk/former-default-mods/raw/master/Quickload/Quickload.zip
legacy: true
license:
name: Unknown
url: ''
license: {}
supported_games:
- BL2
- TPS
Expand Down
4 changes: 1 addition & 3 deletions _mods/ReignOfGiants.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,7 @@ coop_support: Unknown
dependencies: []
download: https://github.com/mopioid/Borderlands-Reign-Of-Giants/releases/tag/1.2
legacy: true
license:
name: Unknown
url: ''
license: {}
supported_games:
- BL2
title: Reign Of Giants
Expand Down
4 changes: 1 addition & 3 deletions _mods/SavesBackuper.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,7 @@ dependencies:
- UserFeedback>=1.5
download: https://github.com/plu5/p-borderlands/releases/latest
legacy: true
license:
name: Unknown
url: ''
license: {}
supported_games:
- BL2
title: Saves Backuper
Expand Down
4 changes: 1 addition & 3 deletions _mods/SkinRandomizer.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,7 @@ coop_support: Unknown
dependencies: []
download: https://github.com/Cae-l/bl-sdk-mods/raw/master/SkinRandomizer/SkinRandomizer.zip
legacy: true
license:
name: Unknown
url: ''
license: {}
supported_games:
- BL2
title: Skin Randomizer
Expand Down
4 changes: 1 addition & 3 deletions _mods/SprintAdjuster.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,7 @@ coop_support: Unknown
dependencies: []
download: https://github.com/plu5/p-borderlands/releases/latest
legacy: true
license:
name: Unknown
url: ''
license: {}
supported_games:
- BL2
title: Sprint Adjuster
Expand Down
4 changes: 1 addition & 3 deletions _mods/SprintSetandForget.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,7 @@ coop_support: Unknown
dependencies: []
download: https://gitlab.com/Ceiyne/borderlands-mods/-/raw/main/Sprint%20Set-and-Forget/Sprint_Set-and-Forget.zip?inline=false
legacy: true
license:
name: Unknown
url: ''
license: {}
supported_games:
- BL2
- TPS
Expand Down
4 changes: 1 addition & 3 deletions _mods/TwitchLogin.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,7 @@ coop_support: Unknown
dependencies: []
download: https://github.com/mopioid/Borderlands-Twitch-Login/releases/tag/1.0
legacy: true
license:
name: Unknown
url: ''
license: {}
supported_games:
- BL2
- TPS
Expand Down
4 changes: 1 addition & 3 deletions _mods/VisualTriggers.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,7 @@ coop_support: Unknown
dependencies: []
download: https://github.com/GameChanger97/Bl2-Mods/blob/main/VisualTriggers/VisualTriggers.zip?raw=true
legacy: true
license:
name: Unknown
url: ''
license: {}
supported_games:
- BL2
title: Visual Triggers
Expand Down
15 changes: 11 additions & 4 deletions _mods/_download_legacy.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,9 @@

MOD_FOLDER = Path(__file__).parent
LEGACY_MODS_JSON_URL = "https://bl-sdk.github.io/mods.json"

YT_TAG_REGEX = re.compile(r"!\[yt\]\((.+?)\)", flags=re.I)
LOCAL_MOD_LINK_REGEX = re.compile(r"\[(.+?)\]\(/mods/(.+?)\)")


def arr_to_sentence(arr: list[str], joiner: str = "and") -> str:
Expand All @@ -23,8 +25,13 @@ def arr_to_sentence(arr: list[str], joiner: str = "and") -> str:
return ", ".join(arr[:-1]) + f", {joiner} " + arr[-1]


def replace_yt_tags(data: str) -> str:
return YT_TAG_REGEX.sub(lambda match: f"\n\n{{% youtube {match.group(1)} %}}", data)
def fixup_description(data: str) -> str:
data = YT_TAG_REGEX.sub(lambda m: f"\n\n{{% youtube {m.group(1)} %}}", data)
data = LOCAL_MOD_LINK_REGEX.sub(
lambda m: f'[{m.group(1)}]({{{{- "/mods/{m.group(2).lower()}" | relative_url -}}}})',
data,
)
return data


def convert_mod_data(mod: dict[str, Any]) -> None:
Expand All @@ -41,7 +48,7 @@ def convert_mod_data(mod: dict[str, Any]) -> None:
"url": mod["license"][1],
}
if len(mod["license"]) > 0
else {"name": "Unknown", "url": ""}
else {}
),
"dependencies": [
name + version for name, version in mod["requirements"].items()
Expand All @@ -60,7 +67,7 @@ def convert_mod_data(mod: dict[str, Any]) -> None:
"---\n"
+ yaml.dump(converted_data)
+ "---\n"
+ replace_yt_tags(mod["description"])
+ fixup_description(mod["description"])
)


Expand Down
2 changes: 1 addition & 1 deletion developing/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ Work in progress

- `mod_manager.extra_folders`

This is a list of extra mod folders, which lets you keep your development folder seperate from
This is a list of extra mod folders, which lets you keep your development folder separate from
other mods.

3. Download the latest version of debugpy, and extract to one of your mods folders such that it's
Expand Down
2 changes: 1 addition & 1 deletion index.md
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ nav_order: 1
5. The SDK should be installed now. You should see a new `MODS` option on the main menu. You can
click this to start configuring your mods.

![The mods menu](/assets/images/installation/03-mod-menu.png)
![The mods menu](https://bl-sdk.github.io/assets/images/posts/mod-install1.5.png)

6. To install SDK mods, navigate back to the `sdk_mods` folder you extracted during step 3. SDK mods
come in two forms:
Expand Down

0 comments on commit d0a9f46

Please sign in to comment.