User:Prabuanand/Editing: Difference between revisions
Prabuanand (talk | contribs) (Formatted heading levels and reduced repetition) |
Prabuanand (talk | contribs) (changed the heading name by removing "/") |
||
Line 36: | Line 36: | ||
To experiment with markup, use [[Sandbox]]. | To experiment with markup, use [[Sandbox]]. | ||
=== Moving | === Moving or renaming pages === | ||
* If the move might be controversial, [[#move|propose it first]] and try to resolve any disagrements on the discussion page. | * If the move might be controversial, [[#move|propose it first]] and try to resolve any disagrements on the discussion page. | ||
Line 42: | Line 42: | ||
* Use the "What links here" link in the sidebar, and be sure to update all links to internal page targets. If this isn't done, double redirects are created. (That's where a redirect leads to a redirect, and in such cases only the first redirect is followed automatically.) | * Use the "What links here" link in the sidebar, and be sure to update all links to internal page targets. If this isn't done, double redirects are created. (That's where a redirect leads to a redirect, and in such cases only the first redirect is followed automatically.) | ||
* In the default wiki skin, the link to Move pages (and also to Watch them) is in the popup menu between "View history" and the Search box. | * In the default wiki skin, the link to Move pages (and also to Watch them) is in the popup menu between "View history" and the Search box. | ||
* Always move the discussion page, too, unless you have a very good reason for not doing so. | * Always move the discussion page, too, unless you have a very good reason for not doing so. | ||
=== Deleting pages === | === Deleting pages === |
Revision as of 06:55, 13 December 2024
Alpine Linux Wiki is powered by MediaWiki, a free software wiki package written in PHP, originally designed for use on Wikipedia. There may be small divergences, but in general, this wiki is a standard MediaWiki installation. More in-depth help can be found at MediaWiki and Wikipedia help pages.
This is a short tutorial about editing the Alpine Linux Wiki. Before editing or creating pages, users are encouraged to familiarize themselves with the general tone, layout, and style of existing articles. An effort should be made to maintain a level of consistency throughout the wiki. See Wiki Etiquette, Help:Reading and Help:Style for an overview of the common conventions followed in Alpine Linux Wiki.
To experiment with editing, please use the sandbox. For an overview of wiki markup, see Help:Cheatsheet.
Editing
Edit or add text so that wiki pages are clear and concise. Make sure you are always aiming to do something which improves the contents of the wiki.
- Click the
Edit
page tab at the top of the page. Make changes to the text. When you need to use some type of formatting, such as for new headings or bolding of text, you do this using wiki syntax or the buttons in the edit toolbar above the editing zone. - Before you save a change, you must enter a short note in the
Summary
box describing your changes. - Mark the edit as minor by checking the
This is a minor edit
box if the edit is fixing a typo or a spelling mistake. - It's a good idea to use the
Show preview
button to see what your change will look like, before you save it. It's good to get into the habit of eliminating mistakes in your own work, by using a preview before saving, rather than saving, then having to do another edit just to make one or more minor corrections. - Another option is the "
Show changes
" button which allows you to see the differences between the current version and the edited version. - Click the "
Save Changes
" button to save changes. If unsatisfied, click Cancel instead and redo again.
Creating pages
Starting a page
There are 2 ways to start a new page:
- Create a
[[Title for new page]]
link on an existing page and click save. Open page again and the click red colored Title for new page link will take you to the edit page for the new page. (Recommended) - Type the URL for new page with proper
[[Title for new page]]
into the address bar. For example: http://wiki.alpinelinux.org/wiki/Title_for_new_page.
In both the above cases, Simply type your text in the new page, save and the new page will be created. New pages should be assigned at least one catgeory. Tutorials should also be added to Tutorials and Howtos, or if it concerns Alpine development, to Developer Documentation.
Temporary pages
If you wish to create a temporary page, please use a subpage of your User namespace. For example: User:Username/Temporary page. This helps to keep the main namespace tidy and prevents the pages from turning up in normal searches (the User namespace is not searched by default).
To experiment with markup, use Sandbox.
Moving or renaming pages
- If the move might be controversial, propose it first and try to resolve any disagrements on the discussion page.
- The new name must either not exist as a page, or exist as a redirect page with only 1 entry in its page history.
- Use the "What links here" link in the sidebar, and be sure to update all links to internal page targets. If this isn't done, double redirects are created. (That's where a redirect leads to a redirect, and in such cases only the first redirect is followed automatically.)
- In the default wiki skin, the link to Move pages (and also to Watch them) is in the popup menu between "View history" and the Search box.
- Always move the discussion page, too, unless you have a very good reason for not doing so.
Deleting pages
Only administrators can delete pages. Other users should instead use {{Delete}}
to propose the page for deletion. (Don't clear the page's content except where it's obviously spam.)
Formatting
Inline elements
- ''italic'' or use <i> or <em> or {font-style:italic} in a style attribute
- '''bold''' or use <b> or <strong> or {font-weight:bold} in a style attribute
- <small> or use {font-size:smaller} in a style attribute
- <big> or use {font-size:larger} in a style attribute (invalid in HTML5)
- <sup> or use {vertical-align:super} in a style attribute
- <sub> or use {vertical-align:sub} in a style attribute
- <font> is deprecated; use {font-size:10pt; color:red; font-family:"Courier"} in a style attribute
- <span style="color:gray">
- <span style="color:white; background:red">
- <u> or use <ins> or {text-decoration:underline} in a style attribute (<u> is valid in HTML5 but not HTML4/strict; <ins> can also be a block element)
<s>or use<del>or {text-decoration:line-through} in a style attribute (<s> is 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
- See also below
- <kbd> and <samp>
- <var> and <dfn>
- <cite>
<q>
- {{Hint|term|explanation}}
- {{Path|/a/path/name}}
- {{Key| Ctrl}}+{{Key| C}}
- Here is one line, followed by <br />
and another line.
- Here is <!-- a comment -->.
Headings
An article with 4 or more headings automatically creates a table of contents. You can force a table of contents (or fine-tune its placement) by inserting __TOC__. You can suppress the table of contents by inserting __NOTOC__.
Start headings at level 2, and don't skip levels. First-level headings are not allowed, their formatting is reserved for the article title.
== Heading2 ==
=== Heading3 ===
==== Heading4 ====
Lists
# Here is a numbered list item. ## Doubly-numbered #* Numbered and bulleted. * Here is a bulleted list item. ** Doubly-bulleted *# Bulleted and numbered. *# Another item.
will produce:
- Here is a numbered list item.
- Doubly-numbered
- Numbered and bulleted.
- Here is a bulleted list item.
- Doubly-bulleted
- Bulleted and numbered.
- Another item.
Blank lines, or non-bulleted/numbered lines, end the lists. You can also code a list manually, which gives you more flexibility with multi-line entries and styling:
<ol start=2> <li>Ordered list item <li value=4>Another item <li type="disc"><p>A third item</p><p>Next line</p> </ol>
and similarly for <ul>
. Closing </li>
tags are permitted but not necessary.
Each of these:
;item: Body text {{Define|item|Body text}} <dl> <dt>item <dd>Body text </dl>
will produce:
- item
- Body text
The second markup option also wraps a <span id="item">
around the block. Note that with the third option, you shouldn't use closing </dt>
or </dd>
tags.
Indenting
: Simply indented text (on left side only). <blockquote>This is a blockquote. It collapses whitespace, and indents on both sides.</blockquote>
will produce:
- Simply indented text (on left side only).
This is a blockquote. It collapses whitespace, and indents on both sides.
Displaying code
- Inline code
- Use
<code>
for styling, and<nowiki>
to suppress markup. If you use both, they must appear in that order.<nowiki>
converts → entities and collapses whitespace (even multiple\n
s), but ignores all '''wiki''' and<span style="color:green">
HTML</span>
[[markup]]. - User input
{{Cmd|a <var>command</var> to try}}
This is a block-level equivalent for the inline HTML element
<kbd>
. Note that wiki markup is still honored in the command text; but whitespace is not collapsed. See below for how to escape some special characters.
- Command output; or shell sessions that intermix prompts, user input, and command output; or segments of files
- Use space-indented blocks or
<pre>
:Every line begins with '''a space'''. <pre> Lines aren't indented with '''a space.''' </pre> <nowiki>Only first line begins with '''a space'''.</nowiki>
will produce:
Every line begins with a space.
Lines aren't indented with '''a space.'''
Only first line begins with '''a space'''.
All of these render as styled blocks, in monospace, and don't collapse whitespace. They are block-level equivalents for the inline HTML elements
<samp>
or<code>
.All of these markup options convert → entities. The first also processes '''wiki''' and <span style="color:green">HTML</span> [[markup]]. The second and the third don't; and they give equivalent presentations. With the third option, lines after the first should not be space-prefixed; the block will extend to the closing
</nowiki>
. - File contents
{{Cat|/path/to/file|body '''text''' <br /> more Second line.}}
will produce:
Contents of /path/to/file
body '''text''' <br /> more Second line.Note that wiki and HTML markup in the file contents aren't converted, though entities still are. You must escape characters as follows:
- = not inside [[..]] use = or {{=}}
- | not inside [[..]] use | or {{!}}
- {{ use { twice or {{lb}}
- }} use } twice or {{rb}}
- unmatched [[ use [ twice
- unmatched ]] use ] twice
- # at start of line use #
- * at start of line use *
As an alternative to all of these escapes, you could instead wrap the body in <nowiki> tags.
- Block-level code with no additional styling
<p style="white-space:pre; font-family:monospace;">One line. Second line. </p>
will produce:
One line. Second line.
This would be the behavior of HTML's
<pre>
without any styling. To wrap to screen width, use {white-space:pre-wrap} in a style attribute.
Tables
Tables may be created in wiki pages. As a general rule, it is best to avoid using a table unless you need one as table markup often complicates page editing.
Simple table
In wikitext editor, place the caret where you want to insert a table. Then, in the toolbar, press “Advanced”, then choose Table button. A dialog opens.
From the dialog, you can choose whether to enable a table header row, to stylize the table with border and to make the table sortable. A preview example is displayed. You can also set row and column counts you need. Then, press “Insert” button.
{| class="wikitable" |+ Optional Caption text |- ! Header 1 !! Header 2 !! Header 3 |- | 1.1 || 1.2 || 1.3 |- | 2.1 || 2.2 || 2.3 |- | 3.1 || 3.2 || 3.3 |}
The above code can also be created manually as follows:
{| class="wikitable" |+ Optional Caption text |- ! Header 1 ! Header 2 ! Header 3 |- | 1.1 | 1.2 | 1.3 |- | 2.1 | 2.2 | 2.3 |- | 3.1 | 3.2 | 3.3 |}
Header 1 | Header 2 | Header 3 |
---|---|---|
1.1 | 1.2 | 1.3 |
2.1 | 2.2 | 2.3 |
3.1 | 3.2 | 3.3 |
Advanced table
You can add HTML attributes to tables. CSS style attributes can be added with or without other HTML attributes. Table alignment is achieved by using CSS. For more information, refer official mediawiki guide on tables:
{| 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 | ... |}
columnlabel 1 | columnlabel 2 | columnlabel 3 | |
---|---|---|---|
rowlabel1 | Cell 1 | Cell 2 | Cell 3 |
Cell A | Cell B | Cell C | |
rowspan=2 Cell D | ... |
See also:
Images
Basic example is given below. For more information, refer official mediawiki guide on Images
[[File:Alpinelinux 01.png|right|thumb|100px|Caption text]]
will produce:
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.
Signature
In Talk pages, -- ~~~~ gives a signature and timestamp: -- Dubiousjim 10:00, 4 March 2012 (UTC)
Other elements
Create HRs like this:
----
Links
Links are used to reference pages within this wiki, other Alpine Linux websites, or external websites.
Internal links
Here is [[Kernels|Linux Kernel wiki page]]: Linux Kernel wiki page.
When you preview or save your changes, you will see a link that can be followed to the target page. If the page exists the link is displayed in blue (like the word "Linux Kernel wiki page" above); if the page does not exist, the link appears red. Following such a "redlink" to a missing page (whether or not it is actually red) will usually enable the user to create the page.
Special links
For official packages in Repositories: Here is {{Pkg|gtk+2.0}}: gtk+2.0.
For existing Issues in aports: Here is {{Issue|279}}: #279. The issue's description can be included as an optional second argument.
For existing Merge Requests in aports: Here is {{MR|73024}}: !73024. The MR's description can be included as an optional second argument.
External links
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).
Categories
Categories provide automatic indexes that are useful as tables of contents. These tags create links at the bottom of the page that take you to the list of all pages in that category, which makes it easy to browse related articles. Every page should be assigned at least one Category, by placing the following at the bottom of the page:
[[Category:Category name]]
[[:Category:Not in this category]]
To avoid extra work, try searching within your wiki before creating a new category. The list of all categories can also be found in "Special pages" in the "tools" box of the sidebar.
Redirect
A redirect page should contain only:
#REDIRECT [[pagename]]
Templates
MediaWiki recognizes certain special strings within an article that alter standard behavior. For example, adding the word __NOTOC__
anywhere in an article will prevent generation of a table of contents. Similarly, the word __TOC__
can be used to alter the default position of the table of contents. See Help:Magic words for details.
Templates and variables are predefined portions of wikitext that can be inserted into an article to aid in formatting content.
Templates are user-defined variables. Refer full list of templates defined in Alpine Linux wiki. Given below are some commonly used templates.
{{Delete|Message.}}
will produce:
This material is proposed for deletion ... Message.
(Discuss) |
{{Obsolete|Alternate message.}}
will produce:
This material is obsolete ... Alternate message. (Discuss) |
{{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. |
{{Expand|Alternate message.}}
will produce:
This material needs expanding ... Alternate message. |
{{Style|Alternate message.}}
will produce:
This material needs wiki syntax or style improvements ... Alternate message. |