experience with blog extension

View: New views
4 Messages — Rating Filter:   Alert me  

experience with blog extension

by CW Dillon :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Juliano,
I like your approach to blogging in MW, but I'm even more curious about your
abbreviations tags, for example in the post about Mozilla Bookmarks to Wiki
(21 July 2006).  I looked at the templates and tags, but saw no extension
controlling this on your Version page.  Can you say how this is done?  I
don't like the heavy java in the ToolTips extension.  Your approach is more
like what I'm looking for.

CW
_______________________________________________
MediaWiki-l mailing list
MediaWiki-l@...
https://lists.wikimedia.org/mailman/listinfo/mediawiki-l

Re: experience with blog extension

by Juliano F. Ravasi :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Hello CW Dillon,

The magic involves changing core MediaWiki code. <abbr> and <acronym>
tags are blacklisted by default. You have to "unblacklist" them in
Sanitizer.php, and the rest is just template magic.

In Sanitizer.php, Sanitizer::removeHTMLtags() function, add 'abbr' and
'acronym' elements to the $htmlpairs array.

Then, in the same file, in Sanitizer::setupAttributeWhitelist(), find
the two "abbr" and "acronym" commented lines and replace them with:

        'abbr'       => $common,
        'acronym'    => $common,

After that, you will be allowed to use abbr and acronym tags in your
pages. Like this:

        <abbr title="eXtensible Markup Language">XML</abbr>

I used some template magic to make this less tedious. There are
templates for each abbreviation and acronym, like {{XML}}, that expands
to, for example:

        {{abbr|XML|eXtensible Markup Language}}

and {{abbr}} and {{acronym}} templates that expand to, respectively:

        <abbr title="{{{2}}}">{{{1}}}</abbr>

        <acronym title="{{{2}}}">{{{1}}}</acronym>

Regards,
Juliano.


CW Dillon wrote:
> Juliano,
> I like your approach to blogging in MW, but I'm even more curious about your
> abbreviations tags, for example in the post about Mozilla Bookmarks to Wiki
> (21 July 2006).  I looked at the templates and tags, but saw no extension
> controlling this on your Version page.  Can you say how this is done?  I
> don't like the heavy java in the ToolTips extension.  Your approach is more
> like what I'm looking for.


--
Juliano F. Ravasi ·· http://juliano.info/
5105 46CC B2B7 F0CD 5F47 E740 72CA 54F4 DF37 9E96

"A candle loses nothing by lighting another candle." -- Erin Majors

* NOTE: Don't try to reach me through this address, use "contact@" instead.

_______________________________________________
MediaWiki-l mailing list
MediaWiki-l@...
https://lists.wikimedia.org/mailman/listinfo/mediawiki-l

Re: experience with blog extension

by Daniel Barrett-3 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Alternatively (without modifying core code), you could write parser-tag extensions that implement <abbr> and <acronym>.

DanB

-----Original Message-----

The magic involves changing core MediaWiki code. <abbr> and <acronym>
tags are blacklisted by default. You have to "unblacklist" them in
Sanitizer.php, and the rest is just template magic.


_______________________________________________
MediaWiki-l mailing list
MediaWiki-l@...
https://lists.wikimedia.org/mailman/listinfo/mediawiki-l

Re: experience with blog extension

by Juliano F. Ravasi :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Daniel Barrett wrote:
> Alternatively (without modifying core code), you could write
> parser-tag extensions that implement <abbr> and <acronym>.

Yes, possible, but I wonder if the added bloat justifies. Every
extension installed adds a small performance impact upon every page
load, because extensions are included from LocalSettings.php.

In this specific case, I think that adding a configuration variable to
MediaWiki would make more sense: it is a very simple change that would
have almost no impact.

That is discussed in bug 671:
https://bugzilla.wikimedia.org/show_bug.cgi?id=671

--
Juliano F. Ravasi ·· http://juliano.info/
5105 46CC B2B7 F0CD 5F47 E740 72CA 54F4 DF37 9E96

"A candle loses nothing by lighting another candle." -- Erin Majors

* NOTE: Don't try to reach me through this address, use "contact@" instead.

_______________________________________________
MediaWiki-l mailing list
MediaWiki-l@...
https://lists.wikimedia.org/mailman/listinfo/mediawiki-l
LightInTheBox - Buy quality products at wholesale price