BryghtShadow (talk | contribs) No edit summary |
BryghtShadow (talk | contribs) m (→See also: SublimeText 3 -> SublimeText) |
||
(2 intermediate revisions by one other user not shown) | |||
Line 76: | Line 76: | ||
# <code>USER_NAME</code> and <code>BOT_NAME@BOT_PASSWORD</code>; or |
# <code>USER_NAME</code> and <code>BOT_NAME@BOT_PASSWORD</code>; or |
||
# <code>USER_NAME@BOT_NAME</code> and <code>BOT_PASSWORD</code>. |
# <code>USER_NAME@BOT_NAME</code> and <code>BOT_PASSWORD</code>. |
||
− | == You are not logged in. Please log in and try again. == |
+ | === You are not logged in. Please log in and try again. === |
Likely caused by trying to posting changes to a wiki prior to logging in. |
Likely caused by trying to posting changes to a wiki prior to logging in. |
||
The login token may also have expired. |
The login token may also have expired. |
||
Line 84: | Line 84: | ||
* [https://code.visualstudio.com/ Visual Studio Code] |
* [https://code.visualstudio.com/ Visual Studio Code] |
||
* [https://github.com/Frederisk/Wikitext-VSCode-Extension Wikitext VSCode Extension on GitHub] |
* [https://github.com/Frederisk/Wikitext-VSCode-Extension Wikitext VSCode Extension on GitHub] |
||
+ | |||
+ | == See also == |
||
+ | * [[SublimeText Mediawiker]] |
||
[[Category:Guides]] |
[[Category:Guides]] |
Revision as of 03:54, 19 November 2021
Visual Studio Code (VSC) is a free code editor made by Microsoft for Windows, iOS, and Linux. The Wikitext extension provides functional support for the wikitext language with MediaWiki wikis.
- Note: This guide is based on Visual Studio Code version 1.58.2 and Wikitext version 3.3.0, but should work on most stable versions.
Installation
For all installation methods, Visual Studio Code is required.
- Download and install Visual Studio Code: https://code.visualstudio.com/
Default installation
- Open the extensions panel. This can be accessed as follows:
- Menu bar: View → Extensions
- Activity bar: The 5th item (looks like 4 squares arranged in a 2x2 grid, and the top right square is dettached)
- Keyboard shortcuts: Ctrl+⇧ Shift+X (Windows).
- Search for Wikitext in the Marketplace, and select this item in the results.
- Once the extension page loads in VSC, click "Install".
Alternative installation
- Navigate to https://marketplace.visualstudio.com/items?itemName=RoweWilsonFrederiskHolme.wikitext
- Click "Install". This will prompt to allow the site to open the vscode link, if you haven't set it to always allow.
- Click "Choose Application", select "Visual Studio Code", and click "Open Link".
- Once the extension page loads in VSC, click "Install".
Configuration
- Open the settings panel.
- Menu bar: File → Preferences → Settings.
- Activity bar: Gear icon at bottom → Settings.
- Keyboard shortcut: Ctrl+, (Windows).
- Search for "Wikitext" in the settings, or expand the "Extensions" and select "Wikitext".
Please refer to Special:Version and Special:BotPasswords of your wiki to find the information for the following fields:
Option | English wiki example | Japanese wiki example |
---|---|---|
Wikitext: Api path | /api.php
|
/ja/api.php
|
Wikitext: Article path | /wiki/
|
/ja/wiki/
|
Wikitext: Host | community.fandom.com
|
community.fandom.com
|
Wikitext: Password | BOT_PASSWORD
| |
Wikitext: User name | USER_NAME@BOT_NAME
| |
Wikitext: Password (alternative) | BOT_NAME@BOT_PASSWORD
| |
Wikitext: User name (alternative) | USER_NAME
|
- Important: The "bot name" that you choose when generating a bot password must be provided in either the "Wikitext: Password" field or the "Wikitext: User name" field, but not both.
Usage
All commands require the Command Palette (Ctrl+⇧ Shift+P on Windows).
- In the Command Palette, type
>login
and select "Wikitext: Login with your account". Do this when you change wikis, or when you're not logged in and wish to make changes. - In the Command Palette, type
>pull
and select "Wikitext: Pull page to edit". Enter the full page name in the next field. Opens the page in a new tab. - In the Command Palette, type
>preview
and select "Wikitext: Get preview". This will open a new tab with page preview. Recommended to do prior to posting. - In the Command Palette, type
>post
and select "Wikitext: Post your edit to the website". Also enter edit summary. - In the Command Palette, type
>logout
and select "Wikitext: Logout, if you are already logged in". Use when you're done editing for the session.
Troubleshooting
invalidjson: No valid JSON response
Likely caused by incorrect details for the API path or article path.
For example, the API path left as default /w/api.php
.
Could not login: Failed
Likely to be caused by incorrect credentials. Make sure the username and password is either:
USER_NAME
andBOT_NAME@BOT_PASSWORD
; orUSER_NAME@BOT_NAME
andBOT_PASSWORD
.
You are not logged in. Please log in and try again.
Likely caused by trying to posting changes to a wiki prior to logging in. The login token may also have expired. Changing wikis will discard the current login token.