Repository navigation
Document the nine missing console commands, and give them stable anchors - #595
karl-bullock wants to merge 2 commits into
Conversation
console.md documented ten commands. Nine more are registered and were absent: extension:enable (and its extension:disable alias), extension:bisect, schema:dump, queue:pause, queue:resume, avatars:convert-to-webp, avatars:backfill-variants, announcements:refresh and extensions:sync-abandoned. Options and behaviour come from the command classes, so queue:pause documents its connection:queue prefix and --all, avatars:backfill-variants documents --chunk and --force, and the two avatar commands note that they only touch avatars stored on the forum itself. announcements:refresh and extensions:sync-abandoned are both scheduled weekly by core, the latter with --notify, so they say that rather than implying you need to run them by hand. extension:bisect warns that it puts the forum into maintenance mode. update.md gained a short "After the Upgrade" section. Flarum 2.0 saves new avatars as WebP where 1.x saved PNG, and avatars:convert-to-webp converts the ones already there, but nothing in the admin documentation mentioned WebP at all, so nobody upgrading would know the command exists. The command headings also now carry explicit anchors. Docusaurus builds a heading id from the first text node only, and a colon starts a new one, so every command on this page collapsed to a truncated, order-dependent anchor: cache:clear was #cache, schedule:run was #schedule, and schedule:list was #schedule-1, which shifts as soon as a section is added above it. Adding the nine commands made that worse by introducing more colliding prefixes. Each heading now declares its own id, so #cache-clear and #avatars-convert-to-webp mean what they say and stay put. The visible heading text is unchanged.
Verified on a real Flarum 2.0.0-rc.8 instance that `php flarum list` does not include schema:dump. GenerateDumpCommand does call setName('schema:dump'), which is what I documented it from, but its registration is commented out in ConsoleServiceProvider with the note "Used internally to create DB dumps before major releases", so the command is unavailable to everybody.
The other eighteen commands on the page were confirmed present on that instance, with their documented options: migrate --isolated, avatars:backfill-variants --chunk (default 100) and --force, the queue argument and --all on queue:pause and queue:resume, -e/--execute on tinker, and extension:disable as an alias of extension:enable sharing its extension-id argument. schedule:list confirms both fetch commands run weekly at 0 0 * * 0, with --notify on extensions:sync-abandoned.
|
I stood up a Flarum 2.0.0-rc.8 instance and ran this page against it, rather than trusting my reading of the source. One correction, now pushed.
// Used internally to create DB dumps before major releases.
// \Flarum\Database\Console\GenerateDumpCommand::class
Everything else on the page checked out on that instance, which is the more useful half of the result:
Incidentally, |
console.mddocuments ten commands. Nine more are registered and were missing from it entirely, including two that exist specifically to help a 1.x forum finish moving to 2.0.The commands
extension:enable(aliasextension:disable)extension:bisectschema:dumpqueue:pause/queue:resumeconnection:queueprefix and--all.avatars:convert-to-webpavatars:backfill-variants@2x/@3xavatar files exist and corrects Flarum's record of them, which matters if avatar files were restored from a backup or moved between disks. Includes--chunkand--force.announcements:refreshextensions:sync-abandonedOptions and behaviour are taken from the command classes rather than guessed. Both avatar commands note that they only touch avatars stored on the forum itself and skip ones hosted elsewhere as a URL, and
avatars:convert-to-webpnotes that it skips GIFs so animated avatars stay animated.announcements:refreshandextensions:sync-abandonedare both scheduled weekly by core (the latter with--notify), so they say so rather than implying you need to run them yourself, andannouncements:refreshmentions thatflarum_announcements.disabledturns the feature and the command off together.An "After the Upgrade" section in update.md
2.0 saves newly uploaded avatars as WebP where 1.x saved PNG, and
avatars:convert-to-webpexists to convert the ones already there. WebP was not mentioned anywhere in the admin documentation, andupdate.mdwent straight from "restart your PHP process" into Troubleshooting, so nobody upgrading would learn the command exists. It is explicitly optional, since pre-upgrade avatars keep working untouched.Why the headings now carry explicit anchors
This started as a broken link of my own and turned out to be a property of the whole page.
Docusaurus derives a heading's id from its first text node, and a colon begins a new one, so every command heading on this page collapsed to a truncated anchor:
cache:clearwas#cache,schedule:runwas#schedule, andschedule:listwas#schedule-1. The numeric suffixes are positional, so they move as soon as a section is inserted above them, and adding nine commands made that considerably worse by introducing more colliding prefixes (avatars/avatars-1,extension/extension-1,queue/queue-1).Each command heading now declares its own id, so
#cache-clearand#avatars-convert-to-webpmean what they say and stop moving. The rendered heading text is unchanged, and I verified the generated ids and heading text in the build output.This does change existing anchor URLs, which is the one judgement call in here: an old link to
#cacheor#migrate-1will no longer resolve. I thought that was worth it, because those anchors are both ambiguous and positional today, andconsole.mdis a reference page people deep-link into. Happy to drop this part and keep only the new commands if you would rather not move the existing anchors.Verification
npx docusaurus build --locale encompletes with no errors, and Docusaurus's broken-anchor check reports nothing for either page (it flagged both before this change, which is how I found the anchor problem). Every command name, option, default and description was read from its class inflarum/[email protected].Two related notes, no action needed here: the
flarum/realtimecommands are deliberately left out, since #593 covers that extension's documentation as a whole. And a maintainer branch,im/avatar-webp-docs, already adds a WebP note toextend/update-2_0.mdfor extension developers; this PR touches the admin-facing pages only, so the two do not overlap.