Page MenuHomePhabricator

Generalized stable link mechanism to both *page* and *section*
Open, Needs TriagePublic

Description

One drawback of splitting a source document into multiple pages on wikisource (see T275319#9818815) is that you have to guess the right "split" (page #, etc) in order to link to a particular section of the document.

We have permalinks for pages, and we have workarounds like <span id=....> which can give permanent IDs to sections, but what is needed is a mechanism that unites these two: a persistent reference to a specific *section* on a specific *page* which continues to work if the section is renamed or if the section is moved to a different page title.

DiscussionTools has a limited version of this, I think, which is designed to keep persistent links to topics even if the talk page moves to an /archived/... version of the page.

Wikisource wants a version that also works even if the "original" page/section ID never existed. That is, a link to "LongLegalDocument section 1.4.3" which works even if long legal document is split (or has always been split!) into separate documents based on page number or some other arbitrary criteria. Bonus points if the generated link *is human readable* and includes some section which looks like "LongLegalDocument-1.4.3" so that a human could guess/type the correct URL without having memorized some pseudorandom UUID.

This could also potentially work as a redirect, IE you could today manually maintain a page [[LongLegalDocument/1.4.3]] which contains [[#REDIRECT LongLegalDocument/page32#sec1.4.3]] and then update all of those redirects if a new page is inserted in the latest version of the document pushing section 1.4.3 to page 33. The goal of this task would be to come up with a better, more fluent, easier-to-create-and-maintain version of that basic idea: a persistent human-readable name for a section of a document which will redirect to the current title and section ID corresponding to it.

Event Timeline

Hasn't DiscussionTools already solved that for a different use case (talk page sections which might get archived)?

Yes, but the solution is specific to DT. This is an attempt to generalize that solution. I plan on chatting with the editing team next week to figure out to what extent their existing code is generalizable. My understanding is that it is pretty tightly tied to the way they look for "new comments" and do notifications; a generalized feature might need a way for an editor to manually make/fix a particular association between page and section rather than try to magically infer the correct link the way that DT does.