tosher / Mediawiker

A plugin for Sublime Text editor that adds possibility to use it as Wiki Editor on MediaWiki-based sites like Wikipedia and many other.
Other
138 stars 27 forks source link

Module Testing functionality #168

Open gigamicro opened 3 years ago

gigamicro commented 3 years ago

I code modules for my wiki; there is an api command to test modules.

I'd like to be able to test my modules via this plugin.

I've tried to make a variation of the code that would make this api request, but I don't really know the structure of the plugin MWTEST.py

I'd appreciate any help.

tosher commented 3 years ago

If you need a python library to interact with Mediawiki API, you need to use a mwclient.

But, if you want to use this plugin for something, please describe how :)

P.S. Link to MWTEST.py is wrong

gigamicro commented 3 years ago

I couldn't upload a .py file, so I renamed the link. The idea was to be able to set ctrl+b to a 'test module' command. It'd pop up a query field, then send the API command for testing modules with the edits (https://www.mediawiki.org/w/api.php?action=help&modules=scribunto-console)

tosher commented 3 years ago

Something like this? https://github.com/jgjake2/scribunto-console

With command inside this plugin or just with mwclient you can get a script source and make request to console, than processing results (make tests).

Which questions about the plugin structure you have?