Allow refs to be hidden
Closed, DeclinedPublic


Author: thomas.dalton

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).

Version: unspecified
Severity: enhancement

bzimport added a project: Cite.Via ConduitNov 21 2014, 10:22 PM
bzimport added a subscriber: Unknown Object (MLST).
bzimport set Reference to bz15724.
bzimport created this task.Via LegacySep 25 2008, 4:06 PM
bzimport added a comment.Via ConduitSep 25 2008, 4:08 PM

thomas.dalton wrote:


Attached: hiddenrefs.patch

bzimport added a comment.Via ConduitSep 25 2008, 11:58 PM

ayg wrote:

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" />

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

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.

bzimport added a comment.Via ConduitSep 26 2008, 12:01 AM

thomas.dalton wrote:

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.

bzimport added a comment.Via ConduitSep 26 2008, 12:26 AM

ayg wrote:

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).

siebrand added a comment.Via ConduitNov 3 2008, 12:08 AM

Please test and confirm this works, and has no regressions. If I get positive responses, I will commit.

Anomie added a comment.Via ConduitNov 3 2008, 1:10 AM

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.

bzimport added a comment.Via ConduitNov 3 2008, 1:25 AM

thomas.dalton wrote:

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?

Anomie added a comment.Via ConduitNov 3 2008, 1:41 AM

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.

bzimport added a comment.Via ConduitNov 3 2008, 1:47 AM

thomas.dalton wrote:

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.

Dragons_flight added a comment.Via ConduitSep 18 2009, 1:14 AM

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.

Add Comment