Difference between revisions of "Help:Editing"
m |
|||
(9 intermediate revisions by the same user not shown) | |||
Line 4: | Line 4: | ||
{{Vspace}} | {{Vspace}} | ||
− | <section begin= | + | <section begin=Wiki-editing /> |
<div class="note"> | <div class="note"> | ||
Line 61: | Line 61: | ||
:To start editing a Wiki page, click on the "'''Edit'''" link at one of its edges. This will bring you to the '''edit page''': a page with a text box containing the ''wikitext'': the editable source code from which the server produces the webpage. | :To start editing a Wiki page, click on the "'''Edit'''" link at one of its edges. This will bring you to the '''edit page''': a page with a text box containing the ''wikitext'': the editable source code from which the server produces the webpage. | ||
− | ''If you just want to experiment, please do so in the [[Sandbox|sandbox page]], not here''. | + | <!-- ''If you just want to experiment, please do so in the [[Sandbox|sandbox page]], not here''. --> |
;Preview before saving | ;Preview before saving | ||
Line 178: | Line 178: | ||
|- | |- | ||
| | | | ||
− | + | You can use normal HTML character codes for special characters such as > < & ° Å Ä ü →<br/> | |
− | + | ... but modern browsers will handle Unicode well enough: > < & ° Å → 烦死了! (¬A)⊕A | |
− | > < & ° Å Ä ü → | ||
|<pre><nowiki> | |<pre><nowiki> | ||
− | + | You can use normal HTML character codes for special characters such as &gt; &lt; &amp; &deg; &Aring; &Auml; &uuml; &rarr; | |
− | + | ... but modern browsers will handle Unicode well enough: > < & ° Å → 烦死了! (¬A)⊕A | |
− | &gt; &lt; &amp; &deg; &Aring; &Auml; &uuml; &rarr; | ||
</nowiki></pre> | </nowiki></pre> | ||
|- | |- | ||
| | | | ||
− | You can use <b>HTML tags</b>, too, if you | + | You can use <b>HTML tags</b>, too, if you want. Some useful ways to use HTML: |
− | want. Some useful ways to use HTML: | + | |
+ | Put text in a <tt>typewriter font</tt>. The same font is generally used for <code>computer code</code>. | ||
− | + | <strike>Strike out</strike> or <u>underline</u> text, write <span style="font-variant:small-caps"> in small caps</span>, <span style="background-color: #FFFFAA;">highlight</span>, or <span style="color: #DD0000;">color</span> for emphasis. | |
− | |||
− | < | ||
− | < | + | Superscripts and subscripts: x<sup>2</sup>, x<sub>2</sub> |
− | |||
− | < | ||
− | |||
− | + | Invisible comments that only appear while editing the page. | |
− | + | <!-- Note to editors: Be kind! --> | |
− | |||
− | |||
− | |||
|<pre><nowiki> | |<pre><nowiki> | ||
You can use <b>HTML tags</b>, too, if you | You can use <b>HTML tags</b>, too, if you | ||
Line 214: | Line 205: | ||
<code>computer code</code>. | <code>computer code</code>. | ||
− | <strike>Strike out</strike> or | + | <strike>Strike out</strike> or <u>underline</u> text, write |
− | <u>underline</u> text, | + | <span style="font-variant:small-caps"> in small caps</span>, |
− | <span style="font-variant:small-caps"> | + | <span style="background-color: #FFFFAA;">highlight</span>, or |
− | in small caps</span>. | + | <span style="color: #DD0000;"> color</span> for emphasis. |
Superscripts and subscripts: | Superscripts and subscripts: | ||
Line 224: | Line 215: | ||
Invisible comments that only appear | Invisible comments that only appear | ||
while editing the page. | while editing the page. | ||
− | <!-- Note to editors: | + | <!-- Note to editors: Be kind! --> |
</nowiki></pre> | </nowiki></pre> | ||
|} | |} | ||
Line 231: | Line 222: | ||
However: I never use Wiki-table markup. I find it less intuitive than HTML markup, more difficult to debug, and there's really no point in remembering both types of markup given that one really needs to be comfortable with HTML tables anyway. | However: I never use Wiki-table markup. I find it less intuitive than HTML markup, more difficult to debug, and there's really no point in remembering both types of markup given that one really needs to be comfortable with HTML tables anyway. | ||
+ | |||
+ | |||
+ | {{Vspace}} | ||
== Links == | == Links == | ||
Line 297: | Line 291: | ||
|} | |} | ||
− | '''Note:''' remember: ''internal links'' (using <nowiki>[[...]]</nowiki> tags to link to pages '''on this Wiki''') are separated from linked text with a pipe character. ''External links'' (using <nowiki>[...]</nowiki> tags to link to pages '''elsewhere on the Internet''') are separated from linked text with a space character. | + | |
+ | '''Note:''' remember: | ||
+ | * ''internal links'' (using <nowiki>[[...]]</nowiki> tags to link to pages '''on this Wiki''') are separated from linked text with a pipe character: <code>[[URL<span style="color:#DD0000;">|</span>text]]</code>. | ||
+ | * ''External links'' (using <nowiki>[...]</nowiki> tags to link to pages '''elsewhere on the Internet''') are separated from linked text with a space character: <code>[URL text]</code>. | ||
+ | |||
+ | {{Vspace}} | ||
+ | |||
+ | ===Special syntax=== | ||
+ | |||
+ | Two special syntax items need to be mentioned: "templates" and "magic words": | ||
+ | |||
+ | ;Templates | ||
+ | :Templates are pieces of Wikitext that are substituted where a code that links to them has been placed into a page. For example, if you enter <code><nowiki>{{Lorem}}</nowiki></code> on a page, the "Lorem ipsum dolor sit amet ..." placeholder text is inserted in place of that code. Wikis make '''extensive''' use of templates. | ||
+ | |||
+ | ;Magic words | ||
+ | :some reserved "magic"-words are replaced with dynamically created contents when the page is rendered. For example <code><nowiki>__TOC__</nowiki></code> forces placing a Table Of Contents at the position of this token rather than its default position, while <code><nowiki>__NOTOC__</nowiki></code> suppresses creation of a Table Of Contents on a page. | ||
{{Vspace}} | {{Vspace}} | ||
Line 304: | Line 313: | ||
To create a new page simply insert a link to a Wiki page, which has a page name that does not exist yet. The link will appear in red (except if you inadvertently used the name of a page that already exists), and the new page will be created when you click on the link. Page names can be long and contain blank spaces. Internally, all blank spaces are converted to underscore characters, but you can use the page name without underscores in links; the Wiki software translates this for you. | To create a new page simply insert a link to a Wiki page, which has a page name that does not exist yet. The link will appear in red (except if you inadvertently used the name of a page that already exists), and the new page will be created when you click on the link. Page names can be long and contain blank spaces. Internally, all blank spaces are converted to underscore characters, but you can use the page name without underscores in links; the Wiki software translates this for you. | ||
+ | |||
+ | {{Vspace}} | ||
===Namespaces=== | ===Namespaces=== | ||
Line 315: | Line 326: | ||
*<code>Special:</code> - pages that implement special functionality (like login, user lists, or lists of recently changed pages); | *<code>Special:</code> - pages that implement special functionality (like login, user lists, or lists of recently changed pages); | ||
*<code>Category:</code> - an index of pages that have been given a common tag. This is a convenient way to access pages that are in some way related; | *<code>Category:</code> - an index of pages that have been given a common tag. This is a convenient way to access pages that are in some way related; | ||
+ | |||
+ | |||
+ | {{Vspace}} | ||
===Categories=== | ===Categories=== | ||
− | Once your page has been edited, you can associate it with one or more '''categories'''. | + | Once your page has been edited, you can associate it with one or more '''categories'''. For example, add the appropriate category tag by typing <code><nowiki>[[Category:BCH441_2020]]</nowiki></code>. The page is then automatically linked from a page that collects all pages with that category tag. I would prefer that you do not create new categories; ask me if you feel a need for it. |
{{Vspace}} | {{Vspace}} | ||
Line 349: | Line 363: | ||
====References and footnotes==== | ====References and footnotes==== | ||
− | Enclosing text in <code><nowiki><ref> ... <\ref></nowiki></code> tags will create a footnote reference and display the text wherever you place a <code><nowiki><references /></nowiki></code> tag on the page. | + | Enclosing text in <code><nowiki><ref> ... <\ref></nowiki></code> tags will create a footnote reference and display the text wherever you place a <code><nowiki><references /></nowiki></code> tag on the page.<ref>This is what the link looks like - and as you can see if you hover over it, the reference gets displayed as hover-text.</ref> The reference will display as hover-text, so you can keep your references organized in one section of the page, but your in-text citations will show you the contents. |
− | |||
====Syntax highlight==== | ====Syntax highlight==== | ||
− | The [http://www.mediawiki.org/wiki/Extension:SyntaxHighlight_GeSHi '''GeSHI'''] syntax highlighter extension is installed on this Wiki. | + | The [http://www.mediawiki.org/wiki/Extension:SyntaxHighlight_GeSHi '''GeSHI'''] syntax highlighter extension is installed on this Wiki but it was recently broken by the MediaWiki developers. |
Type:<code> | Type:<code> | ||
Line 371: | Line 384: | ||
} # 1 4 9 16 25 | } # 1 4 9 16 25 | ||
</source> | </source> | ||
− | + | Note: no highlighting, and the page is flagged as having syntax highlighting errors. | |
====Pubmed Articles and abstracts==== | ====Pubmed Articles and abstracts==== | ||
Line 381: | Line 394: | ||
<code><nowiki>{{#pmid: 15289071 |Steipe2004}}</nowiki></code> | <code><nowiki>{{#pmid: 15289071 |Steipe2004}}</nowiki></code> | ||
− | :This formats the pubmed parser output for the Cite extension; A footnote mark will be inserted ''here''{{#pmid: 15289071 |Steipe2004}} and the actual reference will appear beneath the <code><references /></code> section of the page. | + | :This formats the pubmed parser output for the Cite extension; A footnote mark will be inserted ''here''{{#pmid: 15289071 |Steipe2004}} and the actual reference will appear beneath the <code><references /></code> section of the page. This too will be shown as hover-text. |
− | |||
====Math markup==== | ====Math markup==== | ||
Line 471: | Line 483: | ||
<references/> | <references/> | ||
− | <section end= | + | <section end=Wiki-editing /> |
Latest revision as of 08:57, 26 October 2020
Contents
For more extensive formatting help see: http://meta.wikimedia.org/wiki/Help:Editing
For Math markup see: http://meta.wikimedia.org/wiki/Help:Formula
The Wiki concept
Wiki sites are collections of Web pages that allow you to view, edit and create pages from your browser, there is no need for special technology and basic editing is simple and intuitive with "Wikitext markup".
The basic workflow of Wikis is straightforward:
- Register an account and browse the site.
- Whenever you find something that you can improve, edit it.
- Whenever you find something that you would like to comment on, click on the "discussion" tab and share your views.
- If you are interested in what becomes of your edits or the discussion, click on the "watch" tab, and the page will be added to a list of bookmarks to pages you are "watching". (You can even generate an RSS feed for recent changes or new pages).
No e-mail, no obligations. Do what you like, when you like, what you can.
- Editing on the Course Wiki is only enabled for instructors. However you can freely edit all pages on the Student Wiki, once you have an account.
Editing basics
- Start editing
- To start editing a Wiki page, click on the "Edit" link at one of its edges. This will bring you to the edit page: a page with a text box containing the wikitext: the editable source code from which the server produces the webpage.
- Preview before saving
- When you have finished, press Show preview to see how your changes will look. Repeat the edit/preview process until you are satisfied, then click Save and your changes will be immediately applied to the article and accessible on the Web. They will also be stored in the main database for as long as the Wiki exists. Thus it is always possible to get back earlier versions of pages - back to the very first edit.
Basic text formatting
Here are some examples of the markup of Wikitext. It is not the same as HTML markup, however some HTML markup will work. In particular, the Wiki applies styles through CSS technology (Cascading Style Sheets) and thus HTML tags can be used to apply consistent styles to individual page elements. Javascript won't work.
What it looks like | What you type |
---|---|
You can emphasize text by putting two apostrophes on each side. Three apostrophes will emphasize it strongly. Five apostrophes is even stronger. |
You can ''emphasize text'' by putting two apostrophes on each side. Three apostrophes will emphasize it '''strongly'''. Five apostrophes is '''''even stronger'''''. |
A single newline has no effect on the layout. But an empty line starts a new paragraph. |
A single newline has no effect on the layout. But an empty line starts a new paragraph. |
You can break lines |
You can break lines<br> without starting a new paragraph.<br> |
You can format text in a monospace font with a dashed box around it either by marking it with the HTML <pre> tag, or by putting a blank space at the beginning of a line. Example. (This may not be very useful beyond the types of examples we show here, but it is a frequent source of confusion, when you find your text marked up this way by accident) |
You can format text in a monospace font with a dashed box around it either by marking it with the HTML <pre> tag, or by putting a blank space at the beginning of a line. Example. (This may not be very useful beyond the types of examples we show here, but it is a frequent source of confusion, when you find your text marked up this way by accident) |
Other special characters at the beginning of a line include:
|
Other special characters at the beginning of a line include: * bulleted list # numbered list ; term : and definition |
You should "sign" your comments on discussion pages: |
You should "sign" your comments on discusion pages: : Three tildes gives your user name - ~~~ : Four tildes: user name plus date/time - ~~~~ : Five tildes: date/time alone - ~~~~~ |
You can use normal HTML character codes for special characters such as > < & ° Å Ä ü → |
You can use normal HTML character codes for special characters such as > < & ° Å Ä ü → ... but modern browsers will handle Unicode well enough: > < & ° Å → 烦死了! (¬A)⊕A |
You can use HTML tags, too, if you want. Some useful ways to use HTML: Put text in a typewriter font. The same font is generally used for
Superscripts and subscripts: x2, x2 Invisible comments that only appear while editing the page. |
You can use <b>HTML tags</b>, too, if you want. Some useful ways to use HTML: Put text in a <tt>typewriter font</tt>. The same font is generally used for <code>computer code</code>. <strike>Strike out</strike> or <u>underline</u> text, write <span style="font-variant:small-caps"> in small caps</span>, <span style="background-color: #FFFFAA;">highlight</span>, or <span style="color: #DD0000;"> color</span> for emphasis. Superscripts and subscripts: x<sup>2</sup>, x<sub>2</sub> Invisible comments that only appear while editing the page. <!-- Note to editors: Be kind! --> |
For a list of HTML tags that are allowed, see HTML in wikitext. I tend to use Wiki-markup when I'm in a hurry, but use the HTML tag whenever I can't remember a Wiki-tag. It really doesn't make a difference.
However: I never use Wiki-table markup. I find it less intuitive than HTML markup, more difficult to debug, and there's really no point in remembering both types of markup given that one really needs to be comfortable with HTML tables anyway.
Links
You will often want to make clickable links to other pages.
What it looks like | What you type |
---|---|
Here's a link to a page named Sandbox. You can even say Sandboxes and the link will show up right. You can put formatting around a link. Example: Sandbox. |
Here's a link to a page named [[Sandbox]]. You can even say [[Sandbox]]es and the link will show up right. You can put formatting around a link. Example: ''[[Sandbox]]''. |
You can link to an arbitrary piece of text with a piped link. Put the link target first, then the pipe character "|", then the link text - as in this example. |
You can link an arbitrary piece of text with a ''piped link''. Put the link target first, then the pipe character "|", then the link text - as in [[Sandbox| this example]]. |
You can make an external link to a Web page just by typing an URL, e.g. http://igem.org Or you can link arbitrary text: iGEM. (Note: No "|" for external links, URL and text are separated by a blank, and only single square brackets!) Or you can generate a footnote-like link: [1]. |
You can make an external link to a Web page just by typing an URL, e.g. http://igem.org Or you can link arbitrary text: [http://igem.org iGEM]. (Note: No "|" for '''external''' links, URL and text are separated by a blank, and only single square brackets!) Or you can generate a footnote-like link: [http://igem.org]. |
Note: remember:
- internal links (using [[...]] tags to link to pages on this Wiki) are separated from linked text with a pipe character:
[[URL|text]]
. - External links (using [...] tags to link to pages elsewhere on the Internet) are separated from linked text with a space character:
[URL text]
.
Special syntax
Two special syntax items need to be mentioned: "templates" and "magic words":
- Templates
- Templates are pieces of Wikitext that are substituted where a code that links to them has been placed into a page. For example, if you enter
{{Lorem}}
on a page, the "Lorem ipsum dolor sit amet ..." placeholder text is inserted in place of that code. Wikis make extensive use of templates.
- Magic words
- some reserved "magic"-words are replaced with dynamically created contents when the page is rendered. For example
__TOC__
forces placing a Table Of Contents at the position of this token rather than its default position, while__NOTOC__
suppresses creation of a Table Of Contents on a page.
Creating a new page
To create a new page simply insert a link to a Wiki page, which has a page name that does not exist yet. The link will appear in red (except if you inadvertently used the name of a page that already exists), and the new page will be created when you click on the link. Page names can be long and contain blank spaces. Internally, all blank spaces are converted to underscore characters, but you can use the page name without underscores in links; the Wiki software translates this for you.
Namespaces
The Wiki maintains some pages in special collections, in so called "namespaces". This is useful, because the behaviour of the software can be customized for different namespaces: for example you may be allowed to edit in the main- and the user- namespace, but not in the MediaWiki:
namespace, where pages are held that affect the gears and wires of the Wiki. Page names without a prefix live in the main space. Some commonly used prefixes are:
User:
- personal pages for user with an account on the Wiki;Talk:
- discussion pages for comments on pages, accessible via the "Discussion" tab;Help:
- this page for example;Template:
- pages with reusable text.Special:
- pages that implement special functionality (like login, user lists, or lists of recently changed pages);Category:
- an index of pages that have been given a common tag. This is a convenient way to access pages that are in some way related;
Categories
Once your page has been edited, you can associate it with one or more categories. For example, add the appropriate category tag by typing [[Category:BCH441_2020]]
. The page is then automatically linked from a page that collects all pages with that category tag. I would prefer that you do not create new categories; ask me if you feel a need for it.
Creating a new section or subsection on a page
To create a section or subsection, simply insert a section header into an existing section. Header levels are defined by the number of "=" characters before and after the header text. Click on an edit link of this page to see example code. Once a page has more than two headings, the Wiki automatically creates a table of contents. You can adjust the position of the table of contents by typing the "magic word" __TOC__
somewhere on your page (Note: double underscore), you can also suppress having a table of contents created with__NOTOC__
.
Edit conflicts
If someone else makes an edit while you are making yours, the result is an edit conflict. Many conflicts can be automatically resolved by the Wiki. If it can't be resolved, however, you will need to resolve it yourself. The Wiki gives you two text boxes, where the top one is the other person's edit and the bottom one is your edit. Merge your edits into the top edit box, which is the only one that will be saved.
Reverting pages to a previous state
Sometimes a page needs to be reverted to a previous state. Access the page through a link to the Recent Changes special page: Special:Recentchanges. Find the page you need to revert, click on the hist link, click on the version you need and verify that it is the correct one. Then click on the edit tab at the top and Save page. A new version of the page is then created with the old text. Note that this does not actually overwrite anything - all edits are archived in the database.
Special markup on this Wiki
Here are some special templates and extensions installed on this Wiki:
Vertical space
The template code {{Vspace}}
will insert a two-line high space to help structuring text.
References and footnotes
Enclosing text in <ref> ... <\ref>
tags will create a footnote reference and display the text wherever you place a <references />
tag on the page.[1] The reference will display as hover-text, so you can keep your references organized in one section of the page, but your in-text citations will show you the contents.
Syntax highlight
The GeSHI syntax highlighter extension is installed on this Wiki but it was recently broken by the MediaWiki developers.
Type:
<source lang="R">
for (i in 1:5) {
print(i^2)
} # 1 4 9 16 25
</source>
... to get:
for (i in 1:5) {
print(i^2)
} # 1 4 9 16 25
Note: no highlighting, and the page is flagged as having syntax highlighting errors.
Pubmed Articles and abstracts
{{#pmid:15289071}}
- This inserts the article information in a
<div>
, formatted by Template:Pubmed.
Steipe (2004) Consensus-based engineering of protein stability: from intrabodies to thermostable enzymes. Meth Enzymol 388:176-86. (pmid: 15289071) |
{{#pmid: 15289071 |Steipe2004}}
- This formats the pubmed parser output for the Cite extension; A footnote mark will be inserted here[2] and the actual reference will appear beneath the
<references />
section of the page. This too will be shown as hover-text.
Math markup
<math>H = - \sum_{i=0}^n p_i \log_{2} p_i</math>
Failed to parse (MathML with SVG or PNG fallback (recommended for modern browsers and accessibility tools): Invalid response ("Math extension cannot connect to Restbase.") from server "https://wikimedia.org/api/rest_v1/":): {\displaystyle H = - \sum_{i=0}^n p_i \log_{2} p_i}
ToDo items
Type:
<div class="ToDo">
ToDo:
* This ...
* and that.
</div>
... to get:
ToDo:
- This ...
- and that.
Notes
Type:
<div class="note">
Note: take special care to ...
</div>
... to get:
Note: take special care to ...
Linking text to Wikipedia
... using the {{WP|...}}
template.
If the linked text is the same as the Wikipedia page titke, simply type it:
{{WP|Mutual information}}
Mutual information
If the linked text is different, use the "|" pipe character to separate page-name and text:
{{WP|Mutual information|'''WP article on Mutual Information'''}}
WP article on Mutual Information
Collapsible elements
See: Manual: Collapsible elements
<div class="mw-collapsible mw-collapsed" data-expandtext="Expand" data-collapsetext="Collapse" style="width:50%; "> Visible text ... <div class="mw-collapsible-content" style="padding:10px;"> * Collapsed text 1 * Collapsed text 2 * Collapsed text 3 </div> </div>
Example:
Two roads diverged in a yellow wood,
And sorry I could not travel both
And be one traveler, long I stood
And looked down one as far as I could
To where it bent in the undergrowth;
Then took the other, as just as fair,
And having perhaps the better claim
Because it was grassy and wanted wear,
Though as for that the passing there
Had worn them really about the same,
And both that morning equally lay
In leaves no step had trodden black.
Oh, I marked the first for another day!
Yet knowing how way leads on to way
I doubted if I should ever come back.
I shall be telling this with a sigh
Somewhere ages and ages hence:
Two roads diverged in a wood, and I,
I took the one less traveled by,
And that has made all the difference.
Sample reference section