diff options
author | Vladimír Čunát <vcunat@gmail.com> | 2018-09-04 13:06:45 +0200 |
---|---|---|
committer | Vladimír Čunát <vcunat@gmail.com> | 2018-09-04 13:06:45 +0200 |
commit | 1428d00aa4a58095ba510145eb25233591ac6051 (patch) | |
tree | b4f73764acaeb3c21a70a9c57cca55e59681515c /nixos/doc | |
parent | e3ee9c098a64deb30e8d9edb180e613b93046f45 (diff) | |
parent | 6767396e380b39128e5decf30d6cb87481a75490 (diff) |
Merge branch 'master' into staging-next
Hydra: ?compare=1477053
Diffstat (limited to 'nixos/doc')
-rw-r--r-- | nixos/doc/manual/configuration/x-windows.xml | 8 | ||||
-rw-r--r-- | nixos/doc/manual/configuration/xfce.xml | 6 | ||||
-rw-r--r-- | nixos/doc/manual/default.nix | 4 | ||||
-rw-r--r-- | nixos/doc/manual/development/option-def.xml | 6 | ||||
-rw-r--r-- | nixos/doc/manual/options-to-docbook.xsl | 11 | ||||
-rw-r--r-- | nixos/doc/manual/postprocess-option-descriptions.xsl | 115 | ||||
-rw-r--r-- | nixos/doc/manual/release-notes/release-notes.xml | 1 | ||||
-rw-r--r-- | nixos/doc/manual/release-notes/rl-1809.xml | 8 | ||||
-rw-r--r-- | nixos/doc/manual/release-notes/rl-1903.xml | 58 |
9 files changed, 202 insertions, 15 deletions
diff --git a/nixos/doc/manual/configuration/x-windows.xml b/nixos/doc/manual/configuration/x-windows.xml index 948b35209b790..703a1b8b7f09a 100644 --- a/nixos/doc/manual/configuration/x-windows.xml +++ b/nixos/doc/manual/configuration/x-windows.xml @@ -60,7 +60,7 @@ # systemctl start display-manager.service </screen> </para> - <simplesect> + <simplesect xml:id="sec-x11-graphics-cards-nvidia"> <title>NVIDIA Graphics Cards</title> <para> NVIDIA provides a proprietary driver for its graphics cards that has better @@ -86,7 +86,7 @@ </programlisting> </para> </simplesect> - <simplesect> + <simplesect xml:id="sec-x11--graphics-cards-amd"> <title>AMD Graphics Cards</title> <para> AMD provides a proprietary driver for its graphics cards that has better 3D @@ -106,7 +106,7 @@ </programlisting> </para> </simplesect> - <simplesect> + <simplesect xml:id="sec-x11-touchpads"> <title>Touchpads</title> <para> Support for Synaptics touchpads (found in many laptops such as the Dell @@ -123,7 +123,7 @@ since NixOS 17.09. </para> </simplesect> - <simplesect> + <simplesect xml:id="sec-x11-gtk-and-qt-themes"> <title>GTK/Qt themes</title> <para> GTK themes can be installed either to user profile or system-wide (via diff --git a/nixos/doc/manual/configuration/xfce.xml b/nixos/doc/manual/configuration/xfce.xml index 40e61d2bd691f..77d5d96327921 100644 --- a/nixos/doc/manual/configuration/xfce.xml +++ b/nixos/doc/manual/configuration/xfce.xml @@ -31,7 +31,7 @@ (system wide), put them into your <xref linkend="opt-environment.systemPackages"/>. </para> - <simplesect> + <simplesect xml:id="sec-xfce-thunar-volumes"> <title>Thunar Volume Support</title> <para> To enable <emphasis>Thunar</emphasis> volume support, put @@ -41,7 +41,7 @@ into your <emphasis>configuration.nix</emphasis>. </para> </simplesect> - <simplesect> + <simplesect xml:id="sec-xfce-polkit"> <title>Polkit Authentication Agent</title> <para> There is no authentication agent automatically installed alongside Xfce. To @@ -50,7 +50,7 @@ and login did the trick. </para> </simplesect> - <simplesect> + <simplesect xml:id="sec-xfce-troubleshooting"> <title>Troubleshooting</title> <para> Even after enabling udisks2, volume management might not work. Thunar and/or diff --git a/nixos/doc/manual/default.nix b/nixos/doc/manual/default.nix index be28c2c17afd8..aaa6e0da545f9 100644 --- a/nixos/doc/manual/default.nix +++ b/nixos/doc/manual/default.nix @@ -90,7 +90,9 @@ let fi ${buildPackages.libxslt.bin}/bin/xsltproc \ --stringparam revision '${revision}' \ - -o $out ${./options-to-docbook.xsl} $optionsXML + -o intermediate.xml ${./options-to-docbook.xsl} $optionsXML + ${buildPackages.libxslt.bin}/bin/xsltproc \ + -o "$out" ${./postprocess-option-descriptions.xsl} intermediate.xml ''; sources = lib.sourceFilesBySuffices ./. [".xml"]; diff --git a/nixos/doc/manual/development/option-def.xml b/nixos/doc/manual/development/option-def.xml index 580a5afd58cdc..50a705d0cb8ed 100644 --- a/nixos/doc/manual/development/option-def.xml +++ b/nixos/doc/manual/development/option-def.xml @@ -17,7 +17,7 @@ config = { definitions in a <emphasis>property</emphasis> to achieve certain effects: </para> - <simplesect> + <simplesect xml:id="sec-option-definitions-delaying-conditionals"> <title>Delaying Conditionals</title> <para> If a set of option definitions is conditional on the value of another @@ -59,7 +59,7 @@ config = { </para> </simplesect> - <simplesect> + <simplesect xml:id="sec-option-definitions-setting-priorities"> <title>Setting Priorities</title> <para> A module can override the definitions of an option in other modules by @@ -76,7 +76,7 @@ services.openssh.enable = mkOverride 10 false; </para> </simplesect> - <simplesect> + <simplesect xml:id="sec-option-definitions-merging"> <title>Merging Configurations</title> <para> In conjunction with <literal>mkIf</literal>, it is sometimes useful for a diff --git a/nixos/doc/manual/options-to-docbook.xsl b/nixos/doc/manual/options-to-docbook.xsl index 2038b0dff63ee..72ac89d4ff62c 100644 --- a/nixos/doc/manual/options-to-docbook.xsl +++ b/nixos/doc/manual/options-to-docbook.xsl @@ -4,6 +4,7 @@ xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:str="http://exslt.org/strings" xmlns:xlink="http://www.w3.org/1999/xlink" + xmlns:nixos="tag:nixos.org" xmlns="http://docbook.org/ns/docbook" extension-element-prefixes="str" > @@ -30,10 +31,12 @@ <listitem> - <para> - <xsl:value-of disable-output-escaping="yes" - select="attr[@name = 'description']/string/@value" /> - </para> + <nixos:option-description> + <para> + <xsl:value-of disable-output-escaping="yes" + select="attr[@name = 'description']/string/@value" /> + </para> + </nixos:option-description> <xsl:if test="attr[@name = 'type']"> <para> diff --git a/nixos/doc/manual/postprocess-option-descriptions.xsl b/nixos/doc/manual/postprocess-option-descriptions.xsl new file mode 100644 index 0000000000000..1201c7612c2ed --- /dev/null +++ b/nixos/doc/manual/postprocess-option-descriptions.xsl @@ -0,0 +1,115 @@ +<?xml version="1.0"?> + +<xsl:stylesheet version="1.0" + xmlns:xsl="http://www.w3.org/1999/XSL/Transform" + xmlns:str="http://exslt.org/strings" + xmlns:exsl="http://exslt.org/common" + xmlns:db="http://docbook.org/ns/docbook" + xmlns:nixos="tag:nixos.org" + extension-element-prefixes="str exsl"> + <xsl:output method='xml' encoding="UTF-8" /> + + <xsl:template match="@*|node()"> + <xsl:copy> + <xsl:apply-templates select="@*|node()" /> + </xsl:copy> + </xsl:template> + + <xsl:template name="break-up-description"> + <xsl:param name="input" /> + <xsl:param name="buffer" /> + + <!-- Every time we have two newlines following each other, we want to + break it into </para><para>. --> + <xsl:variable name="parbreak" select="'

'" /> + + <!-- Similar to "(head:tail) = input" in Haskell. --> + <xsl:variable name="head" select="$input[1]" /> + <xsl:variable name="tail" select="$input[position() > 1]" /> + + <xsl:choose> + <xsl:when test="$head/self::text() and contains($head, $parbreak)"> + <!-- If the haystack provided to str:split() directly starts or + ends with $parbreak, it doesn't generate a <token/> for that, + so we are doing this here. --> + <xsl:variable name="splitted-raw"> + <xsl:if test="starts-with($head, $parbreak)"><token /></xsl:if> + <xsl:for-each select="str:split($head, $parbreak)"> + <token><xsl:value-of select="node()" /></token> + </xsl:for-each> + <!-- Something like ends-with($head, $parbreak), but there is + no ends-with() in XSLT, so we need to use substring(). --> + <xsl:if test=" + substring($head, string-length($head) - + string-length($parbreak) + 1) = $parbreak + "><token /></xsl:if> + </xsl:variable> + <xsl:variable name="splitted" + select="exsl:node-set($splitted-raw)/token" /> + <!-- The buffer we had so far didn't contain any text nodes that + contain a $parbreak, so we can put the buffer along with the + first token of $splitted into a para element. --> + <para xmlns="http://docbook.org/ns/docbook"> + <xsl:apply-templates select="exsl:node-set($buffer)" /> + <xsl:apply-templates select="$splitted[1]/node()" /> + </para> + <!-- We have already emitted the first splitted result, so the + last result is going to be set as the new $buffer later + because its contents may not be directly followed up by a + $parbreak. --> + <xsl:for-each select="$splitted[position() > 1 + and position() < last()]"> + <para xmlns="http://docbook.org/ns/docbook"> + <xsl:apply-templates select="node()" /> + </para> + </xsl:for-each> + <xsl:call-template name="break-up-description"> + <xsl:with-param name="input" select="$tail" /> + <xsl:with-param name="buffer" select="$splitted[last()]/node()" /> + </xsl:call-template> + </xsl:when> + <!-- Either non-text node or one without $parbreak, which we just + want to buffer and continue recursing. --> + <xsl:when test="$input"> + <xsl:call-template name="break-up-description"> + <xsl:with-param name="input" select="$tail" /> + <!-- This essentially appends $head to $buffer. --> + <xsl:with-param name="buffer"> + <xsl:if test="$buffer"> + <xsl:for-each select="exsl:node-set($buffer)"> + <xsl:apply-templates select="." /> + </xsl:for-each> + </xsl:if> + <xsl:apply-templates select="$head" /> + </xsl:with-param> + </xsl:call-template> + </xsl:when> + <!-- No more $input, just put the remaining $buffer in a para. --> + <xsl:otherwise> + <para xmlns="http://docbook.org/ns/docbook"> + <xsl:apply-templates select="exsl:node-set($buffer)" /> + </para> + </xsl:otherwise> + </xsl:choose> + </xsl:template> + + <xsl:template match="nixos:option-description"> + <xsl:choose> + <!-- + Only process nodes that are comprised of a single <para/> element, + because if that's not the case the description already contains + </para><para> in between and we need no further processing. + --> + <xsl:when test="count(db:para) > 1"> + <xsl:apply-templates select="node()" /> + </xsl:when> + <xsl:otherwise> + <xsl:call-template name="break-up-description"> + <xsl:with-param name="input" + select="exsl:node-set(db:para/node())" /> + </xsl:call-template> + </xsl:otherwise> + </xsl:choose> + </xsl:template> + +</xsl:stylesheet> diff --git a/nixos/doc/manual/release-notes/release-notes.xml b/nixos/doc/manual/release-notes/release-notes.xml index 94f176186b6e0..a222bfa29d5af 100644 --- a/nixos/doc/manual/release-notes/release-notes.xml +++ b/nixos/doc/manual/release-notes/release-notes.xml @@ -8,6 +8,7 @@ This section lists the release notes for each stable version of NixOS and current unstable revision. </para> + <xi:include href="rl-1903.xml" /> <xi:include href="rl-1809.xml" /> <xi:include href="rl-1803.xml" /> <xi:include href="rl-1709.xml" /> diff --git a/nixos/doc/manual/release-notes/rl-1809.xml b/nixos/doc/manual/release-notes/rl-1809.xml index f6504778939b8..53ffef31e3cca 100644 --- a/nixos/doc/manual/release-notes/rl-1809.xml +++ b/nixos/doc/manual/release-notes/rl-1809.xml @@ -528,6 +528,14 @@ inherit (pkgs.nixos { to <literal>true</literal>. </para> </listitem> + <listitem> + <para> + NixOS option descriptions are now automatically broken up into individual + paragraphs if the text contains two consecutive newlines, so it's no + longer necessary to use <code></para><para></code> to start + a new paragraph. + </para> + </listitem> </itemizedlist> </section> </section> diff --git a/nixos/doc/manual/release-notes/rl-1903.xml b/nixos/doc/manual/release-notes/rl-1903.xml new file mode 100644 index 0000000000000..9ae34dd58ab0b --- /dev/null +++ b/nixos/doc/manual/release-notes/rl-1903.xml @@ -0,0 +1,58 @@ +<section xmlns="http://docbook.org/ns/docbook" + xmlns:xlink="http://www.w3.org/1999/xlink" + xmlns:xi="http://www.w3.org/2001/XInclude" + version="5.0" + xml:id="sec-release-19.03"> + <title>Release 19.03 (“Koi”, 2019/03/??)</title> + + <section xmlns="http://docbook.org/ns/docbook" + xmlns:xlink="http://www.w3.org/1999/xlink" + xmlns:xi="http://www.w3.org/2001/XInclude" + version="5.0" + xml:id="sec-release-19.03-highlights"> + <title>Highlights</title> + + <para> + In addition to numerous new and upgraded packages, this release has the + following highlights: + </para> + + <itemizedlist> + <listitem> + <para /> + </listitem> + </itemizedlist> + </section> + + <section xmlns="http://docbook.org/ns/docbook" + xmlns:xlink="http://www.w3.org/1999/xlink" + xmlns:xi="http://www.w3.org/2001/XInclude" + version="5.0" + xml:id="sec-release-19.03-new-services"> + <title>New Services</title> + + <para> + The following new services were added since the last release: + </para> + + <itemizedlist> + <listitem> + <para /> + </listitem> + </itemizedlist> + </section> + + <section xmlns="http://docbook.org/ns/docbook" + xmlns:xlink="http://www.w3.org/1999/xlink" + xmlns:xi="http://www.w3.org/2001/XInclude" + version="5.0" + xml:id="sec-release-19.03-notable-changes"> + <title>Other Notable Changes</title> + + <itemizedlist> + <listitem> + <para /> + </listitem> + </itemizedlist> + </section> +</section> |