···
<RET> nixos-rebuild <RET>.</literal>
578
+
<section xml:id="sec-emacs-docbook-xml">
579
+
<title>Editing DocBook 5 XML Documents</title>
581
+
Emacs includes <link
582
+
xlink:href="https://www.gnu.org/software/emacs/manual/html_node/nxml-mode/Introduction.html">nXML</link>,
583
+
a major-mode for validating and editing XML documents.
584
+
When editing DocBook 5.0 documents, such as
585
+
<link linkend="book-nixos-manual">this one</link>,
586
+
nXML needs to be configured with the relevant schema, which is
591
+
To install the DocBook 5.0 schemas, either add
592
+
<varname>pkgs.docbook5</varname> to
593
+
<varname>environment.systemPackages</varname> (<link
594
+
linkend="sec-declarative-package-mgmt">NixOS</link>), or run
595
+
<literal>nix-env -i pkgs.docbook5</literal>
596
+
(<link linkend="sec-ad-hoc-packages">Nix</link>).
600
+
Then customize the variable <varname>rng-schema-locating-files</varname> to include <filename>~/.emacs.d/schemas.xml</filename> and put the following text into that file:
601
+
<example xml:id="ex-emacs-docbook-xml">
602
+
<title>nXML Schema Configuration (<filename>~/.emacs.d/schemas.xml</filename>)</title>
603
+
<programlisting language="xml"><![CDATA[
604
+
<?xml version="1.0"?>
606
+
To let emacs find this file, evaluate:
607
+
(add-to-list 'rng-schema-locating-files "~/.emacs.d/schemas.xml")
609
+
<locatingRules xmlns="http://thaiopensource.com/ns/locating-rules/1.0">
611
+
Use this variation if pkgs.docbook5 is added to environment.systemPackages
613
+
<namespace ns="http://docbook.org/ns/docbook"
614
+
uri="/run/current-system/sw/share/xml/docbook-5.0/rng/docbookxi.rnc"/>
616
+
Use this variation if installing schema with "nix-env -iA pkgs.docbook5".
617
+
<namespace ns="http://docbook.org/ns/docbook"
618
+
uri="../.nix-profile/share/xml/docbook-5.0/rng/docbookxi.rnc"/>
621
+
]]></programlisting>