[gtksourceview: 1/3] def.lang: Add markup styles



commit 714a38cc2b552d74514a29c403d691a0f115649d
Author: Jeffery To <jeffery to gmail com>
Date:   Mon Nov 11 04:42:59 2019 +0800

    def.lang: Add markup styles
    
    This adds a set of default styles for (lightweight) markup languages,
    and updates current markup language definitions (AsciiDoc, Markdown,
    MediaWiki, and reStructuredText) to use these styles.
    
    This also adds style scheme definitions for these default styles, for
    each default style scheme. Each style scheme definition (with two
    exceptions) are copied from the style scheme definition of an existing
    style.
    
    These are the default styles added and (in parentheses) the existing
    style from which the style scheme definition was copied:
    
    * emphasis (doc-comment-element)
    * strong-emphasis (statement)
    * inline-code (identifier)
    * insertion (none)
    * deletion (none)
    * link-text (comment)
    * link-symbol (shebang)
    * link-destination (net-address)
    * heading (type)
    * thematic-break (type)
    * preformatted-section (identifier)
    * list-marker (statement)
    
    Insertion and deletion styles only have underline and strikethrough set
    (respectively), as these are currently unused and so there are no
    relevant style scheme definitions to copy from.
    
    This also adds test files for Markdown and MediaWiki.

 data/language-specs/asciidoc.lang        |  16 +-
 data/language-specs/def.lang             |  26 +++
 data/language-specs/markdown.lang        |  27 +--
 data/language-specs/mediawiki.lang       |  18 +-
 data/language-specs/rst.lang             |  12 +-
 data/styles/classic.xml                  |  14 ++
 data/styles/cobalt.xml                   |  14 ++
 data/styles/kate.xml                     |  14 ++
 data/styles/oblivion.xml                 |  14 ++
 data/styles/solarized-dark.xml           |  14 ++
 data/styles/solarized-light.xml          |  14 ++
 data/styles/tango.xml                    |  14 ++
 tests/syntax-highlighting/file.md        |  38 ++++
 tests/syntax-highlighting/file.mediawiki | 355 +++++++++++++++++++++++++++++++
 14 files changed, 554 insertions(+), 36 deletions(-)
---
diff --git a/data/language-specs/asciidoc.lang b/data/language-specs/asciidoc.lang
index 717452a9..2c1f986b 100644
--- a/data/language-specs/asciidoc.lang
+++ b/data/language-specs/asciidoc.lang
@@ -27,27 +27,27 @@
   </metadata>
 
   <styles>
-    <style id="markup-monospace"  name="Monospaced Text"     map-to="def:constant"/>
-    <style id="markup-emphasis"   name="Emphasized Text"     map-to="def:doc-comment-element"/>
-    <style id="markup-strong"     name="Strong Text"         map-to="def:statement"/>
+    <style id="markup-monospace"  name="Monospaced Text"     map-to="def:inline-code"/>
+    <style id="markup-emphasis"   name="Emphasized Text"     map-to="def:emphasis"/>
+    <style id="markup-strong"     name="Strong Text"         map-to="def:strong-emphasis"/>
     <style id="markup-pass"       name="Passthrough Text"    map-to="def:special-char"/>
     <style id="markup-replace"    name="Replacement"         map-to="def:special-char"/>
     <style id="markup-linebreak"  name="Line Break"          map-to="def:special-char"/>
     <style id="markup-admonition" name="Admonition"          map-to="def:note"/>
     <style id="markup-anchor"     name="Anchor"              map-to="def:identifier"/>
     <style id="markup-crosslink"  name="Link"                map-to="def:identifier"/>
-    <style id="markup-url"        name="URL"                 map-to="def:net-address"/>
+    <style id="markup-url"        name="URL"                 map-to="def:link-destination"/>
     <style id="markup-att-entry"  name="Attribute Entry Invocation"     map-to="def:preprocessor"/>
-    <style id="struct-title"      name="Title"               map-to="def:type"/>
+    <style id="struct-title"      name="Title"               map-to="def:heading"/>
     <style id="struct-blocktitle" name="Block Title"         map-to="def:identifier"/>
     <style id="struct-style"      name="Style"               map-to="def:identifier"/>
-    <style id="par-literal"       name="Literal"             map-to="def:string"/>
-    <style id="block-listing"     name="Listing"             map-to="def:comment"/>
+    <style id="par-literal"       name="Literal"             map-to="def:preformatted-section"/>
+    <style id="block-listing"     name="Listing"             map-to="def:preformatted-section"/>
     <style id="block-comment"     name="Comment"             map-to="def:comment"/>
     <style id="block-boundary"    name="Block Boundary"      map-to="def:identifier"/>
     <style id="macro"             name="Macro"               map-to="def:keyword"/>
     <style id="preprocessor"      name="Preprocessor"        map-to="def:preprocessor"/>
-    <style id="list-identifier"   name="List Identifier"     map-to="def:special-char"/>
+    <style id="list-identifier"   name="List Identifier"     map-to="def:list-marker"/>
   </styles>
 
   <definitions>
diff --git a/data/language-specs/def.lang b/data/language-specs/def.lang
index 4a1b4e1d..ce298485 100644
--- a/data/language-specs/def.lang
+++ b/data/language-specs/def.lang
@@ -94,6 +94,32 @@
     <!--A primitive data type: int, long, char, etc. -->
     <style id="type"                name="Data type"/>
 
+    <!-- Markup group -->
+    <!-- Emphasis, usually rendered with italics -->
+    <style id="emphasis"            name="Emphasis"/>
+    <!-- Strong emphasis, usually rendered as bold -->
+    <style id="strong-emphasis"     name="Strong emphasis"/>
+    <!-- Inline code, usually rendered with a monospace font -->
+    <style id="inline-code"         name="Inline code"/>
+    <!-- Insertion, usually rendered with an underline -->
+    <style id="insertion"           name="Insertion"/>
+    <!-- Deletion, usually rendered with a strikethrough -->
+    <style id="deletion"            name="Deletion"/>
+    <!-- Link text, usually rendered with an underline -->
+    <style id="link-text"           name="Link text"/>
+    <!-- Link symbol, a part of the markup syntax for links -->
+    <style id="link-symbol"         name="Link symbol"/>
+    <!-- Link destination, not usually visible -->
+    <style id="link-destination"    name="Link destination"/>
+    <!-- Heading, usually rendered in a larger font (using h1, h2, etc. tags) -->
+    <style id="heading"             name="Heading"/>
+    <!-- Thematic break, usually rendered as a horizontal rule (line) -->
+    <style id="thematic-break"      name="Thematic break"/>
+    <!-- Preformatted section, usually rendered with a monospace font -->
+    <style id="preformatted-section" name="Preformatted section"/>
+    <!-- List marker, usually rendered as a bullet or number -->
+    <style id="list-marker"         name="List marker"/>
+
     <!-- Others -->
     <!-- This one is for '#include <foo.h>' and "#pragma blah", or 'use foobar', etc.. -->
     <style id="preprocessor"        name="Preprocessor directive"/>
diff --git a/data/language-specs/markdown.lang b/data/language-specs/markdown.lang
index 577532b9..0a538c55 100644
--- a/data/language-specs/markdown.lang
+++ b/data/language-specs/markdown.lang
@@ -31,18 +31,19 @@
   </metadata>
 
   <styles>
-    <style id="header" name="Header" map-to="def:type"/>
-    <style id="horizontal-rule" name="Horizontal Rule" map-to="def:type"/>
-    <style id="list-marker" name="List Marker" map-to="def:statement"/>
-    <style id="code" name="Code" map-to="def:identifier"/>
+    <style id="header" name="Header" map-to="def:heading"/>
+    <style id="horizontal-rule" name="Horizontal Rule" map-to="def:thematic-break"/>
+    <style id="list-marker" name="List Marker" map-to="def:list-marker"/>
+    <style id="code-span" name="Code Span" map-to="def:inline-code"/>
+    <style id="code-block" name="Code Block" map-to="def:preformatted-section"/>
     <style id="blockquote-marker" name="Blockquote Marker" map-to="def:shebang"/>
-    <style id="url" name="URL" map-to="def:net-address"/>
-    <style id="link-text" name="Link Text" map-to="def:comment"/>
+    <style id="url" name="URL" map-to="def:link-destination"/>
+    <style id="link-text" name="Link Text" map-to="def:link-text"/>
     <style id="label" name="Label" map-to="def:preprocessor"/>
     <style id="attribute-value" name="Attribute Value" map-to="def:constant"/>
-    <style id="image-marker" name="Image Marker" map-to="def:shebang"/>
-    <style id="emphasis" name="Emphasis" map-to="def:doc-comment-element"/>
-    <style id="strong-emphasis" name="Strong Emphasis" map-to="def:statement"/>
+    <style id="image-marker" name="Image Marker" map-to="def:link-symbol"/>
+    <style id="emphasis" name="Emphasis" map-to="def:emphasis"/>
+    <style id="strong-emphasis" name="Strong Emphasis" map-to="def:strong-emphasis"/>
     <style id="backslash-escape" name="Backslash Escape" map-to="def:special-char"/>
     <style id="line-break" name="Line Break" map-to="def:note"/>
   </styles>
@@ -132,7 +133,7 @@
       <match>^( {8,}|\t{2,})([^ \t]+.*)</match>
 
       <include>
-        <context sub-pattern="2" style-ref="code"/>
+        <context sub-pattern="2" style-ref="code-block"/>
       </include>
     </context>
 
@@ -147,7 +148,7 @@
          Here's a literal HTML tag: `<p>`.
          `Here's a code span containing ``backticks``.`
     -->
-    <context id="1-backtick-code-span" class="no-spell-check" style-ref="code">
+    <context id="1-backtick-code-span" class="no-spell-check" style-ref="code-span">
       <match>(?&lt;!`)`[^`]+(`{2,}[^`]+)*`(?!`)</match>
     </context>
 
@@ -156,11 +157,11 @@
          ``The grave accent (`) is used in Markdown to indicate a code span.``
          ``Here's another code span containing ```backticks```.``
     -->
-    <context id="2-backticks-code-span" class="no-spell-check" style-ref="code">
+    <context id="2-backticks-code-span" class="no-spell-check" style-ref="code-span">
       <match>(?&lt;!`)``[^`]+((`|`{3,})[^`]+)*``(?!`)</match>
     </context>
 
-    <context id="3-backticks-code-span" class="no-spell-check" style-ref="code">
+    <context id="3-backticks-code-span" class="no-spell-check" style-ref="code-block">
       <start>^```.*$</start>
       <end>^```$</end>
     </context>
diff --git a/data/language-specs/mediawiki.lang b/data/language-specs/mediawiki.lang
index a803f811..18dd2df1 100644
--- a/data/language-specs/mediawiki.lang
+++ b/data/language-specs/mediawiki.lang
@@ -26,19 +26,19 @@
   </metadata>
 
   <styles>
-    <style id="strong-emphasis" name="Strong Emphasis"   map-to="def:statement"/>
-    <style id="light-emphasis"  name="Light Emphasis"    map-to="def:doc-comment-element"/>
+    <style id="strong-emphasis" name="Strong Emphasis"   map-to="def:strong-emphasis"/>
+    <style id="light-emphasis"  name="Light Emphasis"    map-to="def:emphasis"/>
     <style id="signature"       name="Signature"         map-to="def:statement"/>
-    <style id="url"             name="URL"               map-to="def:net-address"/>
-    <style id="link"            name="Link"              map-to="def:comment"/>
-    <style id="link-symbol"     name="Symbol on a Link"  map-to="def:shebang"/>
-    <style id="line"            name="Line"              map-to="def:type"/>
-    <style id="list"            name="List"              map-to="def:statement"/>
+    <style id="url"             name="URL"               map-to="def:link-destination"/>
+    <style id="link"            name="Link"              map-to="def:link-text"/>
+    <style id="link-symbol"     name="Symbol on a Link"  map-to="def:link-symbol"/>
+    <style id="line"            name="Line"              map-to="def:thematic-break"/>
+    <style id="list"            name="List"              map-to="def:list-marker"/>
     <style id="magic-word"      name="Magic Word"        map-to="def:statement"/>
     <style id="table-symbol"    name="Symbol of a Table" map-to="def:statement"/>
-    <style id="preformatted"    name="Preformatted"      map-to="def:identifier"/>
+    <style id="preformatted"    name="Preformatted"      map-to="def:preformatted-section"/>
     <style id="redirect"        name="Redirect"          map-to="def:statement"/>
-    <style id="title"           name="Title"             map-to="def:type"/>
+    <style id="title"           name="Title"             map-to="def:heading"/>
     <style id="template"        name="Template"          map-to="def:statement"/>
   </styles>
 
diff --git a/data/language-specs/rst.lang b/data/language-specs/rst.lang
index 6fe2b55f..fabd260b 100644
--- a/data/language-specs/rst.lang
+++ b/data/language-specs/rst.lang
@@ -27,15 +27,15 @@
   </metadata>
 
   <styles>
-    <style id="header" name="Header" map-to="def:type"/>
-    <style id="emphasis" name="Emphasis" map-to="def:doc-comment-element"/>
-    <style id="strong-emphasis" name="Strong Emphasis" map-to="def:statement"/>
-    <style id="bullet" name="Bullet" map-to="def:preprocessor"/>
+    <style id="header" name="Header" map-to="def:heading"/>
+    <style id="emphasis" name="Emphasis" map-to="def:emphasis"/>
+    <style id="strong-emphasis" name="Strong Emphasis" map-to="def:strong-emphasis"/>
+    <style id="bullet" name="Bullet" map-to="def:list-marker"/>
     <style id="directive" name="Directive" map-to="def:constant"/>
     <style id="comment" name="Comment" map-to="def:comment"/>
-    <style id="link" name="Link" map-to="def:type"/>
+    <style id="link" name="Link" map-to="def:link-text"/>
     <style id="substitution" name="Substitution" map-to="def:type"/>
-    <style id="code" name="Code" map-to="def:identifier"/>
+    <style id="code" name="Code" map-to="def:inline-code"/>
     <style id="url" name="Url" map-to="def:net-address"/>
   </styles>
 
diff --git a/data/styles/classic.xml b/data/styles/classic.xml
index d82110f5..384deac0 100644
--- a/data/styles/classic.xml
+++ b/data/styles/classic.xml
@@ -75,6 +75,20 @@
   <!-- Types -->
   <style name="def:type"                    foreground="green" bold="true"/>
 
+  <!-- Markup -->
+  <style name="def:emphasis"                italic="true"/>
+  <style name="def:strong-emphasis"         foreground="bordeaux" bold="true"/>
+  <style name="def:inline-code"             foreground="cyan"/>
+  <style name="def:insertion"               underline="single"/>
+  <style name="def:deletion"                strikethrough="true"/>
+  <style name="def:link-text"               foreground="blue"/>
+  <style name="def:link-symbol"             foreground="blue" bold="true"/>
+  <style name="def:link-destination"        italic="true" underline="single"/>
+  <style name="def:heading"                 foreground="green" bold="true"/>
+  <style name="def:thematic-break"          foreground="green" bold="true"/>
+  <style name="def:preformatted-section"    foreground="cyan"/>
+  <style name="def:list-marker"             foreground="bordeaux" bold="true"/>
+
   <!-- Others -->
   <style name="def:preprocessor"            foreground="purple"/>
   <style name="def:error"                   background="red" bold="true"/>
diff --git a/data/styles/cobalt.xml b/data/styles/cobalt.xml
index 37a001bb..772becee 100644
--- a/data/styles/cobalt.xml
+++ b/data/styles/cobalt.xml
@@ -97,6 +97,20 @@
   <!-- Types -->
   <style name="def:type"                    foreground="teal_blue"/>
 
+  <!-- Markup -->
+  <style name="def:emphasis"                bold="true"/>
+  <style name="def:strong-emphasis"         foreground="bright_orange"/>
+  <style name="def:inline-code"             foreground="light_grey"/>
+  <style name="def:insertion"               underline="single"/>
+  <style name="def:deletion"                strikethrough="true"/>
+  <style name="def:link-text"               foreground="sky_blue" italic="true"/>
+  <style name="def:link-symbol"             foreground="sky_blue" italic="true"/>
+  <style name="def:link-destination"        underline="single"/>
+  <style name="def:heading"                 foreground="teal_blue"/>
+  <style name="def:thematic-break"          foreground="teal_blue"/>
+  <style name="def:preformatted-section"    foreground="light_grey"/>
+  <style name="def:list-marker"             foreground="bright_orange"/>
+
   <!-- Others -->
   <style name="def:error"                   foreground="white" background="dark_red" bold="true"/>
   <style name="def:warning"                 foreground="white" background="nail_polish_pink"/>
diff --git a/data/styles/kate.xml b/data/styles/kate.xml
index 5b416692..0ddf1f51 100644
--- a/data/styles/kate.xml
+++ b/data/styles/kate.xml
@@ -84,6 +84,20 @@
   <!-- Statements -->
   <style name="def:statement"               bold="true"/>
 
+  <!-- Markup -->
+  <style name="def:emphasis"                bold="true"/>
+  <style name="def:strong-emphasis"         bold="true"/>
+  <style name="def:inline-code"             foreground="dark-blue"/>
+  <style name="def:insertion"               underline="single"/>
+  <style name="def:deletion"                strikethrough="true"/>
+  <style name="def:link-text"               foreground="grey" italic="true" bold="false"/>
+  <style name="def:link-symbol"             foreground="grey" bold="true"/>
+  <style name="def:link-destination"        underline="single"/>
+  <style name="def:heading"                 foreground="dark-blue"/>
+  <style name="def:thematic-break"          foreground="dark-blue"/>
+  <style name="def:preformatted-section"    foreground="dark-blue"/>
+  <style name="def:list-marker"             bold="true"/>
+
   <!-- Others -->
   <style name="def:preprocessor"            bold="true"/>
   <style name="def:note"                    foreground="#BF0303" background="#F7E7E7" bold="true" 
italic="false"/>
diff --git a/data/styles/oblivion.xml b/data/styles/oblivion.xml
index 22909c8d..80a6724f 100644
--- a/data/styles/oblivion.xml
+++ b/data/styles/oblivion.xml
@@ -100,6 +100,20 @@
   <!-- Types -->
   <style name="def:type"                    foreground="chameleon1" bold="true"/>
 
+  <!-- Markup -->
+  <style name="def:emphasis"                italic="true"/>
+  <style name="def:strong-emphasis"         foreground="white" bold="true"/>
+  <style name="def:inline-code"             foreground="skyblue1"/>
+  <style name="def:insertion"               underline="single"/>
+  <style name="def:deletion"                strikethrough="true"/>
+  <style name="def:link-text"               foreground="aluminium4"/>
+  <style name="def:link-symbol"             foreground="aluminium4" bold="true"/>
+  <style name="def:link-destination"        italic="true" underline="single"/>
+  <style name="def:heading"                 foreground="chameleon1" bold="true"/>
+  <style name="def:thematic-break"          foreground="chameleon1" bold="true"/>
+  <style name="def:preformatted-section"    foreground="skyblue1"/>
+  <style name="def:list-marker"             foreground="white" bold="true"/>
+
   <!-- Others -->
   <style name="def:preprocessor"            foreground="plum1"/>
   <style name="def:error"                   foreground="aluminium1" background="scarletred2" bold="true"/>
diff --git a/data/styles/solarized-dark.xml b/data/styles/solarized-dark.xml
index 4b749bd7..16cf7c7f 100644
--- a/data/styles/solarized-dark.xml
+++ b/data/styles/solarized-dark.xml
@@ -81,6 +81,20 @@
   <!-- Types -->
   <style name="def:type"                    foreground="yellow"/>
 
+  <!-- Markup -->
+  <style name="def:emphasis"                italic="true"/>
+  <style name="def:strong-emphasis"         foreground="orange"/>
+  <style name="def:inline-code"             foreground="blue"/>
+  <style name="def:insertion"               underline="single"/>
+  <style name="def:deletion"                strikethrough="true"/>
+  <style name="def:link-text"               foreground="base01"/>
+  <style name="def:link-symbol"             foreground="base01" bold="true"/>
+  <style name="def:link-destination"        italic="true" underline="single"/>
+  <style name="def:heading"                 foreground="yellow"/>
+  <style name="def:thematic-break"          foreground="yellow"/>
+  <style name="def:preformatted-section"    foreground="blue"/>
+  <style name="def:list-marker"             foreground="orange"/>
+
   <!-- Operators -->
   <style name="def:operator"                foreground="green"/>
 
diff --git a/data/styles/solarized-light.xml b/data/styles/solarized-light.xml
index 80688083..e0984ce7 100644
--- a/data/styles/solarized-light.xml
+++ b/data/styles/solarized-light.xml
@@ -80,6 +80,20 @@
   <!-- Types -->
   <style name="def:type"                    foreground="yellow"/>
 
+  <!-- Markup -->
+  <style name="def:emphasis"                italic="true"/>
+  <style name="def:strong-emphasis"         foreground="orange"/>
+  <style name="def:inline-code"             foreground="blue"/>
+  <style name="def:insertion"               underline="single"/>
+  <style name="def:deletion"                strikethrough="true"/>
+  <style name="def:link-text"               foreground="base1"/>
+  <style name="def:link-symbol"             foreground="base1" bold="true"/>
+  <style name="def:link-destination"        italic="true" underline="single"/>
+  <style name="def:heading"                 foreground="yellow"/>
+  <style name="def:thematic-break"          foreground="yellow"/>
+  <style name="def:preformatted-section"    foreground="blue"/>
+  <style name="def:list-marker"             foreground="orange"/>
+
   <!-- Operators -->
   <style name="def:operator"                foreground="green"/>
 
diff --git a/data/styles/tango.xml b/data/styles/tango.xml
index 10084280..4fbd2c33 100644
--- a/data/styles/tango.xml
+++ b/data/styles/tango.xml
@@ -87,6 +87,20 @@
   <!-- Types -->
   <style name="def:type"                    foreground="chameleon3" bold="true"/>
 
+  <!-- Markup -->
+  <style name="def:emphasis"                italic="true"/>
+  <style name="def:strong-emphasis"         foreground="scarletred3" bold="true"/>
+  <style name="def:inline-code"             foreground="skyblue2"/>
+  <style name="def:insertion"               underline="single"/>
+  <style name="def:deletion"                strikethrough="true"/>
+  <style name="def:link-text"               foreground="skyblue3"/>
+  <style name="def:link-symbol"             foreground="skyblue3" bold="true"/>
+  <style name="def:link-destination"        italic="true" underline="single"/>
+  <style name="def:heading"                 foreground="chameleon3" bold="true"/>
+  <style name="def:thematic-break"          foreground="chameleon3" bold="true"/>
+  <style name="def:preformatted-section"    foreground="skyblue2"/>
+  <style name="def:list-marker"             foreground="scarletred3" bold="true"/>
+
   <!-- Others -->
   <style name="def:preprocessor"            foreground="chocolate3"/>
   <style name="def:error"                   background="scarletred2" bold="true"/>
diff --git a/tests/syntax-highlighting/file.md b/tests/syntax-highlighting/file.md
new file mode 100644
index 00000000..a5c3a8a1
--- /dev/null
+++ b/tests/syntax-highlighting/file.md
@@ -0,0 +1,38 @@
+Heading
+=======
+
+## Sub-heading
+
+Paragraphs are separated
+by a blank line.
+
+Two spaces at the end of a line  
+produces a line break.
+
+Text attributes _italic_, 
+**bold**, `monospace`.
+
+Horizontal rule:
+
+---
+
+Bullet list:
+
+  * apples
+  * oranges
+  * pears
+
+Numbered list:
+
+  1. lather
+  2. rinse
+  3. repeat
+
+An [example](http://example.com).
+
+![Image](Icon-pictures.png "icon")
+
+> Markdown uses email-style > characters for blockquoting.
+
+Inline <abbr title="Hypertext Markup Language">HTML</abbr> is supported.
+
diff --git a/tests/syntax-highlighting/file.mediawiki b/tests/syntax-highlighting/file.mediawiki
new file mode 100644
index 00000000..937cd79b
--- /dev/null
+++ b/tests/syntax-highlighting/file.mediawiki
@@ -0,0 +1,355 @@
+= Help:Wikitext examples =
+
+https://meta.wikimedia.org/wiki/Help:Wikitext_examples
+
+== Basic text formatting ==
+
+You can ''italicize'' text by putting 2 apostrophes on ''each'' side. 
+
+3 apostrophes will '''bold''' the text. 
+
+5 apostrophes will '''''bold and italicize''''' the text.
+
+(Using 4 apostrophes doesn't do anything special -- <br /> 3 of them '''bold''' the text as usual; the 
others are ''''just'''' apostrophes around the text.)
+
+----
+
+A single newline generally has no effect on the layout. These can be used to separate sentences within a 
paragraph. Some editors find that this aids editing and improves the ''diff'' function (used internally to 
compare different versions of a page).
+
+But an empty line starts a new paragraph.
+
+When used in a list, a newline ''does'' affect the layout ([[#lists|see below]]).
+
+----
+
+You can break lines<br/>
+without a new paragraph.<br/>
+Please use this sparingly.
+
+Please do not start a link or ''italics'' or '''bold''' text on one line and end on the next.
+
+----
+
+You should "sign" your comments on talk pages:
+* Three tildes gives your signature: ~~~
+* Four tildes give your signature plus date/time: ~~~~
+* Five tildes gives the date/time alone: ~~~~~
+
+
+== HTML tags ==
+
+Put text in a <kbd>monospace ('typewriter') font</kbd>. The same font is generally used for <code>computer 
code</code>.
+
+----
+
+<strike>Strike out</strike> or <u>underline</u> text, or write it <span style="font-variant:small-caps">in 
small caps</span>.
+
+----
+
+Superscripts and subscripts: X<sup>2</sup>, H<sub>2</sub>O
+
+----
+
+<center>Centered text</center>
+* Please note the American spelling of "center".
+
+----
+
+* This is how to {{Font color||yellow|highlight part of a sentence}}.
+
+----
+
+<blockquote>
+The '''blockquote''' command ''formats'' block quotations, typically by surrounding them with whitespace and 
a slightly different font.
+</blockquote>
+
+----
+
+Invisible comments to editors (<!-- -->) appear only while editing the page.
+<!-- Note to editors: blah blah blah. -->
+
+
+== Organizing your writing ==
+
+== Section headings ==
+
+''Headings'' organize your writing into sections. The ''Wiki'' software can automatically generate a 
[[help:Section|table of contents]] from them.
+
+=== Subsection ===
+Using more "equals" (=) signs creates a subsection.
+
+==== A smaller subsection ====
+
+Don't skip levels, like from two to four equals signs.
+
+Start with 2 equals signs, not 1. If you use only 1 on each side, it will be the equivalent of h1 tags, 
which should be reserved for page titles.
+
+----
+
+* ''Unordered lists'' are easy to do:
+** Start every line with a asterisk.
+*** More asterisks indicate a deeper level.
+*: Previous item continues.
+** A newline
+* in a list
+marks the end of the list.
+*Of course you can start again.
+
+----
+
+# ''Numbered lists'' are:
+## Very organized
+## Easy to follow
+A newline marks the end of the list.
+# New numbering starts with 1.
+
+----
+
+Here's a ''definition list'':
+; Word : Definition of the word
+; A longer phrase needing definition
+: Phrase defined
+; A word : Which has a definition
+: Also a second definition
+: And even a third
+
+Begin with a semicolon. One item per line; a newline can appear before the colon, but using a space before 
the colon improves parsing.
+
+----
+
+* You can even do mixed lists
+*# and nest them
+*# inside each other
+*#* or break lines<br>in lists.
+*#; definition lists
+*#: can be 
+*#:; nested : too
+
+----
+
+: A colon (:) indents a line or paragraph.
+A newline starts a new paragraph.
+Should only be used on talk pages.
+For articles, you probably want the blockquote tag.
+: We use 1 colon to indent once.
+:: We use 2 colons to indent twice.
+::: 3 colons to indent 3 times, and so on.
+
+----
+
+You can make ''horizontal dividing lines'' (----) to separate text.
+----
+But you should usually use sections instead, so that they go in the table of contents.
+
+----
+
+You can add footnotes to sentences using the ''ref'' tag -- this is especially good for citing a source.
+
+:There are over six billion people in the world.<ref>CIA World Factbook, 2006.</ref>
+
+References: <references/>
+
+For details, see [[Wikipedia:Footnotes]] and [[Help:Footnotes]].
+
+
+== Links ==
+
+Here's a link to a page named [[Official positions|Official position]]. You can even say [[official 
positions]] and the link will show up correctly.
+
+----
+
+You can put formatting around a link. Example: ''[[Wikipedia]]''.
+
+----
+
+The ''first letter'' of articles is automatically capitalized, so [[wikipedia]] goes to the same place as 
[[Wikipedia]]. Capitalization matters after the first letter.
+
+----
+
+[[Intentionally permanent red link]] is a page that doesn't exist yet. You could create it by clicking on 
the link.
+
+----
+
+You can link to a page section by its title:
+
+* [[Doxygen#Doxygen Examples]].
+
+If multiple sections have the same title, add a number. [[#Example section 3]] goes to the third section 
named "Example section".
+
+----
+
+You can make a link point to a different place with a [[Help:Piped link|piped link]]. Put the link
+target first, then the pipe character "|", then the link text.
+
+* [[Help:Link|About Links]]
+* [[List of cities by country#Morocco|Cities in Morocco]]
+
+Or you can use the "pipe trick" so that a title that contains disambiguation text will appear with more 
concise link text.
+
+* [[Spinning (textiles)|]]
+* [[Boston, Massachusetts|]]
+
+----
+
+You can make an external link just by typing a URL: http://www.nupedia.com
+
+You can give it a title: [http://www.nupedia.com Nupedia]
+
+Or leave the title blank: [http://www.nupedia.com]
+
+External link can be used to link to a wiki page that cannot be linked to with <nowiki>[[page]]</nowiki>: 
http://meta.wikimedia.org/w/index.php?title=Fotonotes&oldid=482030#Installation
+
+----
+
+Linking to an e-mail address works the same way: mailto:someone example com or [mailto:someone example com 
someone]
+
+----
+
+#REDIRECT [[Official positions|Official position]]
+
+----
+
+[[Help:Category|Category links]] do not show up in line but instead at page bottom ''and cause the page to 
be listed in the category.''
+[[Category:English documentation]]
+
+Add an extra colon to ''link'' to a category in line without causing the page to be listed in the category:
+[[:Category:English documentation]]
+
+----
+
+The Wiki reformats linked dates to match the reader's date preferences. These three dates will show up the
+same if you choose a format in your [[Special:Preferences|]]:
+* [[1969-07-20]]
+* [[July 20]], [[1969]]
+* [[20 July]] [[1969]]
+
+
+== Just show what I typed ==
+
+<nowiki>
+The nowiki tag ignores 
+[[Wiki]] ''markup''.
+It reformats text by 
+removing
+newlines    and multiple
+ spaces.
+It still interprets special
+characters: &rarr;
+</nowiki>
+
+----
+
+<pre>
+The pre tag ignores [[Wiki]]
+ ''markup''.
+It also doesn't     reformat
+ text.
+It still interprets special
+characters: &rarr;
+</pre>
+
+----
+
+Leading spaces are another way
+to preserve formatting.
+
+ Putting a space at the
+ beginning of each
+ line stops the text
+ from being
+ reformatted.  It still 
+ interprets [[Wiki]]
+ ''markup'' and special
+ characters: &rarr;
+
+=== Source code ===
+
+<source lang="csharp">
+// Hello World in Microsoft C# ("C-Sharp").
+
+using System;
+
+class HelloWorld
+{
+    public static int Main(String[] args)
+    {
+        Console.WriteLine("Hello, World!");
+        return 0;
+    }
+}
+</source>
+
+
+== Images, tables, video, and sounds ==
+
+A picture, including alternate text:
+
+[[Image:Wiki.png|This is Wiki's logo]]
+
+You can put the image in a frame with a caption: [[Image:Wiki.png|frame|This is Wiki's logo]]
+
+----
+
+A link to Wikipedia's page for the image: [[:Image:Wiki.png]]
+
+Or a link directly to the image itself: [[Media:Wiki.png]]
+
+----
+
+Use '''media:''' links to link directly to sounds or videos: [[media:Classical guitar scale.ogg|A sound 
file]]
+
+----
+
+Provide a spoken rendition of some text in a template:
+{{listen
+ |title    = Flow, my tears
+ |filename = Flow, my tears.ogg
+ |filesize = 1.41 MB
+}}
+
+----
+
+<span style="border:5px double black">'''Text In a Box'''</span>
+
+----
+
+{| border="10" cellspacing="5" cellpadding="10" align="center"
+|-
+! This
+! is
+|- 
+| a
+| table
+|}
+
+=== Galleries ===
+
+<gallery>
+Image:Wiki.png
+Image:Wiki.png|Captioned
+Image:Wiki.png
+Image:Wiki.png|[[Wikipedia|Links]] can be put in captions.
+</gallery>
+
+
+== Mathematical formulae ==
+
+<math>\sum_{n=0}^\infty \frac{x^n}{n!}</math>
+
+
+== Templates ==
+
+{{Transclusion demo}}
+
+----
+
+{{Help:Transclusion Demo}}
+
+----
+
+This template takes two parameters, and creates underlined text with a hover box for many modern browsers 
supporting CSS:
+
+{{H:title|This is the hover text|Hover your mouse over this text}}
+
+Go to this page to see the H:title template itself: {{tl|H:title}}
+


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]