Difference between revisions of "Style guide"

Line 7: Line 7:
 
=== Individual ===
 
=== Individual ===
  
Indent the sentence using a colon (:), and wrap it in a '''span''' with class ''liju''. Separate words with spaces.
+
Style individual example sentences as lists, as described below.
 
 
: <span class="liju"> 我 吃了 馒头。</span>
 
  
 
=== Lists ===
 
=== Lists ===
  
Wrap the entire list (or lists, if you want separate sections) in a div with class ''liju''. Separate words with spaces.
+
Wrap the entire list (or lists, if you want separate sections) in a div with class ''liju''. Separate words with spaces. Be sure to leave a blank line after opening the div and before closing it.
  
 
<div class="liju">
 
<div class="liju">
Line 30: Line 28:
 
=== Tables ===
 
=== Tables ===
  
Wrap the whole table in a div with class ''liju''. Separate words with spaces. Leave a column for punctuation at the end.
+
Wrap the whole table in a div with class ''liju''. Separate words with spaces. Leave a column for punctuation at the end. Be sure to leave a blank line after opening the div and before closing it.
  
 
<div class="liju">
 
<div class="liju">
 +
 
{| class="wikitable" style="width:39em"
 
{| class="wikitable" style="width:39em"
 
|+Result complements with aspect particles
 
|+Result complements with aspect particles
Line 44: Line 43:
 
| 我 || 听见 || <em>过</em> || 这 个 声音 || 。
 
| 我 || 听见 || <em>过</em> || 这 个 声音 || 。
 
|}
 
|}
 +
 
</div>
 
</div>
  
Line 56: Line 56:
 
== Patterns ==
 
== Patterns ==
  
Wrap patterns or structures in a div with class ''jiegou''.
+
Wrap patterns or structures in a div with class ''jiegou''. Be sure to leave a blank line after opening the div and before closing it.
 +
 
 +
<div class="jiegou">
  
<div class="jiegou">Subject + 把 + Object + Verb</div>
+
Subject + 把 + Object + Verb
 +
 
 +
</div>
  
 
== Styling elements within the text ==
 
== Styling elements within the text ==

Revision as of 04:42, 5 August 2011

This page gives example code and advice for styling the wiki. If editors stick to these guidelines, the Chinese Grammar Wiki will have a consistent style and appearance, which is beneficial to users.

Example sentences

The wiki uses either a span or a div, both with CSS class liju, to style example sentences. Usage of these is covered below. In either case, separate words in the sentence with spaces to allow browser plugins and other software to parse them more accurately. The CSS class will not show these spaces, so the sentence will still display correctly.

Individual

Style individual example sentences as lists, as described below.

Lists

Wrap the entire list (or lists, if you want separate sections) in a div with class liju. Separate words with spaces. Be sure to leave a blank line after opening the div and before closing it.

  • 你 把 作业 做 完 了 吗 ?
  • 看 完 了 那 部 电影 吗 ?
  • 谁 能 把 ‘ 打喷嚏 ’ 的 ‘ 嚏 ’ 写 对
  • 我们 刚才 听到 的 音乐 是 哪个 乐队 的 ?
  • 你 有 没有 记住 我的 名字?
  • 他 是 不 是 我们 昨天 看到 的 人?

Tables

Wrap the whole table in a div with class liju. Separate words with spaces. Leave a column for punctuation at the end. Be sure to leave a blank line after opening the div and before closing it.

Result complements with aspect particles
Subject RC compound verb Aspect particle Object
看到
看见 那 个 有名的 人
听见 这 个 声音

Rules for spacing words

Separating words with spaces in the example sentences helps software to parse them more accurately. The CSS style ensures that the user sees a nicely displayed sentence that is not broken up by spaces.

  • Separate all parts of speech (nouns, verbs, adjectives etc.).
    我 喜欢 红色 的 自行车。⇒ 我喜欢红色的自行车。
  • Separate all particles,
    吃 饭 了 吗? ⇒ 吃饭了吗?
  • Separate numbers and measure words,
    一 个 苹果。 ⇒ 一个苹果。

Patterns

Wrap patterns or structures in a div with class jiegou. Be sure to leave a blank line after opening the div and before closing it.

Subject + 把 + Object + Verb

Styling elements within the text

  • Put double quotation marks (") around whole sentences in English or Chinese.
  • Leave individual Chinese words or characters as they are. They naturally look different to the surrounding text.
  • Put technical terms in italics (two single quotes on each side).
  • Put key words (i.e. terms that are central to the content of the article, and are likely to be repeated) in bold italics (three single quotes on each side).

Custom styling

Sometimes you need to apply styling to individual elements that MediaWiki markup doesn't allow. In particular, <li> and <tr>. If you need to style these individually, you have to insert an HTML list or table, still wrapped in the appropriate div described above, and then style the elements manually.