summary refs log tree commit diff
path: root/nixos/doc/manual/from_md/contributing-to-this-manual.chapter.xml
blob: 99dc5ce30b4b1210a4972108add70fc115c6eaa9 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
<chapter xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink" xml:id="chap-contributing">
  <title>Contributing to this manual</title>
  <para>
    The
    <link xlink:href="https://en.wikipedia.org/wiki/DocBook">DocBook</link>
    and CommonMark sources of the NixOS manual are in the
    <link xlink:href="https://github.com/NixOS/nixpkgs/tree/master/nixos/doc/manual">nixos/doc/manual</link>
    subdirectory of the
    <link xlink:href="https://github.com/NixOS/nixpkgs">Nixpkgs</link>
    repository.
  </para>
  <para>
    You can quickly check your edits with the following:
  </para>
  <programlisting>
$ cd /path/to/nixpkgs
$ ./nixos/doc/manual/md-to-db.sh
$ nix-build nixos/release.nix -A manual.x86_64-linux
</programlisting>
  <para>
    If the build succeeds, the manual will be in
    <literal>./result/share/doc/nixos/index.html</literal>.
  </para>
  <para>
    <emphasis role="strong">Contributing to the man pages</emphasis>
  </para>
  <para>
    The man pages are written in
    <link xlink:href="https://en.wikipedia.org/wiki/DocBook">DocBook</link>
    which is XML.
  </para>
  <para>
    To see what your edits look like:
  </para>
  <programlisting>
$ cd /path/to/nixpkgs
$ nix-build nixos/release.nix -A manpages.x86_64-linux
</programlisting>
  <para>
    You can then read the man page you edited by running
  </para>
  <programlisting>
$ man --manpath=result/share/man nixos-rebuild # Replace nixos-rebuild with the command whose manual you edited
</programlisting>
  <para>
    If you’re on a different architecture that’s supported by NixOS
    (check nixos/release.nix) then replace
    <literal>x86_64-linux</literal> with the architecture.
    <literal>nix-build</literal> will complain otherwise, but should
    also tell you which architecture you have + the supported ones.
  </para>
</chapter>