lol

nixos-manual(emacs): Add a section about configuring DocBook 5 schemas

+49
+49
nixos/modules/services/editors/emacs.xml
··· 574 574 &lt;RET&gt; nixos-rebuild &lt;RET&gt;.</literal> 575 575 </para> 576 576 </section> 577 + 578 + <section xml:id="sec-emacs-docbook-xml"> 579 + <title>Editing DocBook 5 XML Documents</title> 580 + <para> 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 587 + not included. 588 + </para> 589 + 590 + <para> 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>). 597 + </para> 598 + 599 + <para> 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"?> 605 + <!-- 606 + To let emacs find this file, evaluate: 607 + (add-to-list 'rng-schema-locating-files "~/.emacs.d/schemas.xml") 608 + --> 609 + <locatingRules xmlns="http://thaiopensource.com/ns/locating-rules/1.0"> 610 + <!-- 611 + Use this variation if pkgs.docbook5 is added to environment.systemPackages 612 + --> 613 + <namespace ns="http://docbook.org/ns/docbook" 614 + uri="/run/current-system/sw/share/xml/docbook-5.0/rng/docbookxi.rnc"/> 615 + <!-- 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"/> 619 + --> 620 + </locatingRules> 621 + ]]></programlisting> 622 + </example> 623 + </para> 624 + 625 + </section> 577 626 </section> 578 627 579 628 </chapter>