Skip to content

Conversation

@reosarevok
Copy link
Member

Fix MBS-14221

Problem

The transcluded doc pages in MB no longer include table of contents, which can be a pain especially for long ones such as [Indexed Search Syntax

Solution

The MeB wiki now defaults to a modern Vector skin that no longer includes the table of content for the page as part of the content itself (it's a separate sidebar instead). But the WikiDoc code doesn't know to search for it there, so an unexpected side effect is that all the ToCs are just gone.
This forces the use of an old skin (MonoBook) when calling render, to ensure the ToC will be returned with the content. This solves the issue for now, while avoiding a larger rewrite which would make sense if we decide to keep using WikiDoc but not if we finally move most docs to RTD/github.

Testing

Manually, by loading a doc page from my local server without the useskin parameter (no ToC), then running redis-cli flushall to drop the cache and reloading it with the parameter (ToC now appears).

The MeB wiki now defaults to a modern Vector skin that no
longer includes the table of content for the page as part
of the content itself (it's a separate sidebar instead).
But the WikiDoc code doesn't know to search for it there, so
all the ToCs are just gone.
This forces an old skin (MonoBook) when calling
render, to ensure the ToC will be returned with the content.
This solves the issue for now, while avoiding a larger rewrite
which would make sense if we decide to keep using WikiDoc
but not if we finally move most docs to RTD/github.
@reosarevok reosarevok added Bug Bugs that should be checked/fixed soonish Documentation PRs that mostly create or update documentation labels Jan 8, 2026
The test fails since the mocked URL query is missing the
`useskin` parameter, so the mock needs to be updated.

The redirect is now to `MusicBrainz API` rather than
`Development/XML_Web_Service/Version_2` as well.

Updated by changing playback to record and running:
`LWP_UA_MOCK=record LWP_UA_MOCK_FILE=t/lwp-sessions/data_wikidoc.xmlwebservice-redirect.lwp-mock prove -lv t/tests.t :: --tests Server::Data::WikiDoc`
Copy link
Member

@mwiencek mwiencek left a comment

Choose a reason for hiding this comment

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

Thanks! The test looks good locally now.

@reosarevok reosarevok merged commit 9cf95fc into metabrainz:master Jan 12, 2026
6 checks passed
@reosarevok reosarevok deleted the MBS-14221 branch January 12, 2026 19:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Bug Bugs that should be checked/fixed soonish Documentation PRs that mostly create or update documentation

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants