Extensão:CodeEditor
![]() Estado da versão: estável |
|
---|---|
![]() |
|
Descrição | Fornece um editor de código com realce de sintaxe para páginas JS, CSS e Lua de sites e usuários, integrado com barra de ferramentas de edição avançada |
Autor(es) |
|
Política de compatibilidade |
Snapshots releases along with MediaWiki. Master is not backward compatible. |
MediaWiki | 1.32+ |
Modifica o banco de dados |
Não |
Licença | GPL-2.0-or-later AND BSD-3-Clause |
Download | |
|
|
Quarterly downloads | 238 (Ranked 45th) |
Public wikis using | 8,385 (Ranked 17th) |
Para traduzir a extensão CodeEditor, verifique sua disponibilidade no translatewiki.net | |
Problemas | Tarefas em aberto · Relatar um bug |
A extensão CodeEditor estende a barra de ferramentas de edição avançada do WikiEditor com um widget editor Ace, fornecendo alguns recursos úteis para páginas JavaScript de usuário/site, páginas CSS, páginas JSON e quando a extensão Scribunto também está instalada , para páginas LUA, ou seja, páginas no namespace do Module. The code editor does not show on regular wiki pages, i.e. wiki pages with the "wikitext" content model. (See Extensão:CodeMirror for syntax highlighting of wikitext when using the source editor.)
It provides the following features:
- syntax highlighting for JavaScript, CSS and Lua
- auto-indent
- tab key produces tab indents (since 1.22), soft indents before.
- indent/unindent selection with Tab/Shift-Tab keys
- syntax validity check for JavaScript
- Pair-matching for parenthesis, braces and square brackets
Instalação
- Baixe e coloque o(s) arquivo(s) num diretório chamado
CodeEditor
na sua pastaextensions/
. - Adicione o seguinte código ao final do seu arquivo
LocalSettings.php
:wfLoadExtension( 'CodeEditor' ); $wgDefaultUserOptions['usebetatoolbar'] = 1; // user option provided by WikiEditor extension
- Configure as required.
- Concluído – Navegue à página Special:Version em sua wiki para verificar se a instalação da extensão foi bem sucedida.
Instalação com Vagrant:
- Se estiver usando o Vagrant , instale com
vagrant roles enable codeeditor --provision
Configuração
$wgCodeEditorEnableCore
$wgCodeEditorEnableCore
: Atribuatrue
para habilitar o editor em páginas JavaScript e CSS nos namespaces MediaWiki, User e outros do MediaWiki.
$wgScribuntoUseCodeEditor
- To disable this extension for Scribunto, i.e. in the module namespace set
$wgScribuntoUseCodeEditor = false;
(default is "true")
JavaScript
It is possible to change the configuration of the ACE editor, by hooking into the MediaWiki JS hook (i.e. mw.hook( 'codeEditor.configure' ).add( ... )
).
The argument passed to your hook will be an ACE EditSession object.
If you need to interact with the contents of a CodeEditor instance, use jQuery.plugin.textSelection.
License
While this extension is licensed GNU General Public License v2.0 or later (GPL-2.0+) it makes use of the Ace editor software which is licensed BSD 3-clause "New" or "Revised" License (BSD-3-Clause).
Esta extensão está sendo usado por um ou mais projetos da Wikimedia. Isto significa que, provavelmente, a extensão é estável e funciona bem o suficiente para ser utilizada em sites de alto tráfego. Procure pelo nome dessa extensão nos arquivos de configuração CommonSettings.php e InitialiseSettings.php da Wikimedia para verificar onde ela foi instalada. Uma lista completa das extensões instaladas numa wiki em particular podem ser visualizadas na página Special:Version da wiki. |
This extension is included in the following packages and/or wiki farms: This is not an authoritative list. Some wiki farms/hosts may contain this extension even if they are not listed here. Always check with your wiki farms/hosts or bundle to confirm. |