A proposal to simplify and improve footnote markup in Wikipedia

classic Classic list List threaded Threaded
13 messages Options
Reply | Threaded
Open this post in threaded view
|

A proposal to simplify and improve footnote markup in Wikipedia

Håkon Wium Lie
In the quest to simplify and improve Wikipedia's HTML code, the turn
has come to footnotes. Here is a proposal that describes how the
number of elements needed to represent footnotes can be halved:

  http://www.princexml.com/howcome/2009/wikipedia/ref/

As far as I can tell, the proposed markup works in legacy browsers,
too.

Cheers,

-h&kon
              Håkon Wium Lie                          CTO °þe®ª
[hidden email]                  http://people.opera.com/howcome

_______________________________________________
Wikitech-l mailing list
[hidden email]
https://lists.wikimedia.org/mailman/listinfo/wikitech-l
Reply | Threaded
Open this post in threaded view
|

Re: A proposal to simplify and improve footnote markup in Wikipedia

Nikola Smolenski
Håkon Wium Lie wrote:
> In the quest to simplify and improve Wikipedia's HTML code, the turn
> has come to footnotes. Here is a proposal that describes how the
> number of elements needed to represent footnotes can be halved:
>
>   http://www.princexml.com/howcome/2009/wikipedia/ref/
>
> As far as I can tell, the proposed markup works in legacy browsers,
> too.

I like it, except adding square brackets with CSS. Uses that are the
most likely not to support CSS are exactly the uses where the brackets
are most needed.

_______________________________________________
Wikitech-l mailing list
[hidden email]
https://lists.wikimedia.org/mailman/listinfo/wikitech-l
Reply | Threaded
Open this post in threaded view
|

Re: A proposal to simplify and improve footnote markup in Wikipedia

Håkon Wium Lie
Also sprach Nikola Smolenski:

 > >   http://www.princexml.com/howcome/2009/wikipedia/ref/
 > >
 > > As far as I can tell, the proposed markup works in legacy browsers,
 > > too.
 >
 > I like it, except adding square brackets with CSS. Uses that are the
 > most likely not to support CSS are exactly the uses where the brackets
 > are most needed.

Good. I think it's ok to keep the brackets in the HTML code -- it's a
common style and we can affort the extra two characters. This is also
what the study proposes.

Cheers,

-h&kon
              Håkon Wium Lie                          CTO °þe®ª
[hidden email]                  http://people.opera.com/howcome

_______________________________________________
Wikitech-l mailing list
[hidden email]
https://lists.wikimedia.org/mailman/listinfo/wikitech-l
Reply | Threaded
Open this post in threaded view
|

Re: A proposal to simplify and improve footnote markup in Wikipedia

Aryeh Gregor
In reply to this post by Håkon Wium Lie
On Tue, Mar 31, 2009 at 5:52 AM, Håkon Wium Lie <[hidden email]> wrote:
> In the quest to simplify and improve Wikipedia's HTML code, the turn
> has come to footnotes. Here is a proposal that describes how the
> number of elements needed to represent footnotes can be halved:
>
>  http://www.princexml.com/howcome/2009/wikipedia/ref/
>
> As far as I can tell, the proposed markup works in legacy browsers,
> too.

This looks good overall.  Some comments:

1) A problem we often tend to have with this kind of thing is that
users write lots of custom CSS and JS that depends on the exact
elements used, which breaks if we change the markup.  For instance, I
find the following rules in the English Wikipedia's custom stylesheet:

sup.reference:target {
    background-color: #DEF;
}
/* stop references with groups from line-breaking */
sup.reference a {white-space: nowrap;}

<http://en.wikipedia.org/wiki/MediaWiki:Common.css>

These would break if we got rid of the <sup>, on the English Wikipedia
and possibly on tons of other wikis as well.  This makes me reluctant
to do that.

2) I notice you used "font-size: 85%; vertical-align: 35%" instead of
the CSS2.1 recommended value for sup, "font-size: 83%; vertical-align:
sup".  Is there any particular reason for this?  Specifically, one
important objective for such a change would be that line-spacing
shouldn't be changed, and I'd have to test that in various browsers to
avoid regression there.

3) Some of the changes you recommend actually aren't software issues,
but customizations by the particular wiki's sysops.  In particular,
the extra <span>s around the square brackets are specific to enwiki:

http://en.wikipedia.org/w/index.php?title=MediaWiki:Cite_reference_link&action=history

So is the <b>:

http://en.wikipedia.org/w/index.php?title=MediaWiki:Cite_references_link_one&action=history

In the default software, they don't exist.  To get rid of them, you'd
want to make a suggestion on wikien-l, the enwiki Village Pump, or a
similar forum.  wikitech-l is mostly for the developers and sysadmins,
who can't really affect what particular communities choose to do in
this sort of thing.

4) The reason we have an <a> inside a <sup> turns out to be because in
wikimarkup, you can't give custom attributes to <a>.  The markup used
for the message is wikimarkup, which simply cannot achieve your
suggested HTML output.  We'd have to move this to raw HTML to allow
it, which would mean hardcoding it into the software, since we don't
like to give sysops access to output raw HTML (to reduce the chance of
invalid markup -- they can add arbitrary JS anyway, so XSS isn't
really an issue).  This would probably annoy people, since they've
already customized it.  Or we'd have to add support for explicit <a>
to wikimarkup -- maybe a good idea, but also a bigger project.



I do like your proposed markup, and think it would be great if we
could move to simpler and more semantic markup overall, but it's not
clear to me how to best go about implementing most of it.  I've at
least removed the empty title="" attribute, in r49075.  Of the rest,
some I can't do: it's up to enwiki sysops.  And one bit (giving
attributes to the <a> element) wouldn't work at all without some
potentially significant unrelated changes.  But it would be nice if we
could move more in this direction, definitely.

_______________________________________________
Wikitech-l mailing list
[hidden email]
https://lists.wikimedia.org/mailman/listinfo/wikitech-l
Reply | Threaded
Open this post in threaded view
|

Re: A proposal to simplify and improve footnote markup in Wikipedia

Håkon Wium Lie
Also sprach Aryeh Gregor:

 > > http://www.princexml.com/howcome/2009/wikipedia/ref/

 > This looks good overall.

Thanks.

 > 1) A problem we often tend to have with this kind of thing is that
 > users write lots of custom CSS and JS that depends on the exact
 > elements used, which breaks if we change the markup.  For instance, I
 > find the following rules in the English Wikipedia's custom stylesheet:
 >
 > sup.reference:target {
 >     background-color: #DEF;
 > }
 > /* stop references with groups from line-breaking */
 > sup.reference a {white-space: nowrap;}

The selectors would have to be rewritten to match the revised markup:

  a.ref:target { background-color: #DEF }
  a.ref { white-space: nowrap }

 > <http://en.wikipedia.org/wiki/MediaWiki:Common.css>
 >
 > These would break if we got rid of the <sup>, on the English Wikipedia
 > and possibly on tons of other wikis as well.  This makes me reluctant
 > to do that.

It's easy enough to rewrite, and the worst-case scenario is a minor
stylistic change for some users. In the best case, the markup and the
style sheet are changed in sync.

 > 2) I notice you used "font-size: 85%; vertical-align: 35%" instead of
 > the CSS2.1 recommended value for sup, "font-size: 83%; vertical-align:
 > sup".  Is there any particular reason for this?  

Indeed, CSS 2.1 proposes [1]:

  sup { vertical-align: super }

However, with this value, some legacy browsers (IE6/IE7) place the
footnote call slightly higher than Wikipedia currently uses. So, the
35% value was chosen as it seems to result in "pixel-perfect"
renditions. I would be equally happy with the "super" value.

The 85% value is semi-arbitrary, I've changed it to 83% which seems to
work equally well.

[1] http://www.w3.org/TR/CSS21/sample.html

 > Specifically, one important objective for such a change would be
 > that line-spacing shouldn't be changed, and I'd have to test that
 > in various browsers to avoid regression there.

Yes.

 > 3) Some of the changes you recommend actually aren't software issues,
 > but customizations by the particular wiki's sysops.  In particular,
 > the extra <span>s around the square brackets are specific to enwiki:
 >
 > http://en.wikipedia.org/w/index.php?title=MediaWiki:Cite_reference_link&action=history
 >
 > So is the <b>:
 >
 > http://en.wikipedia.org/w/index.php?title=MediaWiki:Cite_references_link_one&action=history

Interesting. No good reasons are given. Hmm.

 > In the default software, they don't exist.  To get rid of them, you'd
 > want to make a suggestion on wikien-l, the enwiki Village Pump, or a
 > similar forum.  wikitech-l is mostly for the developers and sysadmins,
 > who can't really affect what particular communities choose to do in
 > this sort of thing.

Thanks for pointing me in the right direction.

 > 4) The reason we have an <a> inside a <sup> turns out to be because in
 > wikimarkup, you can't give custom attributes to <a>.  The markup used
 > for the message is wikimarkup, which simply cannot achieve your
 > suggested HTML output.  We'd have to move this to raw HTML to allow
 > it, which would mean hardcoding it into the software, since we don't
 > like to give sysops access to output raw HTML (to reduce the chance of
 > invalid markup -- they can add arbitrary JS anyway, so XSS isn't
 > really an issue).  This would probably annoy people, since they've
 > already customized it.  Or we'd have to add support for explicit <a>
 > to wikimarkup -- maybe a good idea, but also a bigger project.

I'm happy to be put in the "bigger project" category -- I'm here for
the long term -- centuries :-)

 > I do like your proposed markup, and think it would be great if we
 > could move to simpler and more semantic markup overall, but it's not
 > clear to me how to best go about implementing most of it.  I've at
 > least removed the empty title="" attribute, in r49075.  Of the rest,
 > some I can't do: it's up to enwiki sysops.  And one bit (giving
 > attributes to the <a> element) wouldn't work at all without some
 > potentially significant unrelated changes.  But it would be nice if we
 > could move more in this direction, definitely.

Thanks for your considered reply.

Cheers,

-h&kon
              Håkon Wium Lie                          CTO °þe®ª
[hidden email]                  http://people.opera.com/howcome

_______________________________________________
Wikitech-l mailing list
[hidden email]
https://lists.wikimedia.org/mailman/listinfo/wikitech-l
Reply | Threaded
Open this post in threaded view
|

Re: A proposal to simplify and improve footnote markup in Wikipedia

Aryeh Gregor
On Tue, Mar 31, 2009 at 12:02 PM, Håkon Wium Lie <[hidden email]> wrote:
> It's easy enough to rewrite, and the worst-case scenario is a minor
> stylistic change for some users. In the best case, the markup and the
> style sheet are changed in sync.

In theory.  The problem is organizational: the people who change the
software, the people who change the stylesheets on any particular
wiki, and the people who sync new versions of the software to the site
constitute a few hundred different groups, mostly pairwise disjoint.
There are over a thousand Wikimedia wikis last I heard, and to be sure
we didn't break anything we'd have to review all of their stylesheets
and fix them if necessary.

It would be interesting if we had a procedure for this, however.  It
should suffice to write a script to grep all the stylesheets on all
sites for appropriate rules, and ask a steward or other global sysop
to add the replacement rules before the software is synced (in
addition to the old ones, so there's no period where neither set
works).  This is more convenient now than it used to be, since we do
have a unified login and global sysops.

Now, why don't we allow <a> in wikimarkup? . . .

_______________________________________________
Wikitech-l mailing list
[hidden email]
https://lists.wikimedia.org/mailman/listinfo/wikitech-l
Reply | Threaded
Open this post in threaded view
|

Re: A proposal to simplify and improve footnote markup in Wikipedia

Platonides
Aryeh Gregor wrote:
> In theory.  The problem is organizational: the people who change the
> software, the people who change the stylesheets on any particular
> wiki, and the people who sync new versions of the software to the site
> constitute a few hundred different groups, mostly pairwise disjoint.
> There are over a thousand Wikimedia wikis last I heard, and to be sure
> we didn't break anything we'd have to review all of their stylesheets
> and fix them if necessary.

We have done other big changes in the past. Almost all
creations/renamings of mediawiki messages need local community action!

> It would be interesting if we had a procedure for this, however.  It
> should suffice to write a script to grep all the stylesheets on all
> sites for appropriate rules, and ask a steward or other global sysop
> to add the replacement rules before the software is synced (in
> addition to the old ones, so there's no period where neither set
> works).  This is more convenient now than it used to be, since we do
> have a unified login and global sysops.

> Now, why don't we allow <a> in wikimarkup? . . .

What's the problem with it? Just not being able to add class/style
attributes?
There's some code adding parameters to the wikilinks, but I find them
ugly. I'd prefer compressing spans surrounding anchor elements into the a.
Ie. <span foo="bar">[[baz]]</span> to produce <a href="baz"
foo="bar">baz</a>


_______________________________________________
Wikitech-l mailing list
[hidden email]
https://lists.wikimedia.org/mailman/listinfo/wikitech-l
Reply | Threaded
Open this post in threaded view
|

Re: A proposal to simplify and improve footnote markup in Wikipedia

Aryeh Gregor
On Thu, Apr 2, 2009 at 5:58 PM, Platonides <[hidden email]> wrote:
> We have done other big changes in the past. Almost all
> creations/renamings of mediawiki messages need local community action!

The real problem is user CSS/JS, I suspect.  People tend to copy-paste
that, and changes to document structure can break a lot of it without
any easy way to gauge the extent of the problem or fix it.

(For those more familiar with CSS/JS than with MediaWiki, I'm
referring to user subpages here, e.g.,
http://en.wikipedia.org/wiki/User:Simetrical/monobook.js.  I'm not
referring to stuff people have in their browsers, which is of course
impossible to track or fix even in principle.)

> There's some code adding parameters to the wikilinks, but I find them
> ugly. I'd prefer compressing spans surrounding anchor elements into the a.
> Ie. <span foo="bar">[[baz]]</span> to produce <a href="baz"
> foo="bar">baz</a>

Those two constructs are different.  They really are not the same and
should not be treated as such.  Treating them the same sounds like a
really bad idea to me.

_______________________________________________
Wikitech-l mailing list
[hidden email]
https://lists.wikimedia.org/mailman/listinfo/wikitech-l
Reply | Threaded
Open this post in threaded view
|

Re: A proposal to simplify and improve footnote markup in Wikipedia

Håkon Wium Lie
Also sprach Aryeh Gregor:

 > > We have done other big changes in the past. Almost all
 > > creations/renamings of mediawiki messages need local community action!
 >
 > The real problem is user CSS/JS, I suspect.  People tend to copy-paste
 > that, and changes to document structure can break a lot of it without
 > any easy way to gauge the extent of the problem or fix it.
 >
 > (For those more familiar with CSS/JS than with MediaWiki, I'm
 > referring to user subpages here, e.g.,
 > http://en.wikipedia.org/wiki/User:Simetrical/monobook.js.  I'm not
 > referring to stuff people have in their browsers, which is of course
 > impossible to track or fix even in principle.)

Right. While user CSS/JS is an interesting feature (in fact, it's a
fundamental feature in CSS), it would be a loss if it prevents the
HTML code from being improved. Wikipedia should be bold, both in the
content and in the style and structure.

Cheers,

-h&kon
              Håkon Wium Lie                          CTO °þe®ª
[hidden email]                  http://people.opera.com/howcome


_______________________________________________
Wikitech-l mailing list
[hidden email]
https://lists.wikimedia.org/mailman/listinfo/wikitech-l
Reply | Threaded
Open this post in threaded view
|

Re: A proposal to simplify and improve footnote markup in Wikipedia

Aryeh Gregor
On Thu, Apr 2, 2009 at 6:28 PM, Håkon Wium Lie <[hidden email]> wrote:
> Right. While user CSS/JS is an interesting feature (in fact, it's a
> fundamental feature in CSS), it would be a loss if it prevents the
> HTML code from being improved. Wikipedia should be bold, both in the
> content and in the style and structure.

Well, I'm okay with it.  It might be a useful project to allow <a> in
wikitext like other HTML.  I don't think it would be a big deal,
although some others have pointed out that it would need to be make
part of link updates.

_______________________________________________
Wikitech-l mailing list
[hidden email]
https://lists.wikimedia.org/mailman/listinfo/wikitech-l
Reply | Threaded
Open this post in threaded view
|

Re: A proposal to simplify and improve footnote markup in Wikipedia

David Gerard-2
In reply to this post by Håkon Wium Lie
2009/4/2 Håkon Wium Lie <[hidden email]>:
> Also sprach Aryeh Gregor:

>  > (For those more familiar with CSS/JS than with MediaWiki, I'm
>  > referring to user subpages here, e.g.,
>  > http://en.wikipedia.org/wiki/User:Simetrical/monobook.js.  I'm not
>  > referring to stuff people have in their browsers, which is of course
>  > impossible to track or fix even in principle.)

> Right. While user CSS/JS is an interesting feature (in fact, it's a
> fundamental feature in CSS), it would be a loss if it prevents the
> HTML code from being improved. Wikipedia should be bold, both in the
> content and in the style and structure.


Indeed. Wikitext is a significant backward compatibility requirement;
IE6 compatibility and text/speech browser graceful degradation is a
significant backware compatibility requirement. Random hacked-up
customisations and ricing-up that people put on their personal views
themselves are not significant backward compatibility requirements.


- d.

_______________________________________________
Wikitech-l mailing list
[hidden email]
https://lists.wikimedia.org/mailman/listinfo/wikitech-l
Reply | Threaded
Open this post in threaded view
|

Re: A proposal to simplify and improve footnote markup in Wikipedia

Platonides
In reply to this post by Aryeh Gregor
Aryeh Gregor wrote:
>> There's some code adding parameters to the wikilinks, but I find them
>> ugly. I'd prefer compressing spans surrounding anchor elements into the a.
>> Ie. <span foo="bar">[[baz]]</span> to produce <a href="baz"
>> foo="bar">baz</a>
>
> Those two constructs are different.  They really are not the same and
> should not be treated as such.  Treating them the same sounds like a
> really bad idea to me.

Why not?
The reason that a span is needed there is because there's no access to
the attributes of <a>

Allowing a, the silly spambots posting html links would begin working. :(


_______________________________________________
Wikitech-l mailing list
[hidden email]
https://lists.wikimedia.org/mailman/listinfo/wikitech-l
Reply | Threaded
Open this post in threaded view
|

Re: A proposal to simplify and improve footnote markup in Wikipedia

Aryeh Gregor
On Fri, Apr 3, 2009 at 10:11 AM, Platonides <[hidden email]> wrote:
> Why not?
> The reason that a span is needed there is because there's no access to
> the attributes of <a>

Or maybe you actually want a span.  Like, say, to provide a background
around the link or something, like

<span class="foo">[[Bar]]</span>

.foo { background: red; padding: 1em; }
.foo a { background: green; color: white; }

Or whatever.  <a><b></b></a> is not the same as <b></b>.

> Allowing a, the silly spambots posting html links would begin working. :(

Well, the edit is no more obnoxious if the link actually shows up as a
link instead of HTML gibberish.  It has to be reverted either way.

_______________________________________________
Wikitech-l mailing list
[hidden email]
https://lists.wikimedia.org/mailman/listinfo/wikitech-l