== Problem statement ==
IfWhen several references cite different passages from the same book, you need to createeach will include a full, separateredundant citations. This lengthens the wikitext, and crowds the reference section. In print, this can be avoided with footnotes like "Ibid., page 29" and other convenand crowds the reference sections.
Note that there are multiple styles for these redundant citationsIn print, there are multiple conventions for avoiding this, for example footnotes which read "Ibid., page 29" to cite a page from the most recent full reference, or "Seuss, p. 29" if the author's name unambiguously identifies a previous reference. We will notNote that there are multiple styles for these redundant citations, and we won't be able to find a solution which allows for allsupports all the different styles.
For more background, see the German technical wishes page for this feature request: (de) https://de.wikipedia.org/wiki/Wikipedia:Technische_W%C3%BCnsche/Topw%C3%BCnsche/Erweiterung_der_Einzelnachweise
== Proposed solution ==
We will introduce a new `<ref>` attribute named `refines` (please bikeshed naming here: T171581), which is similar to `name` in that one reference can link to another. When using `refines`, the sub-reference will appear indented under the main reference, and its footnote marker will include a derivative number like "2.1". With `refines`, the reference can include additional information such as a page number, whereas a reference using `name` is a wholesale repetition of another footnote.
Example usage:
```
This statement is from a popular children's book.<ref name="seuss">{{Cite book|author=Dr. Seuss|title=Horton Hears a Who}}</ref>
Later, I'll make another point sourced from the same book.<ref refines="seuss">pp. 10-12</ref>
```
Example rendering:
{F30483559}
== Alternatives ==
* There is a template {{[[ https://en.wikipedia.org/wiki/Template:Rp | Rp ]]}} or {{Refpage}} in light usage (approximately 1 in every 300 articles), which allows a minor annotation after reusing a reference, looking something like this: "[1]:23" to refer to page 23 of reference [1]. The maintainer has [[ https://en.wikipedia.org/wiki/Wikipedia:Village_pump_(technical)/Archive_165#Potential_replacement_for_Template:Rp | suggested ]] that the template would be deprecated by our solution proposed here.
* Structured references and bibliographical information in Wikidata, see [[ https://www.wikidata.org/wiki/Wikidata:WikiProject_Source_MetaData | WikiProject Source MetaData ]] and {{[[ https://en.wikipedia.org/wiki/Template:Cite_Q | cite q]]}}
== Implementation notes ==
Most or all of the work will be done in the `Extension:Cite` codebase, we don't expect to make MediaWiki core or parser changes. These are the main implementation points:
* {T151301}
* Render book-references when reading articles.
* {T151308}
=== Undeployment ===
Since we're suggesting a wikitext change, it's important to handle the potential rollback scenario. There are a few precautions we can take:
* When the `refines` attribute is first introduced, the supporting patch might have no effect on rendering.
* Rendering sub-references will be deployed as its own patch, and enabled with a feature flag. When this flag is disabled, rendering will revert to the status quo.
* We might suggest that the first usages continue to duplicate the "main" reference's content, so that the sub-reference is still readable even if the rendering has to be rolled-back. This will probably not be used by editors, so the whole
* When the `refines` attribute is used on a page, we will add a page property which makes it possible to identify all pages where the attribute has been used. This will help us track any potential cleanup work as it becomes necessary. After our feature has stabilized and there's no more chance of a rollback, we can remove the page property.
* We might suggest that the first usages continue to duplicate the "main" reference's content, so that the sub-reference is still readable even if the rendering has to be rolled-back. This is voluntary and will be unattractive to editors, so probably not a viable approach.
=== Performance ===
There is no expected impact on performance.