Mailing List Archive

New wiki tags
Dear subscribers,

I want to add a new wiki-tag to my mediawiki. I thought that is quite
easy but I a too stupid for that.
The wiki Tag shoulb be like this:

I write: >>> text here <<< blabla.
The three ">>>" shall word like the tags for emphasize. Where can I add
now tags? Which files have to be edited? Can I format the text between
the ">>>" Tags?

It would be great if there would be a starting tag <div id="bla"> and an
ending Tag </div>

Can anyone give me an URL oder help me via eMail?

Thank you all,
Felix Damrau
Re: New wiki tags [ In reply to ]
On Sat, 16 Oct 2004 17:02:16 +0200, Felix Damrau <mail@felixdamrau.de> wrote:
> Dear subscribers,
>
> I want to add a new wiki-tag to my mediawiki. I thought that is quite
> easy but I a too stupid for that.

Well, I'm afraid there *is* no easy way with the current state of the
software. The file you need to "play with" is includes/Parser.php
(which is not, technically, a "parser").

> The wiki Tag shoulb be like this:
>
> I write: >>> text here <<< blabla.
> The three ">>>" shall word like the tags for emphasize. Where can I add
> now tags? Which files have to be edited? Can I format the text between
> the ">>>" Tags?
>
> It would be great if there would be a starting tag <div id="bla"> and an
> ending Tag </div>

I was wracking my brains trying to think of an example where there
isn't all sorts of special handling code in with the regular
expressions which are essentially all the "parser" consists of. And
then I came upon this function, apparently never called; create
something like this, actually call it from somewhere like
internalParse() [be careful with what gets processed before or after
it]; do plenty of testing (there's a maintenance/parserTests.php which
you can run; make sure you create an AdminSettings.php first); and Bob
may very well be your uncle...

function doExponent ( $text ) {
$fname = 'Parser::doExponent';
wfProfileIn( $fname);
$text =
preg_replace('/\^\^(.*)\^\^/','<small><sup>\\1</sup></small>', $text);
wfProfileOut( $fname);
return $text;
}

Come to think, that's not so hard after all - although I don't
guarantee it will really be as simple as that.

--
Rowan Collins BSc
[IMSoP]
Re: New wiki tags [ In reply to ]
Come again?

so you want
stuff >>>foobar<<< more stuff
to be parsed as
stuff <em>foobar</em> more stuff
?

That's allready possible using the double single quote syntax, that is:
stuff ''foobar'' more stuff

but I'm sure it's possible (though quite possibly difficult). My
sloshing through the parser didn't go well.

On Sat, 16 Oct 2004 17:02:16 +0200, Felix Damrau <mail@felixdamrau.de> wrote:
> Dear subscribers,
>
> I want to add a new wiki-tag to my mediawiki. I thought that is quite
> easy but I a too stupid for that.
> The wiki Tag shoulb be like this:
>
> I write: >>> text here <<< blabla.
> The three ">>>" shall word like the tags for emphasize. Where can I add
> now tags? Which files have to be edited? Can I format the text between
> the ">>>" Tags?
>
> It would be great if there would be a starting tag <div id="bla"> and an
> ending Tag </div>
>
> Can anyone give me an URL oder help me via eMail?
>
> Thank you all,
> Felix Damrau
> _______________________________________________
> MediaWiki-l mailing list
> MediaWiki-l@Wikimedia.org
> http://mail.wikipedia.org/mailman/listinfo/mediawiki-l
>


--
-------------------------------------------------------------------
http://endeavour.zapto.org/astro73/
Thank you to JosephM for inviting me to Gmail!
Re: New wiki tags [ In reply to ]
Rowan Collins wrote:
> On Sat, 16 Oct 2004 17:02:16 +0200, Felix Damrau <mail@felixdamrau.de> wrote:
>
>>Dear subscribers,
>>
>>I want to add a new wiki-tag to my mediawiki. I thought that is quite
>>easy but I a too stupid for that.
>
>
> Well, I'm afraid there *is* no easy way with the current state of the
> software. The file you need to "play with" is includes/Parser.php
> (which is not, technically, a "parser").
>
>
>>The wiki Tag shoulb be like this:
>>
>>I write: >>> text here <<< blabla.
>>The three ">>>" shall word like the tags for emphasize. Where can I add
>>now tags? Which files have to be edited? Can I format the text between
>>the ">>>" Tags?
>>
>>It would be great if there would be a starting tag <div id="bla"> and an
>>ending Tag </div>
>
>
> I was wracking my brains trying to think of an example where there
> isn't all sorts of special handling code in with the regular
> expressions which are essentially all the "parser" consists of. And
> then I came upon this function, apparently never called; create
> something like this, actually call it from somewhere like
> internalParse() [.be careful with what gets processed before or after
> it]; do plenty of testing (there's a maintenance/parserTests.php which
> you can run; make sure you create an AdminSettings.php first); and Bob
> may very well be your uncle...
>
> function doExponent ( $text ) {
> $fname = 'Parser::doExponent';
> wfProfileIn( $fname);
> $text =
> preg_replace('/\^\^(.*)\^\^/','<small><sup>\\1</sup></small>', $text);
> wfProfileOut( $fname);
> return $text;
> }
>
> Come to think, that's not so hard after all - although I don't
> guarantee it will really be as simple as that.

Hello,

The doExponent() function is indeed never called. It's a simple case I
added in the code just in case the community decided to use a new
^^foobar^^ syntax. At least the good point is that it provides an useful
example to add a new syntax token :o)

cheers,

--
Ashar Voultoiz - WP++++
http://en.wikipedia.org/wiki/User:Hashar