Alpine Linux:Markup syntax

From Alpine Linux
Revision as of 06:40, 24 March 2012 by Dubiousjim (talk | contribs) (Expand page from Dubiousjim's Cheatsheet)

Inline elements

  • ''italic''; or use i or em or {font-style:italic}
  • '''bold'''; or use b or strong or {font-weight:bold}
  • '''''bold and italic'''''
  • small or {font-size:smaller}
  • big or {font-size:larger} (invalid in HTML5)
  • sup or {vertical-align:super}
  • sub or {vertical-align:sub}
  • <font> is deprecated; use {font-size:10pt; color:red; font-family:"Courier"}
  • <span style="color:gray">
  • <span style="color:white; background:red">
  • u or ins or {text-decoration:underline} (<u> valid in HTML5 but not HTML4/strict; <ins> can also be a block element)
  • s or del or {text-decoration:line-through} (<s> valid in HTML5 but not HTML4/strict; <del> can also be a block element)
  • code uses {font-family:monospace;} (<tt> is invalid in HTML5)
    markup and → entities are still honored
  • and and and are ignored
  • var
  • cite
  • {{Hint|term|explanation}}
  • {{Path|/a/path/name}}
  • {{Key| Ctrl}}+{{Key| C}}


Links

Here is [[Wiki pagetitle|a wiki page]]: a wiki page. Text immediately suffixing the link will be incorporated into the link text; separate with <nowiki /> to suppress.

TODO: Pkg

Here is an Alpine Issue link {{Issue|279}}: #279. The issue's description can be included as an optional second argument.

Here is [http://www.example.org/ an external link]: an external link. If no link text is supplied: [1]. Omit brackets for http://www.example.org/ (use <nowiki> to suppress).

[mailto:info@example.org?Subject=URL%20Encoded%20Subject&body=Body%20Text info].

In Talk pages, -- ~~~~ gives a signature and timestamp: -- Dubiousjim 10:00, 4 March 2012 (UTC)



Headings

Start headings at level 2, and don't skip levels.

== Heading2 ==

will produce:

Heading2

=== Heading3 ===

will produce:

Heading3

==== Heading4 ====

will produce:

Heading4


{{Delete|Message.}}</nowiki>
will produce:
{{subst:Delete|Message.}}

<pre>{{Obsolete|Alternate message.}}</nowiki>
will produce:
{{subst:Obsolete|Alternate message.}}

<pre>{{Merge|Page to merge with|Additional message.}}

will produce:

This material is proposed for merging ...

It should be merged with Page to merge with. Additional message. (Discuss)

{{Move|New page name|Reason.}}

will produce:

This page is proposed for moving ...

It should be renamed to New page name. Reason. (Discuss)

{{Draft|Alternate message.}}

will produce:

This material is work-in-progress ...

Alternate message. (Last edited by Dubiousjim on 24 {{{03}}} 2012.)

{{Expand|Alternate message.}}

will produce:

This material needs expanding ...

Alternate message.


Block elements

This material is work-in-progress ...


(Last edited by Dubiousjim on 24 Mar 2012.)


{{Cmd|a <var>command</var> to try}} --- essentially, this is block-level (which is ignored)


Contents of /path/file

{{Cat|/path/file|body}} '''text''' <br /> more Second line. You must escape characters as follows: = not inside [[..]] use &#61; or {{=}} | not inside [[..]] use &#124; or {{!}} {{ use &#123; twice or {{lb}} }} use &#125; twice or {{rb}} unmatched [[ use &#91; twice unmatched ]] use &#93; twice


<nowiki> converts → entities and collapses whitespace (even multiple \ns), but ignores all '''wiki''' and <span style="color:green">HTML</span> [[markup]].

HTML's <pre> uses {white-space:pre; font-family:monospace;} To wrap to screen width, use <pre style="white-space:pre-wrap">

In wiki, one leading space displays as block element, in monospace, doesn't collapse whitespace.
Converts → entities and honors wiki and HTML markup.
? Can contain any inline element except: IMG OBJECT BIG SMALL SUP SUB
--- essentially, this and <pre> are block-level  (which is ignored), or a <code> snippet
whereas {{Cat}} is mainly intended to display a whole file.
A session script, with prompts and stdout, should be formatted like this (or with <pre>) instead of
using {{Cmd}}.
In wiki, <pre> displays as block element, in monospace, doesn't collapse whitespace.
Otherwise like <nowiki>: it converts → entities, but ignores '''wiki''' and <span style="color:green">HTML</span> [[markup]].
One leading space plus <nowiki> is same as <pre> (in this case, subsequent lines should not be space-prefixed; block will extend to closing </nowiki>)
: Simply indented text (on left side only).

This is <blockquote>. Collapses whitespace, and indents on both sides.

  1. Here is a numbered list item.
    1. Doubly-numbered
  • Here is a bulleted list item.
    • Doubly-bulleted

Blank lines, or non-bulleted/numbered lines, end the lists.

;item : Body text

or {{Define|item|Body text}} produce:

item
Body text



Heading: {{Box|Heading:|Body}}
Heading: {{Box|Heading:|Body then border-color then background-color|#DF0000|#FFDFDF}}
Tip: {{Tip|Write your Tip here.}}
Note: {{Note|Write your Note here.}}
Warning: {{Warning|Write your Warning here.}}


Todo: {{Todo|Write your Todo here.}}



Tables

This material is work-in-progress ...


(Last edited by Dubiousjim on 24 Mar 2012.)

{|  border="1" style="width:75%; height:200px"  <!-- align=right makes table float -->
|+ The table's caption
|-
! width=100px | columnlabel 1
! columnlabel 2 !! columnlabel 3
|-
! rowlabel1
| Cell 1 || Cell 2 || Cell 3
|- style="height:100px; background:none" <!-- or style="background:transparent" -->
| align=right style="width:200px" | Cell A 
| style="background:red; color:white" | Cell B
| colspan=2 align=center | Cell C
|- valign=top <!-- have to be applied to every row, default is valign=middle; or use style="vertical-align:top;" -->
| rowspan=2 Cell D
| ...
|}


See also:


Images

This material is work-in-progress ...


(Last edited by Dubiousjim on 24 Mar 2012.)

[[File:Alpinelinux 01.png|right|thumb|100px|Caption text]] gives:

Caption text

Options can appear in any order:

  • Caption text defaults to filename; to wholly suppress, use <span title=""></span>
  • alt=text
  • Size can be [width][xheight]px
  • page=number, for PDF images
  • rendered inline, Caption shows as hover text: frameless, and/or border
    • rendered inline, on separate line: none
    • Valign for inline images, defaults to middle: middle|baseline|sub|super|top|text-top|bottom|text-bottom
    • Text flow can be stopped by placing {{Clear}} before the text that should start below the floating image
    • link=URL|pagetitle|blank, only for inline images
  • rendered floating, defaults to right align, Caption displayed below image: thumb, thumb=alternate filename, frame (ignores size options)
    • rendered floating, defaults to thumb: left|right|center

To instead link to the file, you need to add a colon: File:Alpinelinux 01.png.

See also:


Other

Every page should be assigned at least one Category, by placing the following at the bottom of the page:

[[Category:Category name]]

To link to a Category page, without adding the linking page to the category: [[:Category:Not in this category]]


A redirect page should contain only:

#REDIRECT [[pagename]]


FIXME

Here is one line, followed by <br />
and another line.

Here is <!-- a comment -->.

HR like this
----


 


See also

There may be small divergences, but in general, ours seems to be just a standard MediaWiki installation.