Erweiterung:CodeMirror
CodeMirror Freigabestatus: stabil |
|
---|---|
![]() |
|
Einbindung | Benutzer-Schnittstelle |
Beschreibung | Provides syntax highlighting in wikitext editor |
Autor(en) | Pavel Astakhov (pastakhovDiskussion) |
Letzte Version | 4.0.0 |
Kompatibilitätspolitik | Snapshots releases along with MediaWiki. Master is not backwards compatible. |
MediaWiki | 1.32+ |
PHP | 5.3+ |
Datenbankänderungen | Nein |
Lizenz | GNU General Public License 2.0 oder neuer |
Herunterladen | |
|
|
Übersetze die CodeMirror-Erweiterung, wenn sie auf translatewiki.net verfügbar ist | |
Vagrant-Rolle | codemirror |
Probleme | Offene Aufgaben · Einen Fehler melden |
The CodeMirror extension provides syntax highlighting in MediaWiki's wikitext editor.
It adds a button with the icon to the editing toolbar that allows for switching syntax highlighting on and off.
It supports the 2010 WikiEditor toolbar as well as the VisualEditor toolbar.
By default it is switched off. When switching on, it will replace the standard textarea with the editor provided by CodeMirror library. When switching off, it will be the opposite effect.
You can use your own styles for wikitext highlighting. Used styles available here. You should place your own styles to common.css. If you have found better styles please let me know.
Browser Unterstützung
All browsers supported by MediaWiki are supported. Modern mobile browsers tend to partly work.
Screenshots
Demo.
Installation
- Wird Vagrant benutzt, ist mit
vagrant roles enable codemirror --provision
zu installieren
- Manuelle Installation
- Install either the WikiEditor extension or the VisualEditor extension in wikitext mode, as instructed on their pages; at least one of these is required for this extension to work.
- Die Erweiterung herunterladen und die Datei(en) in ein Verzeichnis namens
CodeMirror
im Ordnerextensions/
ablegen. - Folgenden Code am Ende der LocalSettings.php hinzufügen:
wfLoadExtension( 'CodeMirror' );
- Configure as required.
- Erledigt – Zu Special:Version in dem Wiki (bei Einstellung auf deutsch nach Spezial:Version) navigieren, um die erfolgreiche Installierung der Erweiterung zu überprüfen.
Konfiguration
# Enables use of CodeMirror by default but still allow users to disable it
$wgDefaultUserOptions['usecodemirror'] = 1;
Add the above code at the bottom of your LocalSettings.php .
For color and style customization, see Meta help page.
Extension integration
If your MediaWiki extension adds a new tag and you want to make sure CodeMirror properly highlights the content within it, you can add CodeMirror support to your extension. Here are two examples: Cite extension and PhpTags extension.
zu erledigen
- highlighting definition lists ( ;foo :bar ) (phab:T170042)
- auto-completion (phab:T95100)
- brace matching (phab:T15302)
- code folding T166098
- highlighting inside gallery tag (<gallery> foo | bar </gallery>)
Siehe auch
- Extension:VisualEditor
- Erweiterung:WikiEditor
- Extension:CodeEditor
- Community Tech/Wikitext editor syntax highlighting (includes information on customizing the colors)
- c:Category:MediaWiki extension CodeMirror
Diese Erweiterung wird in einem oder mehreren Wikis von Wikimedia verwendet. Das bedeutet mit hoher Wahrscheinlichkeit, dass die Erweiterung stabil ist und gut genug funktioniert, um auf solch häufig besuchten Webseiten benutzt zu werden. Suche nach dem Erweiterungs-Namen in den Wikimedia CommonSettings.php und den InitialiseSettings.php-Konfigurations-Dateien, um zu nachzusehen, wo es installiert ist. Eine vollständige Liste der installierten Erweiterungen in einem bestimmten Wiki wird auf Special:Version im Wiki generiert und angezeigt. |