Help:Editing: Difference between revisions

From NixOS Wiki
imported>Wackbyte
make lang="..." examples more readable, add a wikitext example, and add a link to MediaWiki's own "Pages with syntax highlighting errors" page as it contains some useful info
imported>Wackbyte
m more specific examples section title
Line 44: Line 44:
{{bc|<nowiki><syntaxhighlight lang="...">...</syntaxhighlight></nowiki>}}
{{bc|<nowiki><syntaxhighlight lang="...">...</syntaxhighlight></nowiki>}}


=== Examples ===
=== Examples of <code>lang="..."</code> ===


* <code>lang="nix"</code> can be used to highlight Nix expressions.
* <code>lang="nix"</code> can be used to highlight Nix expressions.

Revision as of 01:56, 2 March 2022

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>

Examples of lang="..."

  • lang="nix" can be used to highlight Nix expressions.
  • lang="html+handlebars" may be used to highlight wikitext.
  • 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