Tag extensions in Block mode

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

Tag extensions in Block mode

Moritz Schubotz-2
Hi,

how can I figure out in a tag extension callback e.g.

function wfSampleRender( $input, array $args, Parser $parser, PPFrame $frame )

if the parser is inside a block mode or not?
With block mode I mean something like
:<mytag></mytag>
or
#<mytag></mytag>
or

<mytag></mytag>

but not
blindtext <mytag></mytag> more text

If there is an extension that uses ways to dermine the "block" a link
would help a lot.

Best regards
physikerwelt

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

Re: Tag extensions in Block mode

Brian Wolff
On 2013-04-28 6:01 AM, "Moritz Schubotz" <[hidden email]> wrote:
>
> Hi,
>
> how can I figure out in a tag extension callback e.g.
>
> function wfSampleRender( $input, array $args, Parser $parser, PPFrame
$frame )

>
> if the parser is inside a block mode or not?
> With block mode I mean something like
> :<mytag></mytag>
> or
> #<mytag></mytag>
> or
>
> <mytag></mytag>
>
> but not
> blindtext <mytag></mytag> more text
>
> If there is an extension that uses ways to dermine the "block" a link
> would help a lot.
>
> Best regards
> physikerwelt
>
> _______________________________________________
> Wikitech-l mailing list
> [hidden email]
> https://lists.wikimedia.org/mailman/listinfo/wikitech-l

What are you trying to do that requires that knowledge?  Off the top of my
head (so could be wrong) block level-ness is determined entirely after
parser tags are replaced.

If you are woried about doBlockLevels messing up the output of your
extension, you can return an array with certain structure to tell the
parser to protect your output from doBlockLevels messing with it. (Which is
for example how <nowiki> is implemented internally I believe)

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

Re: Tag extensions in Block mode

Moritz Schubotz-2
Hi bawolff,

I'm trying the following. Looking for example at
http://math-test.instance-proxy.wmflabs.org/wiki/Summation

The equations denoted with \n:<math e.g.
:<math>\sum_a^b</math>
should be rendered in displaystyle, whereas inline equations e.g.
Let <math>\sum_i 2^{-i}</math> should be rendered normal.

Best
Moritz

On Sun, Apr 28, 2013 at 8:32 PM, Brian Wolff <[hidden email]> wrote:

> On 2013-04-28 6:01 AM, "Moritz Schubotz" <[hidden email]> wrote:
>>
>> Hi,
>>
>> how can I figure out in a tag extension callback e.g.
>>
>> function wfSampleRender( $input, array $args, Parser $parser, PPFrame
> $frame )
>>
>> if the parser is inside a block mode or not?
>> With block mode I mean something like
>> :<mytag></mytag>
>> or
>> #<mytag></mytag>
>> or
>>
>> <mytag></mytag>
>>
>> but not
>> blindtext <mytag></mytag> more text
>>
>> If there is an extension that uses ways to dermine the "block" a link
>> would help a lot.
>>
>> Best regards
>> physikerwelt
>>
>> _______________________________________________
>> Wikitech-l mailing list
>> [hidden email]
>> https://lists.wikimedia.org/mailman/listinfo/wikitech-l
>
> What are you trying to do that requires that knowledge?  Off the top of my
> head (so could be wrong) block level-ness is determined entirely after
> parser tags are replaced.
>
> If you are woried about doBlockLevels messing up the output of your
> extension, you can return an array with certain structure to tell the
> parser to protect your output from doBlockLevels messing with it. (Which is
> for example how <nowiki> is implemented internally I believe)
>
> -bawolff
> _______________________________________________
> Wikitech-l mailing list
> [hidden email]
> https://lists.wikimedia.org/mailman/listinfo/wikitech-l



--
Mit freundlichen Grüßen
Moritz Schubotz

  Telefon (Büro):  +49 30 314 22784
  Telefon (Privat):+49 30 488 27330
  E-Mail: [hidden email]
  Web: http://www.physikerwelt.de
  Skype: Schubi87
  ICQ: 200302764
  Msn: [hidden email]

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

Re: Tag extensions in Block mode

Brian Wolff
Hmm. I don't think that is really possible. You may have to simply do <math
mode="block"> and <math mode="inline"> instead.

-bawolff
On 2013-05-01 4:15 AM, "Moritz Schubotz" <[hidden email]> wrote:

>
> Hi bawolff,
>
> I'm trying the following. Looking for example at
> http://math-test.instance-proxy.wmflabs.org/wiki/Summation
>
> The equations denoted with \n:<math e.g.
> :<math>\sum_a^b</math>
> should be rendered in displaystyle, whereas inline equations e.g.
> Let <math>\sum_i 2^{-i}</math> should be rendered normal.
>
> Best
> Moritz
>
> On Sun, Apr 28, 2013 at 8:32 PM, Brian Wolff <[hidden email]> wrote:
> > On 2013-04-28 6:01 AM, "Moritz Schubotz" <[hidden email]> wrote:
> >>
> >> Hi,
> >>
> >> how can I figure out in a tag extension callback e.g.
> >>
> >> function wfSampleRender( $input, array $args, Parser $parser, PPFrame
> > $frame )
> >>
> >> if the parser is inside a block mode or not?
> >> With block mode I mean something like
> >> :<mytag></mytag>
> >> or
> >> #<mytag></mytag>
> >> or
> >>
> >> <mytag></mytag>
> >>
> >> but not
> >> blindtext <mytag></mytag> more text
> >>
> >> If there is an extension that uses ways to dermine the "block" a link
> >> would help a lot.
> >>
> >> Best regards
> >> physikerwelt
> >>
> >> _______________________________________________
> >> Wikitech-l mailing list
> >> [hidden email]
> >> https://lists.wikimedia.org/mailman/listinfo/wikitech-l
> >
> > What are you trying to do that requires that knowledge?  Off the top of
my
> > head (so could be wrong) block level-ness is determined entirely after
> > parser tags are replaced.
> >
> > If you are woried about doBlockLevels messing up the output of your
> > extension, you can return an array with certain structure to tell the
> > parser to protect your output from doBlockLevels messing with it.
(Which is

> > for example how <nowiki> is implemented internally I believe)
> >
> > -bawolff
> > _______________________________________________
> > Wikitech-l mailing list
> > [hidden email]
> > https://lists.wikimedia.org/mailman/listinfo/wikitech-l
>
>
>
> --
> Mit freundlichen Grüßen
> Moritz Schubotz
>
>   Telefon (Büro):  +49 30 314 22784
>   Telefon (Privat):+49 30 488 27330
>   E-Mail: [hidden email]
>   Web: http://www.physikerwelt.de
>   Skype: Schubi87
>   ICQ: 200302764
>   Msn: [hidden email]
>
> _______________________________________________
> Wikitech-l mailing list
> [hidden email]
> https://lists.wikimedia.org/mailman/listinfo/wikitech-l
_______________________________________________
Wikitech-l mailing list
[hidden email]
https://lists.wikimedia.org/mailman/listinfo/wikitech-l
Reply | Threaded
Open this post in threaded view
|

Re: Tag extensions in Block mode

Moritz Schubotz-2
The problem is that there are thousands of pages that use :<math/>
without block mode.

Best
Moritz

On Wed, May 1, 2013 at 12:44 PM, Brian Wolff <[hidden email]> wrote:

> Hmm. I don't think that is really possible. You may have to simply do <math
> mode="block"> and <math mode="inline"> instead.
>
> -bawolff
> On 2013-05-01 4:15 AM, "Moritz Schubotz" <[hidden email]> wrote:
>>
>> Hi bawolff,
>>
>> I'm trying the following. Looking for example at
>> http://math-test.instance-proxy.wmflabs.org/wiki/Summation
>>
>> The equations denoted with \n:<math e.g.
>> :<math>\sum_a^b</math>
>> should be rendered in displaystyle, whereas inline equations e.g.
>> Let <math>\sum_i 2^{-i}</math> should be rendered normal.
>>
>> Best
>> Moritz
>>
>> On Sun, Apr 28, 2013 at 8:32 PM, Brian Wolff <[hidden email]> wrote:
>> > On 2013-04-28 6:01 AM, "Moritz Schubotz" <[hidden email]> wrote:
>> >>
>> >> Hi,
>> >>
>> >> how can I figure out in a tag extension callback e.g.
>> >>
>> >> function wfSampleRender( $input, array $args, Parser $parser, PPFrame
>> > $frame )
>> >>
>> >> if the parser is inside a block mode or not?
>> >> With block mode I mean something like
>> >> :<mytag></mytag>
>> >> or
>> >> #<mytag></mytag>
>> >> or
>> >>
>> >> <mytag></mytag>
>> >>
>> >> but not
>> >> blindtext <mytag></mytag> more text
>> >>
>> >> If there is an extension that uses ways to dermine the "block" a link
>> >> would help a lot.
>> >>
>> >> Best regards
>> >> physikerwelt
>> >>
>> >> _______________________________________________
>> >> Wikitech-l mailing list
>> >> [hidden email]
>> >> https://lists.wikimedia.org/mailman/listinfo/wikitech-l
>> >
>> > What are you trying to do that requires that knowledge?  Off the top of
> my
>> > head (so could be wrong) block level-ness is determined entirely after
>> > parser tags are replaced.
>> >
>> > If you are woried about doBlockLevels messing up the output of your
>> > extension, you can return an array with certain structure to tell the
>> > parser to protect your output from doBlockLevels messing with it.
> (Which is
>> > for example how <nowiki> is implemented internally I believe)
>> >
>> > -bawolff
>> > _______________________________________________
>> > Wikitech-l mailing list
>> > [hidden email]
>> > https://lists.wikimedia.org/mailman/listinfo/wikitech-l
>>
>>
>>
>> --
>> Mit freundlichen Grüßen
>> Moritz Schubotz
>>
>>   Telefon (Büro):  +49 30 314 22784
>>   Telefon (Privat):+49 30 488 27330
>>   E-Mail: [hidden email]
>>   Web: http://www.physikerwelt.de
>>   Skype: Schubi87
>>   ICQ: 200302764
>>   Msn: [hidden email]
>>
>> _______________________________________________
>> Wikitech-l mailing list
>> [hidden email]
>> https://lists.wikimedia.org/mailman/listinfo/wikitech-l
> _______________________________________________
> Wikitech-l mailing list
> [hidden email]
> https://lists.wikimedia.org/mailman/listinfo/wikitech-l



--
Mit freundlichen Grüßen
Moritz Schubotz

  Telefon (Büro):  +49 30 314 22784
  Telefon (Privat):+49 30 488 27330
  E-Mail: [hidden email]
  Web: http://www.physikerwelt.de
  Skype: Schubi87
  ICQ: 200302764
  Msn: [hidden email]

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