Re: Issue with NumberedHeadings

Brian Wolff <[email protected]>
Newsgroups gmane.org.wikimedia.mediawiki
Message-ID <CA+oo+DX+j-mLxm-KQ_iSvQ54BmEY1=09ReuqnZxANtiegaJh8Q@mail.gmail.com>
I think you just have a typo in the magic word name. You have
MAG_MAGICNUMBEREDHEADINGS in one place and MAG_NUMBEREDHEADINGS in the
other.

--
Brian


On Sun, Sep 11, 2022 at 10:05 PM Zoran Dori <[email protected]> wrote:

> No problem, thank you for updating it.
>
> I've applied your suggestions, but I'm still not having luck with making
> it work.
>
> Best regards!
>
> пон, 12. сеп 2022. у 00:00 Brian Wolff <[email protected]> је написао/ла:
>
>> Sorry, some of the docs were a bit outdated too. They should be fixed now.
>>
>> I think what's going on with your code, is for the $parser->getOutput()->
>> getPageProperty( 'MAGICNUMBEREDHEADINGS' ), you need the magic word id
>> (MAG_NUMBEREDHEADINGS) not the text of the magic word.
>>
>> Also, you don't need onGetMagicVariableIDs, as its not a variable
>> (Variables are basically just parser functions that don't have args, like
>> {{CURRENTHOUR}} ).
>>
>> --
>> Brian
>>
>>
>> On Sun, Sep 11, 2022 at 9:40 PM Zoran Dori <[email protected]>
>> wrote:
>>
>>> I've tweaked the code a bit, but it's still not working. I'm hoping that
>>> we are now near making it work.
>>>
>>> Best regards!
>>>
>>> нед, 11. сеп 2022. у 23:13 Zoran Dori <[email protected]> је
>>> написао/ла:
>>>
>>>> Thank you Brian for another response. :)
>>>>
>>>> I tried to follow the guide which you provided me, but IDE is telling
>>>> me that mMagicExtensions field is deprecated since 1.35.
>>>>
>>>> Best regards!
>>>>
>>>> нед, 11. сеп 2022. у 23:06 Brian Wolff <[email protected]> је
>>>> написао/ла:
>>>>
>>>>> It looks like you're using the old way of doing magic words, which
>>>>> stopped working in 1.19.
>>>>>
>>>>> See
>>>>> https://www.mediawiki.org/wiki/Manual:Magic_words#Behavior_switches_(double_underscore_magic_words)
>>>>> for the new way of doing this.
>>>>>
>>>>> Second of all, you should not use OutputPage inside the parser (you
>>>>> need to use ParserOutput). Otherwise, the results will only work on
>>>>> non-cached pages. Instead of $out->addModule, use
>>>>> $parser->getOutput()->addModules()
>>>>>
>>>>> It is also possible that the javascript might load before the page
>>>>> loads, so it should probably be inside a onDOMContentLoaded callback (E.g.
>>>>> the $() operator). Alternatively the CSS could just be changed to do for
>>>>> both the ToC and non-TOC case and then the JS wouldn't be necessary, and
>>>>> not using JS would make things show up instantly instead of having a short
>>>>> flash where things weren't numbered (Assuming that addModuleStyles was used
>>>>> instead of addModules()) .
>>>>> --
>>>>> Brian
>>>>>
>>>>>
>>>>> On Sun, Sep 11, 2022 at 8:36 PM Zoran Dori <[email protected]>
>>>>> wrote:
>>>>>
>>>>>> Hello,
>>>>>> I'm trying to make
>>>>>> https://www.mediawiki.org/wiki/Extension:MagicNumberedHeadings
>>>>>> working, having in mind that Parser method setNumberHeadings is removed
>>>>>> from MediaWiki.
>>>>>>
>>>>>> This is my code so far https://github.com/kizule/NumberedHeadings,
>>>>>> and it's not doing anything, I would love to get some suggestions on how to
>>>>>> make it work.
>>>>>>
>>>>>> Currently, it's not doing anything (
>>>>>> https://oer.opendeved.net/wiki/OER4Schools), it should remove the
>>>>>> tag from the page, and make headings numbered where the tag is added.
>>>>>>
>>>>>> I've used Krinkle's snippet from MediaWiki.org in form of gadgets,
>>>>>> and it's working fine, but it's not removing tag and it is being executed
>>>>>> on every single page.
>>>>>>
>>>>>> Best regards,
>>>>>> Zoran
>>>>>> _______________________________________________
>>>>>> MediaWiki-l mailing list -- [email protected]
>>>>>> To unsubscribe send an email to [email protected]
>>>>>>
>>>>>> https://lists.wikimedia.org/postorius/lists/mediawiki-l.lists.wikimedia.org/
>>>>>
>>>>> _______________________________________________
>>>>> MediaWiki-l mailing list -- [email protected]
>>>>> To unsubscribe send an email to [email protected]
>>>>>
>>>>> https://lists.wikimedia.org/postorius/lists/mediawiki-l.lists.wikimedia.org/
>>>>
>>>> _______________________________________________
>>> MediaWiki-l mailing list -- [email protected]
>>> To unsubscribe send an email to [email protected]
>>>
>>> https://lists.wikimedia.org/postorius/lists/mediawiki-l.lists.wikimedia.org/
>>
>> _______________________________________________
>> MediaWiki-l mailing list -- [email protected]
>> To unsubscribe send an email to [email protected]
>>
>> https://lists.wikimedia.org/postorius/lists/mediawiki-l.lists.wikimedia.org/
>
> _______________________________________________
> MediaWiki-l mailing list -- [email protected]
> To unsubscribe send an email to [email protected]
>
> https://lists.wikimedia.org/postorius/lists/mediawiki-l.lists.wikimedia.org/

_______________________________________________
MediaWiki-l mailing list -- [email protected]
To unsubscribe send an email to [email protected]
https://lists.wikimedia.org/postorius/lists/mediawiki-l.lists.wikimedia.org/
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.