Difference between revisions of "User:LiaMinina/Help:Using Sublime Text for articles"
(Added some things (by SublimeText.Mediawiker)) |
|||
Line 75: | Line 75: | ||
== Show preview == | == Show preview == | ||
− | Open this file in Sublime, press Alt+F1 or find the Edit panel as in the previous section. If there is no other error message after the return, a "Changes summary" text box will pop up at the bottom of the window for you to write a summary of your edits. Write and then press Enter once more, wait for a few moments. A small black window appears at the bottom of the screen, showing "Page <nowiki>[[xx]]</nowiki> was successfully published to wiki "Moegirlpedia"." After that, the edit has been submitted. However, this editing method does not support checking minor edits for the time being. | + | Open this file in Sublime, press Alt+F1 or find the Edit panel as in the previous section, and enter "Page preview". If there is no other error message after the return, wait a little longer. The browser will automatically open a preview page, but only the text content of the article is displayed correctly. Some complex typography may not be previewed. |
+ | |||
+ | == Submitting your edit == | ||
+ | Open this file in Sublime, press Alt+F1 or find the Edit panel as in the previous section and enter "Post page". A "Changes summary" text box will pop up at the bottom of the window for you to write a summary of your edits. Write and then press Enter once more, wait for a few moments. A small black window appears at the bottom of the screen, showing "Page <nowiki>[[xx]]</nowiki> was successfully published to wiki "Moegirlpedia"." After that, the edit has been submitted. However, this editing method does not support checking minor edits for the time being. |
Latest revision as of 17:01, 20 December 2023
Sublime Text is a text editor developed by Sublime HQ Pty Ltd. The first version of Sublime Text was developed on January 18, 2008 by programmer Jon Skinner. Sublime Text is a closed-source software, extension packages can be added via Package Control. For example, this article describes how to use Mediawiker, developed by tosher, to configure and edit Moegirlpedia using Sublime Text.
For easy introduction, Sublime Text will be referred to as Sublime.
Contents
System requirements
- Linux 32/64-bit
- Mac OS X (Minimum version 10.6)
- Microsoft Windows 32/64-bit
You will need at least 67.5MB of hard disk space to install Sublime.
Installing Sublime
Download and installation
Visit the official Sublime Text website to download the Sublime installer and install it according to your system.
Installing Package Control
Package Control is an extension management plugin for Sublime. Package Control provides a user-friendly interface for the installation, management, and upgrade of various extension plugins. To install extensions in Sublime, you have to go through Package Control first.
Press Ctrl+Shift+P simultaneously in a Sublime window, or click on Tools-Command Palette in the Menu bar. After that, type "Install Package Control" in the horizontal bar that appears and enter. After waiting for a while, Sublime will respond with a system pop-up window that says: "Package Control was successfully installed".
Once the installation is complete you can move on to the next step.
Installing the Mediawiker extension and configuring Moegirlpedia
Press Ctrl+Shift+P and type "Package Control:Install Package" in the pop-up window and enter, wait for some time, and then type "Mediawiker" in the box that appears. Enter and wait for this installation to complete. The completion prompt is located in the black background code area of the window body.
After the installation is complete, click on Preferences-Package Settings-Mediawiker-Settings in the menu bar. At this point, the main body of the window is divided into two parts, add the following code under "site:"
at the top left of the left code area (Remember to add your Moegirlpedia account and password in the locations indicated in the prompts below, remove the protocol prompt that comes when Moegirlpedia text is copied elsewhere, as well as checking for correct code indentation and curly bracket pairing), the effect is shown on the right (below):
{"萌娘百科": // Show site name { "authorization_type": "login", // Using login mode "host": "zh.moegirl.org.cn", // Chinese Moegirlpedia: zh.moegirl.org.cn "path": "/", // In Moegirlpedia, for “/” "pagepath": "", "username": "", // Your Moegirlpedia account, type between two immediately-adjacent double quotes in this line "password": "", // Your Moegirlpedia password, type between two immediately-adjacent double quotes in this line "domain": "", "https": true, "is_ssl_cert_verify": false, "proxy_host": "", "use_http_auth": false, "http_auth_login": "", "http_auth_password": "", "oauth_access_secret": "", "oauth_access_token": "", "oauth_consumer_secret": "", "oauth_consumer_token": "", "cookies_browser": "chrome", "preview_custom_head": [], "retry_timeout": 30, "is_wikia": false, },
For Moegirlpedia in other languages, please add the following code again at the end:
"Moegirlpedia": { "host": "en.moegirl.org.cn", // English Moegirlpedia: en.moegirl.org.cn "parent": "萌娘百科" // Link to Moegirlpedia main site }, "萌えっ娘百科事典": { "host": "ja.moegirl.org.cn", // Japanese Moegirlpedia: ja.moegirl.org.cn "parent": "萌娘百科" },
After that, save and close the page, and return to the main Sublime screen. Press Alt+F1 at this point, or click Tools-Mediawiker-Edit Panel in the menu bar, type "select wiki" in the pop-up bar and press Enter, select "Moegirlpedia" or the desired language version from the contents that appear. The above "select wiki" operation is required when switching languages.
Using Sublime to edit Moegirlpedia
Press Alt+F1 again, type "open page" and enter, or find the "Open page" button at the bottom of the Edit panel as described above, and click on it. A text box will appear below that, type the name of the article you want to edit in the box below and press Enter. Wait for a while. Unsurprisingly, after a while, the body of the Sublime window will show the source code of the article you want to edit in a new tab. It can be edited directly above, after editing, save the article as xx.wiki, xx.mediawiki or xx.wikipedia in Sublime, where xx is the article name.
Show preview
Open this file in Sublime, press Alt+F1 or find the Edit panel as in the previous section, and enter "Page preview". If there is no other error message after the return, wait a little longer. The browser will automatically open a preview page, but only the text content of the article is displayed correctly. Some complex typography may not be previewed.
Submitting your edit
Open this file in Sublime, press Alt+F1 or find the Edit panel as in the previous section and enter "Post page". A "Changes summary" text box will pop up at the bottom of the window for you to write a summary of your edits. Write and then press Enter once more, wait for a few moments. A small black window appears at the bottom of the screen, showing "Page [[xx]] was successfully published to wiki "Moegirlpedia"." After that, the edit has been submitted. However, this editing method does not support checking minor edits for the time being.