Jump to content

Help:Extension:CodeMirror/Color and style customization/zh

From mediawiki.org
This page is a translated version of the page Help:Extension:CodeMirror/Color and style customization and the translation is 99% complete.
这是 CodeMirror 的 CSS 类的一个**部分列表**。完整的默认 CodeMirror 样式定义列表位于 Gerrit

可以通过在你自己的CSS中定义下表中的类的样式,来覆盖 CodeMirror 中使用的颜色和样式。[1] 请注意,在2017年版wikitext编辑器中,更改行高或字体大小等某些设置可能无法生效。

CSS 类 元素 CodeMirror 样式
.cm-mw-skipformatting 行首空格 foo bar
.cm-mw-list 星号或井号 * foo bar, # foo bar
.cm-mw-signature,
.cm-mw-hr
签名、水平线 ∼∼∼∼, ----
.cm-mw-indenting 冒号 ::: foo bar
.cm-mw-html-entity HTML 实体 &
.cm-mw-comment HTML 注释 <!-- comment -->
.cm-mw-apostrophes-bold,
.cm-mw-apostrophes-italic
粗斜体 '''bold''' ''italic''
标题
.cm-mw-section-1 一级标题[2] = Heading =
.cm-mw-section-2 二级标题[2] == Heading ==
.cm-mw-section-3 三级标题 === Heading ===
.cm-mw-section-4 四级标题 ==== Heading ====
.cm-mw-section-5 五级标题 ===== Heading =====
.cm-mw-section-6 六级标题 ====== Heading ======
.cm-mw-section-header 等号 ==
模板
示例 {{cite book|title=foo bar}}
.cm-mw-template 其他模板内容 foo bar
.cm-mw-template-name 模板名称 cite book
.cm-mw-template-argument-name 模板参数名 title=
.cm-mw-template-delimiter 管道符 |
.cm-mw-template-bracket 開放/閉合括弧 {{ }}
.cm-mw-template-ground
.cm-mw-template2-ground
.cm-mw-template3-ground
整个模板
(括号中的数字是嵌套的层级)
{{foo|{{cite book|title=foo bar}}}}
变量
示例 {{{foo|bar}}}
.cm-mw-templatevariable 变量 bar
.cm-mw-templatevariable-name 三层花括号套住的变量名 foo
.cm-mw-templatevariable-bracket 開放/閉合括弧 {{{ }}}
.cm-mw-templatevariable-delimiter 管道符 |
解析器函数
示例 {{#assessment: A | High }}
.cm-mw-parserfunction 解析器函数参数 High
.cm-mw-parserfunction-name 解析器函数名 PAGENAME #invoke
.cm-mw-parserfunction-bracket 開放/閉合括弧 {{ }}
.cm-mw-parserfunction-delimiter 定界符 :
扩展标签
注意:扩展程序可以使用它们自己的样式和规则来高亮显示扩展标签内的文本。
示例 <poem style="padding: 1em;">string
whole line
string</poem>
.cm-mw-exttag 标签里的文字 string
.cm-mw-exttag-name,
.cm-mw-ext-poem[3]
标签名称 poem
.cm-mw-exttag-bracket 開放/閉合括弧 < >
.cm-mw-tag-ref 参考内容 <ref>{{cite web|url=https://example.org}}</ref>
.cm-mw-exttag-attribute
.cm-mw-exttag-attribute-value
参考属性 style="padding: 1em;"
HTML标签
示例 <span style="foo">foo bar</span>
.cm-mw-htmltag-name HTML标签 span
.cm-mw-htmltag-bracket 開放/閉合括弧 < >
.cm-mw-htmltag-attribute
.cm-mw-htmltag-attribute-value
参数與值 style="foo"
上标
下标
foo<sup>bar</sup>
foo<sub>bar</sub>
預先格式化的文字
.cm-mw-tag-pre 預先格式化的文字 <pre>foo bar</pre>
.cm-mw-tag-nowiki nowiki文字 <nowiki>foo bar</nowiki>
内部链接
示例 [[foo bar]] [[foo#section|bar]]
.cm-mw-link-pagename 內部連結目標 foo bar
.cm-mw-link #字符 #section
.cm-mw-link-tosection #之後的字元 #section
.cm-mw-link-bracket 開放/閉合括弧 [[ ]]
.cm-mw-link-text 連結標籤 (無額外的格式)
.cm-mw-link-delimiter 管道符 |
.cm-mw-pagename 內部連結目標 foo bar
外部链接
示例 https://www.example.org
[https://www.example.org]
[https://www.example.org example.org]
.cm-mw-extlink,
.cm-mw-free-extlink
外部連結目標 www.example.org
.cm-mw-extlink-protocol,
.cm-mw-free-extlink-protocol
協定 https://
.cm-mw-extlink-text 連結標籤 (無額外的格式)
.cm-mw-extlink-bracket 開放/閉合括弧 [ ]
表格
示例 {|class="wikitable"
|-
! Header text !! Header text
|-
| Example || Example
|}
.cm-mw-table-bracket 開放/閉合括弧 {| |}
.cm-mw-table-delimiter 行與列分隔符 | |- !
.cm-mw-table-definition
.cm-mw-table-definition-value
表格類別與樣式 class="wikitable"
.cm-mw-table-caption 標題文字 |+ caption
其他
.cm-mw-double-underscore 魔法字 __TOC__
.cm-mw-list 分號(定義列表) ;Foo:Bar
.cm-special-char-nbsp 不换行空格 · ·
.cm-specialChar 控制字元

它支持多种语言,特别是MediaWiki的wikitext、JavaScript、CSS、JSON、和Lua。

  1. 你的个人 CSS 文件位于 Special:MyPage/common.css。 如果已安装了GlobalCssJs ,您还可以让您的更改在全域范围内生效。 在维基媒体的wiki上,你的全域CSS位于 meta:Special:MyPage/global.css
  2. 2.0 2.1 大小在 2017版wikitext编辑器 中不会改变。
  3. 这里的 "poem" 是标签的名称。