FAQ Write an Article

Uit Gentoo Linux Wiki

Ga naar: navigatie, zoeken
This article is part of the FAQ series.
General Portage Wiki

Inhoud

[bewerken] Introduction

This article may be merged with some other in the future. The purpose of this page is to describe how to correctly create and format articles on this wiki. Feel free to look at the source code of this page by clicking the edit link above.

[bewerken] Development

This article is under development by the admins. If you have any suggestions, please bring them up on the talk page or the devel mailing list.

[bewerken] Trying this out

There is a safe place for you to try out what you learned. It's called the Sandbox.

[bewerken] Outlining your document

It's usually a good idea to put section headers between == tags. Simply put equal signs on both sides of the heading on its own line. While using = Someheading = as a heading is acceptable, it creates awfully large fonts. For most articles, two equal signs is the level that should be used for headings. To create sub-headings use more equal signs. For example, the following will create a heading called Introduction with some text, and a subheading Abstract with some text.

Code: Example of Headers
== Introduction ==
Hello World.
=== Abstract ===
This is the project abstract.  Its heading appears smaller, and at the top ouline is indented.

[bewerken] Preventing Wikification

Everything between <nowiki> and </nowiki> will not be wikified (processed by the wiki engine).

There is another way. It's the <pre> tag. It works just like the <nowiki> tag, except that some basic formatting is still available and the contents of the tag are put in a grey box. For example, you can still

link to articles.

[bewerken] Don't use HTML

It is usually not necessary to add raw HTML to wikis. Please use the formatting specified on the Help:Editing page. Bookmark that page and refer to it whenever you feel the itch to use plain HTML.

[bewerken] Line breaks

If you need to make space between paragraphs, hit the Enter/Return key twice (you should have one blank line between paragraphs). There is no need for double <br /> tags. You can use the <br /> tag if you need to insert a single line break
like this one.

[bewerken] Tables

Tables are explained in depth here.

[bewerken] Other tags

  • The <p> is not needed. Paragraphs are automatically created at double line breaks.
  • The <hr /> tag can be created by typing ---- on its own line. But please don't, because its usually not needed. And whatever you do, do not place it at the top of your document. This may break Categories and Templates. Really, the only time it's reasonable to use <hr /> is when you're separating discussions on your own UserTalk page, and even then you can just use headings.

[bewerken] Boxes

[bewerken] The Gray Box

The gray box is what we use for code to be typed into a terminal, and also it's nested inside other boxes' content. To make a gray box you can:

  1. Put a space at the beginning of each line you want boxed. Note that if you use the '=' (equal sign) character, you should use the next method(s).
  2. Encapsulate the commands in <pre> tags
  3. Place a space at the beginning of a line followed by the <nowiki> tag, your content, and a </nowiki> tag at the end. Note, any extra spaces after the opening <nowiki> tag will be printed verbatim.
Code: Gray Box Nowiki Tags Example
<nowiki>This line contains the = character
and will not work if we don't use the <nowiki> tag.</nowiki>
 echo "bar" # this just has a space as the first character on the line

will produce:

This line contains the = character
and will not work if we don't use the <nowiki> tag.
echo "bar" # this just has a space as the first character on the line

[bewerken] Code, File, and Kernel Boxes

There are two colored boxes that gentoo-wiki uses. Boxes for Code and boxes for Files. Note: Code does not mean what you type into the terminal. Just use a gray box (see above) for that. Code boxes are used for program output, or actual programming code.

Colored boxes are a little more complex than what we've done so far. The format for creating a colored box is: {{Box Type|title|content}}. For editing readability, please start the content on a new line. Lets make one! The Code box is what you've seen throughout this wiki. The title is usually the program name. Then the output is placed in a gray box, with comments not in the gray box. Another example is the File box, which is red, and is used to denote the contents of a particular file. The last example, is the kernel box, which is "make menuconfig" for kernels. Here I chose to use a <pre> tag to make the gray box inside:

Code: making a kernel
{{Box Kernel| Kernel Box Example|
 Code maturity level options  --->
  [*] Prompt for development and/or incomplete code/drivers
  [*]   Select only drivers expected to compile cleanly
}}

will produce the following:

Linux Kernel Configuratie: Kernel Box Example
Code maturity level options  --->
 [*] Prompt for development and/or incomplete code/drivers
 [*]   Select only drivers expected to compile cleanly

[bewerken] Explanations

If you need to explain what you doing in-line with your code/file, simply break out of the preformatted text or use appropriate comment characters. Example follows:

Code: bash script
 #!/bin/bash
 echo "here I am using preformatted text to show you code"
 mutt # everything following the # character is a comment, so I can explain what I do
 
 emerge gcc

This text is no longer preformatted, so I can use this space to explain the above command.

 # and so on

[bewerken] Template Quirks

Some characters need to be entered as HTML entities when used in boxes.

Character name ASCII HTML Entity
Equality sign = &#061;
Vertical bar (pipe) | &#124;

Alternatively, you can surround the problematic characters/lines with <nowiki></nowiki> tags.

[bewerken] Filename and Useflag

These are awfully simple commands. The {{Filename}} tag is used to display the location of a file, and {{Useflag}} is used to specify a use flag. For example:

Code: Using Filename and Useflag
And make sure that {{Useflag|gnome}} is specified as a useflag in {{Filename|/etc/make.conf}}.

will produce:

And make sure that gnome is specified as a useflag in /etc/make.conf.

[bewerken] Codeline/Commandline

This is probably the most misunderstood tag. But don't let that intimidate you, the {{Commandline}} tag can make your articles much more readable when used correctly. {{Commandline}} is just for that -- a line of code, which is usually a command to be entered at the prompt. Commandline is designed for a single line. It's just a quick "do this" in your article. {{Commandline}} does not go on its own line. For commands that span more than one line, use a gray box or the appropriate colored box.

{{Codeline}} can still be used but is deprecated.

[bewerken] Good Example

Code: Appropriate use
After emerging your new kernel sources run {{Commandline|make menuconfig}} and 
configure your kernel.

which produces: After emerging your new kernel sources run make menuconfig and configure your kernel.

[bewerken] Bad Example

Code: Inappropriate use
Now emerge some kernel<br>
{{Commandline|emerge gentoo-sources}}<br>

which produces:

Now emerge some kernel
emerge gentoo-sources

Note: This was wrong because {{Commandline}} was placed on its own line, and because the author had to use a <br /> tag to do it.

[bewerken] ChangeLogs

There is no need to use ChangeLogs on the actual wiki pages. The wiki itself is capable of keeping track of changes. Just use the comment box when editing to specify what was changed.

Afkomstig van de Nederlandstalige Gentoo Wiki, het vrije Gentoo handboek. "http://nl.gentoo-wiki.com/FAQ_Write_an_Article"
Persoonlijke instellingen
Andere talen