Extensão:CodeEditor
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 |
branches de lançamento |
MediaWiki | 1.32+ |
Modifica o banco de dados |
Não |
Licença | GPL-2.0-or-later AND BSD-3-Clause |
Download | |
|
|
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 edição avançada do WikiEditor com um [$ace-link widget Ace editor], oferecendo algumas funcionalidades úteis para javascripts de usuário ou site, páginas CSS e, quando Extension:Scribunto estiver também instalado, para páginas no namespace Module:
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
- syntax validity check for JavaScript
- Pair-matching for parenthesis, braces and square brackets
Instalação
- Se estiver usando o Vagrant , instale com
vagrant roles enable codeeditor --provision
- Instalação manual
- 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.
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 editor session.
Integração do WikiEditor
![]() | Esta página está desatualizada. |
I've been integrating CodeEditor into the pluggable portions of Extensão:WikiEditor as prep for Future editor work, since we'll want to be able to extend it to edit things that aren't plain wikitext, which'll need some changes to the toolbar setup and whatnot. JS/CSS here still return plain text in the end, making it an easier intermediate project. --brion 00:26, 14 June 2011 (UTC)
Good:
- special char insertions work, including quote pairs to surround text
- basic formatting insertions work, including link dialogs
- search/replace dialog works
- ace's built-in search/replace UI also triggers from keyboard commands, still need to disable them! (onCommandKey)
Bad:
- multi-line formatting doesn't apply correctly (but really should that apply here? :)
Todo:
- remove toolbar buttons that don't apply (formatting, syntax help?)
- add toolbar buttons that are more directly useful
- indent/outdent
- insertion helpers for common keywords or code bits
- help reference to MW JS API reference, JS & CSS specs/documentation
Problemas
![]() | Esta página está desatualizada. |
- accessibility: tab/shift-tab are overridden. is there a consistent alternative for keyboard-reliant users?
- accessibility: accesskey on the original textarea needs to be moved over or otherwise handled
- scrollbar initializes too wide; need to trigger resize check after that's filled (maybe fixed?)
- cursor/scroll position not maintained over previews/show changes
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. |
- Extensions bundled with MediaWiki 1.31/pt-br
- Stable extensions/pt-br
- Extensions with invalid or missing type/pt-br
- Extensions with unknown license/pt-br
- Extensions in Wikimedia version control/pt-br
- EditPage::showEditForm:initial extensions/pt-br
- EditPage::showReadOnlyForm:initial extensions/pt-br
- GetPreferences extensions/pt-br
- All extensions/pt-br
- Outdated pages/pt-br
- Extensions used on Wikimedia/pt-br
- Syntax highlighting extensions/pt-br
- Scribunto extensions/pt-br
- Edit extensions/pt-br