확장 기능:CodeMirror
CodeMirror 출시 상태: 안정 |
|
---|---|
![]() |
|
구현 | 사용자 인터페이스 |
설명 | 위키텍스트 편집기에서 구문 강조 기능 제공 |
만든이 | Pavel Astakhov (pastakhov토론) |
최신 버전 | 4.0.0 |
호환성 정책 | Snapshots releases along with MediaWiki. Master is not backwards compatible. |
MediaWiki | 1.32+ |
PHP | 5.3+ |
데이터베이스 변경 | 아니오 |
라이선스 | GNU General Public License 2.0 or later |
다운로드 | |
|
|
CodeMirror 확장 기능 번역 (translatewiki.net에서 가능한 경우) | |
Vagrant 역할 | codemirror |
이슈 | 미해결 작업 · 버그 보고 |
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.
브라우저 지원
All browsers supported by MediaWiki are supported. Modern mobile browsers tend to partly work.
스크린샷
설치
- Vagrant 를 사용하고 있는 경우에는,
vagrant roles enable codemirror --provision
로 설치해주세요
- 수동 설치
- 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.
- 파일을 다운로드해서,
extensions/
폴더 내의CodeMirror
이라는 이름의 디렉터리 내에 설치합니다. - 아래의 코드를 LocalSettings.php의 말미에 추가합니다:
wfLoadExtension( 'CodeMirror' );
- Configure as required.
- 완료 – 위키의 ‘Special:Version’에 이동해서, 확장기능이 올바르게 설치된 것을 확인합니다.
설정하기
# 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.
확장 기능 통합
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.
To do
- 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>)
같이 보기
- Extension:VisualEditor
- 확장기능:WikiEditor
- 확장기능:코드 편집기
- Community Tech/Wikitext editor syntax highlighting (includes information on customizing the colors)
- c:Category:MediaWiki extension CodeMirror
This extension is being used on one or more Wikimedia projects. This probably means that the extension is stable and works well enough to be used by such high-traffic websites. Look for this extension's name in Wikimedia's CommonSettings.php and InitialiseSettings.php configuration files to see where it's installed. A full list of the extensions installed on a particular wiki can be seen on the wiki's Special:Version page. |