Last modified: 2011-03-13 18:06:24 UTC

Wikimedia Bugzilla is closed!

Wikimedia migrated from Bugzilla to Phabricator. Bug reports are handled in Wikimedia Phabricator.
This static website is read-only and for historical purposes. It is not possible to log in and except for displaying bug reports and their history, links might be broken. See T17724, the corresponding Phabricator task for complete and up-to-date bug report information.
Bug 15724 - Allow refs to be hidden
Allow refs to be hidden
Status: RESOLVED WONTFIX
Product: MediaWiki extensions
Classification: Unclassified
Cite (Other open bugs)
unspecified
All All
: Lowest enhancement with 3 votes (vote)
: ---
Assigned To: Nobody - You can work on this!
: patch, patch-need-review
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2008-09-25 16:06 UTC by Thomas "Tango" Dalton
Modified: 2011-03-13 18:06 UTC (History)
6 users (show)

See Also:
Web browser: ---
Mobile Platform: ---
Assignee Huggle Beta Tester: ---


Attachments
patch (2.40 KB, patch)
2008-09-25 16:08 UTC, Thomas "Tango" Dalton
Details

Description Thomas "Tango" Dalton 2008-09-25 16:06:49 UTC
A patch to add a parameter to ref tags. <ref name="foo" hidden="true">text</ref> won't appear inline and won't be linked back to, it allows the text to be defined down the bottom (the first instance of a ref can't be hidden, so the text needs to be defined at the bottom, not the top - makes it much simpler to code and I can't see why anyone would want to define it at the top). It seems other people have written code to do much the same thing, but I haven't seen any approach quite this simple (apart from the code to handle a new parameter, it's just the addition of one if statement).
Comment 1 Thomas "Tango" Dalton 2008-09-25 16:08:05 UTC
Created attachment 5363 [details]
patch
Comment 2 Aryeh Gregor (not reading bugmail, please e-mail directly) 2008-09-25 23:58:30 UTC
I don't like this syntax much.  It's both unduly general (you only want to hide things in very limited contexts, so the generality is confusing) and unduly verbose (repetitive extra 'hidden="true"' even on top of the extra <ref> tag).  A nicer syntax, which has been proposed elsewhere before, would be something like:

<ref name="a" />

<references>
<ref name="a">...contents...</ref>
</references>

This forces the references without backlinks to be defined in a nice, consistent, expected place.  It also adds no new keywords, just adapts existing ones.  There are probably other nice syntaxes too.
Comment 3 Thomas "Tango" Dalton 2008-09-26 00:01:10 UTC
Sure, that's just more difficult to code! Also, if you're doing it that way, I would use a new tag, <ref> should do the same thing everywhere, having it context dependant seems a bad idea to me.
Comment 4 Aryeh Gregor (not reading bugmail, please e-mail directly) 2008-09-26 00:26:34 UTC
A matter of taste, I guess.  I don't think it does something very different there, its behavior is only slightly altered (to not display the note).
Comment 5 Siebrand Mazeland 2008-11-03 00:08:10 UTC
Please test and confirm this works, and has no regressions. If I get positive responses, I will commit.
Comment 6 Brad Jorsch 2008-11-03 01:10:03 UTC
I have to say, I agree with Aryeh Gregor in comment #2. That syntax would make much more sense.

The patch does not actually work as advertised on my local installation; the first instance of any named ref is shown, "hidden" or not. If this is corrected, it still doesn't always hide the linkbacks from the <references/> tag and still includes refs in <references/> that are never actually displayed at all in the article.
Comment 7 Thomas "Tango" Dalton 2008-11-03 01:25:20 UTC
That's the correct behaviour and is as advertised in the first comment on this bug. The method I used makes it difficult to hide the first instance, it could be done but would make the patch significantly more complicated. I don't see why people would be hiding the first instance anyway, so I didn't bother - it makes much more sense to put the text at the bottom of the article than top. Are there times it doesn't hide linkbacks other than with the first instance? If so, could you give details? I don't see how refs could be included in <references/> without being displayed in the article since the first instance is always displayed, could you explain further?
Comment 8 Brad Jorsch 2008-11-03 01:41:11 UTC
Ok, I stand corrected. It does work as designed, it's just broken as designed. Why have a general parameter that is ignored on the "first" instance of the reference on the page? Much better to use Aryeh Gregor's syntax that doesn't have such confusion.
Comment 9 Thomas "Tango" Dalton 2008-11-03 01:47:40 UTC
As I said, I implemented it that way because it is far simpler (which reduces the chance of un-noticed bugs) and will almost never be an issue.
Comment 10 Robert Rohde 2009-09-18 01:14:35 UTC
The alternative described in comment #2 has now been implemented and is live on Wikipedia.  A community discussion (around last June) generally disfavored the creation of a "hide" syntax.  Since the now existing approach already covers most use cases, I'm closing this version as WONTFIX.

Note You need to log in before you can comment on or make changes to this bug.


Navigation
Links