Git Product home page Git Product logo

wikitext-extension-gadget's Introduction

Wikitext-Extension-Gadget

GitHub: wikitext gadget Toolhub: wikitext gadget

Build status GitHub Actions CodeQL

Twitter: @rwfholme Patreon Donate

A Mediawiki Gadget for Wikitext Extension based on MediaWiki. To allow users to directly open VSCode in the browser to edit wiki pages. Open VSCode in the browser to edit wiki pages

Usage

For ordinary users (such as WikiMedia Sister Project editors)

First make sure that your VSCode has installed the Wikitext Extension for VSCode v3.4.0 or upper. Then you only need to log in to your site, open the User Preferences, Appearance, and add a new line of code for Custom JavaScript:

  • For VSCode user:

    mw.loader.load("https://github.com/Frederisk/Wikitext-Extension-Gadget/releases/latest/download/index-vscode.js");
  • For VSCode Insiders user:

    mw.loader.load("https://github.com/Frederisk/Wikitext-Extension-Gadget/releases/latest/download/index-vscode-insiders.js");
  • For VSCodium user:

    mw.loader.load("https://github.com/Frederisk/Wikitext-Extension-Gadget/releases/latest/download/index-vscodium.js");

For users who have customized API path

You may need to download the release or clone the repository, adjust some variables in the source code and copy the generated code to your account's User Preferences, Appearance in your site. The gadget built in this way cannot get the newest update. It's recommended to watch this repository to keep the function up-to-date.

There are two variables you should notice:

  • The apiPath should be consistent with the Entry point URLs: api.php in the website page Special:Version.

    APIPath: window.mw.util.wikiScript('api');
  • The scheme should be filled in the VSCode release version you are using. vscode or vscode-insiders.

    const scheme: string | undefined = 'vscode-insiders';

For codespace or code-server user

The gadget does not yet provide support for such editor.

Development

building

npm install -g yarn # install yarn
yarn # install node modules
yarn run compile # compile

wikitext-extension-gadget's People

Contributors

fenymufyd avatar frederisk avatar lakejason0 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

wikitext-extension-gadget's Issues

Undefined error

I can use the local wikitext extension just fine, log in and pull page from the F1 menu inside vscode:

However, when using this script from releases put into my common.js and hitting the open in vscode button, I get an undefined error, with no more info in it:

Add Support fro Monobook Skin

The title says it all. The current scripts only work for Minerva users, would love to see this expanded to work with more skins. The ones that I favor are:

Monobook
Timeless
Vector
Chameleon

My current wiki uses Monobook so I would start the request there.

About Chinese localization

In this commit, i18n was finally here but when it comes to Chinese (zh) the thing is not that right.
For Chinese (zh), the fallback is firstly to zh-hans, then zh-hant. But actually the reason to have a language code zh is that in this language, Language Converter is given to automatically convert the page content from Simp. to Trad. or vice versa.
My testing result is that when users choose zh, it actually uses Simplified Chinese, thus in this line it should actually be 'zh': i18nSource['simplified_chinese'],.


It's just a code fact that the zh language class in MediaWiki actually inherits from zh-hans. I do not welcome any political comment on this and sorry if you feel a bit not comfortable. I'm learning language differences as well and from my knowledge zh-hant uses ้–‹ๅ•Ÿ for open. It seems like you are native in zh-tw so I wouldn't feel surprised if you say that it's not the case.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.