feat(website): Include local commands in generated HTML - #287
Merged
Merged
Conversation
Signed-off-by: Gerard Hickey <hickey@kinetic-compute.com>
Signed-off-by: Gerard Hickey <hickey@kinetic-compute.com>
Signed-off-by: Gerard Hickey <hickey@kinetic-compute.com>
# Conflicts: # CHANGELOG.md
The generated page is meant to list what the bot actually answers, so it has to read the config the same way the bot does. Three places where it did not: The local `config.ini` overlay was never read. `read_config` parsed only the base file, while the bot overlays `<local_dir_path>/config.ini` on top of it, and that overlay is exactly where the web viewer saves a local plugin's settings. A local command disabled from the settings page still showed up on the site. `is_command_enabled` derived the section name and the legacy `enabled` spellings by hand, duplicating `BaseCommand._derive_config_section_name` and guessing that a legacy key lives in the command's own section. Half of them do not: `[Jokes] joke_enabled` disables `Joke_Command`. It now calls `command_section_name` and `read_enabled`, which share the alias table with the runtime and the settings UI. That table was missing the same-section `[Joke_Command] joke_enabled` and `[DadJoke_Command] dadjoke_enabled` spellings, which both commands accept through their own fallback. The settings page read only the `[Jokes]` form, so a bot disabled the same-section way displayed as enabled. Also fold the duplicated local-commands-dir resolution into `resolve_local_commands_dir`, take `bot_root` as a `MinimalBot` argument instead of assigning it post-construction twice, and restore the `hidden` attribute check that `generate_samples` lost when it moved to `filter_commands`.
Owner
|
Thanks for this — both features are genuinely useful, and the local-commands support fills a real gap. I merged Merging now. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What this changes
This updates the
generate_website.pycommand with 2 features:Why
This allows more accurate list of commands for an installation.
Testing
Generated HTML locally and verified output.
Checklist
devand targetingdevmake testpassesmake lintpasses (ruff + mypy)Frontend lint passes if templates changed (npm run lint:frontend)Tests added or updated for behavior changesCHANGELOG.mdupdated under## [Unreleased]if user-visibleConfig changes are reflected inconfig.ini.example(and the minimal/quickstarttemplates where relevant) — CI validates these with
validate_config.py --strictNew docs pages are added tonav:inmkdocs.ymlAny new command justifies its airtime and defaults conservatively