Help:Editing: Difference between revisions

From NixOS Wiki
imported>Mth
Document how to typeset code
imported>Mth
tables
Line 3: Line 3:
== Article tone ==
== Article tone ==


Use a more <em>descriptive</em> tone, where concepts and instructions are described and explained first. A <em>prescriptive</em> tone should be avoided.
Use a more <em>descriptive</em> tone, where concepts and instructions are described and explained first. A <em>prescriptive</em> tone should be avoided. Here's an example:


Here's an example:
{| class="wikitable"
 
|-
<table>
! Prescriptive
<tr>
! Descriptive
<th>Prescriptive</th>
|-
<th>Descriptive</th>
|width=50% valign=top| <b>How to deal with full <code>/boot</code> in case of EFI</b><p>systemd-boot (gummiboot) can't store kernels, initrd and other big stuff on root partition, so switch to grub</p>
</tr>
|width=50% valign=top| <b>Keeping kernels/initrd on the main partition</b><p>For these instructions, GRUB will be required; systemd-boot cannot reference boot files from the root partition. This will differ from the default expectation of NixOS on EFI, where <tt>/boot/</tt> is the <tt>ESP</tt>.</p>
<tr>
|}
<td width=50% valign=top>
<b>How to deal with full /boot in case of EFI</b>
<p>systemd-boot (gummiboot) can't store kernels, initrd and other big stuff on root partition, so switch to grub</p>
</td>
<td>
<b>Keeping kernels/initrd on the main partition</b>
<p>For these instructions, GRUB will be required; systemd-boot cannot reference boot files from the root partition. This will differ from the default expectation of NixOS on EFI, where <tt>/boot/</tt> is the <tt>ESP</tt>.
</p>
</td>
</tr>
</table>


On the prescriptive side, the title doesn't describe the achieved end-result; the text tells the reader to switch to grub without explaining what the following (elided) configuration does.
On the prescriptive side, the title doesn't describe the achieved end-result; the text tells the reader to switch to grub without explaining what the following (elided) configuration does.
Line 35: Line 24:
Some sections are common across the wiki. For consistency, their names are documented here.
Some sections are common across the wiki. For consistency, their names are documented here.


{| class="table" border="1"
{| class="wikitable"
|-
|-
! Section
! Section
! Description
! Description
|-
|-
| See also
| See also
| References inside and outside the wiki. Prefer textual links with a description than naked URLs.
| References inside and outside the wiki. Prefer textual links with a description than naked URLs.
|-
|-
| References
| References
| The last section, when needed, where <code><cite /></code> sections will output the references.
| The last section, when needed, where <code><cite /></code> sections will output the references.
|}
|}


== Code ==
== Code ==
Line 55: Line 44:
{{bc|<nowiki><syntaxhighlight lang="...">...</syntaxhighlight></nowiki>}}
{{bc|<nowiki><syntaxhighlight lang="...">...</syntaxhighlight></nowiki>}}


<code>lang="nix"</code> can be used to highlight Nix expressions. For console snippets, root prompts are conventionally indicated with {{ic|#}}, while non-root prompts look like {{ic|$}}. <code>lang="console"</code> highlights such prompts correctly, while <code>lang="bash"</code> rightfully treats {{ic|#}} as the beginning of a comment, as it is intended for scripts.
<code>lang="nix"</code> can be used to highlight Nix expressions. For console snippets, root prompts are conventionally indicated with {{ic|#}}, while non-root prompts look like {{ic|$}}. <code>lang="console"</code> highlights such prompts correctly, while <code>lang="bash"</code> treats {{ic|#}} as the beginning of a comment, as it is intended for scripts.


== Using <code><cite /></code> ==
== Using <code><cite /></code> ==

Revision as of 09:08, 22 April 2019

Article tone

Use a more descriptive tone, where concepts and instructions are described and explained first. A prescriptive tone should be avoided. Here's an example:

Prescriptive Descriptive
How to deal with full /boot in case of EFI

systemd-boot (gummiboot) can't store kernels, initrd and other big stuff on root partition, so switch to grub

Keeping kernels/initrd on the main partition

For these instructions, GRUB will be required; systemd-boot cannot reference boot files from the root partition. This will differ from the default expectation of NixOS on EFI, where /boot/ is the ESP.

On the prescriptive side, the title doesn't describe the achieved end-result; the text tells the reader to switch to grub without explaining what the following (elided) configuration does.

Titles

Capitalize only the first word.

Common sections

Some sections are common across the wiki. For consistency, their names are documented here.

Section Description
See also References inside and outside the wiki. Prefer textual links with a description than naked URLs.
References The last section, when needed, where sections will output the references.

Code

Inline code can be typeset with {{ic|...}} or <code>...</code>. A block of code is obtained with:

{{bc|...}}

or

<pre>...</pre>

or, often preferable:

<syntaxhighlight lang="...">...</syntaxhighlight>

lang="nix" can be used to highlight Nix expressions. For console snippets, root prompts are conventionally indicated with #, while non-root prompts look like $. lang="console" highlights such prompts correctly, while lang="bash" treats # as the beginning of a comment, as it is intended for scripts.

Using

See also