mirror of
https://github.com/NixOS/nixpkgs.git
synced 2025-07-14 14:10:33 +03:00
nixos/manual: replace most examples with anchors
markdown doesn't really have examples as a first-class construct. we'll keep all examples that are referenced around for now, but all unreferenced examples turn into invisible anchors. (turning them into fourth-level headings in their files, as would be necessary for emacs, removes them from the TOC anyway.)
This commit is contained in:
parent
25ec23b9aa
commit
90b4cb8ed2
1 changed files with 6 additions and 18 deletions
|
@ -251,15 +251,13 @@ in
|
||||||
<para>
|
<para>
|
||||||
The list of available packages in the various ELPA repositories can be seen
|
The list of available packages in the various ELPA repositories can be seen
|
||||||
with the following commands:
|
with the following commands:
|
||||||
<example xml:id="module-services-emacs-querying-packages">
|
<anchor xml:id="module-services-emacs-querying-packages" />
|
||||||
<title>Querying Emacs packages</title>
|
|
||||||
<programlisting><![CDATA[
|
<programlisting><![CDATA[
|
||||||
nix-env -f "<nixpkgs>" -qaP -A emacs.pkgs.elpaPackages
|
nix-env -f "<nixpkgs>" -qaP -A emacs.pkgs.elpaPackages
|
||||||
nix-env -f "<nixpkgs>" -qaP -A emacs.pkgs.melpaPackages
|
nix-env -f "<nixpkgs>" -qaP -A emacs.pkgs.melpaPackages
|
||||||
nix-env -f "<nixpkgs>" -qaP -A emacs.pkgs.melpaStablePackages
|
nix-env -f "<nixpkgs>" -qaP -A emacs.pkgs.melpaStablePackages
|
||||||
nix-env -f "<nixpkgs>" -qaP -A emacs.pkgs.orgPackages
|
nix-env -f "<nixpkgs>" -qaP -A emacs.pkgs.orgPackages
|
||||||
]]></programlisting>
|
]]></programlisting>
|
||||||
</example>
|
|
||||||
</para>
|
</para>
|
||||||
|
|
||||||
<para>
|
<para>
|
||||||
|
@ -267,8 +265,7 @@ nix-env -f "<nixpkgs>" -qaP -A emacs.pkgs.orgPackages
|
||||||
adding it to the list of system packages (see
|
adding it to the list of system packages (see
|
||||||
<xref linkend="sec-declarative-package-mgmt" />). Simply modify your file
|
<xref linkend="sec-declarative-package-mgmt" />). Simply modify your file
|
||||||
<filename>configuration.nix</filename> to make it contain:
|
<filename>configuration.nix</filename> to make it contain:
|
||||||
<example xml:id="module-services-emacs-configuration-nix">
|
<anchor xml:id="module-services-emacs-configuration-nix" />
|
||||||
<title>Custom Emacs in <filename>configuration.nix</filename></title>
|
|
||||||
<programlisting><![CDATA[
|
<programlisting><![CDATA[
|
||||||
{
|
{
|
||||||
environment.systemPackages = [
|
environment.systemPackages = [
|
||||||
|
@ -277,7 +274,6 @@ nix-env -f "<nixpkgs>" -qaP -A emacs.pkgs.orgPackages
|
||||||
];
|
];
|
||||||
}
|
}
|
||||||
]]></programlisting>
|
]]></programlisting>
|
||||||
</example>
|
|
||||||
</para>
|
</para>
|
||||||
|
|
||||||
<para>
|
<para>
|
||||||
|
@ -296,8 +292,7 @@ https://nixos.org/nixpkgs/manual/#sec-modify-via-packageOverrides
|
||||||
<filename>~/.config/nixpkgs/config.nix</filename> (see
|
<filename>~/.config/nixpkgs/config.nix</filename> (see
|
||||||
<link xlink:href="https://nixos.org/nixpkgs/manual/#sec-modify-via-packageOverrides">Nixpkgs
|
<link xlink:href="https://nixos.org/nixpkgs/manual/#sec-modify-via-packageOverrides">Nixpkgs
|
||||||
manual</link>):
|
manual</link>):
|
||||||
<example xml:id="module-services-emacs-config-nix">
|
<anchor xml:id="module-services-emacs-config-nix" />
|
||||||
<title>Custom Emacs in <filename>~/.config/nixpkgs/config.nix</filename></title>
|
|
||||||
<programlisting><![CDATA[
|
<programlisting><![CDATA[
|
||||||
{
|
{
|
||||||
packageOverrides = super: let self = super.pkgs; in {
|
packageOverrides = super: let self = super.pkgs; in {
|
||||||
|
@ -305,7 +300,6 @@ https://nixos.org/nixpkgs/manual/#sec-modify-via-packageOverrides
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
]]></programlisting>
|
]]></programlisting>
|
||||||
</example>
|
|
||||||
</para>
|
</para>
|
||||||
|
|
||||||
<para>
|
<para>
|
||||||
|
@ -327,8 +321,7 @@ https://nixos.org/nixpkgs/manual/#sec-modify-via-packageOverrides
|
||||||
<filename>emacs.nix</filename> in this way:
|
<filename>emacs.nix</filename> in this way:
|
||||||
</para>
|
</para>
|
||||||
|
|
||||||
<example xml:id="ex-emacsGtk3Nix">
|
<anchor xml:id="ex-emacsGtk3Nix" />
|
||||||
<title>Custom Emacs build</title>
|
|
||||||
<programlisting><![CDATA[
|
<programlisting><![CDATA[
|
||||||
{ pkgs ? import <nixpkgs> {} }:
|
{ pkgs ? import <nixpkgs> {} }:
|
||||||
let
|
let
|
||||||
|
@ -345,7 +338,6 @@ let
|
||||||
});
|
});
|
||||||
in [...]
|
in [...]
|
||||||
]]></programlisting>
|
]]></programlisting>
|
||||||
</example>
|
|
||||||
|
|
||||||
<para>
|
<para>
|
||||||
After building this file as shown in <xref linkend="ex-emacsNix" />, you
|
After building this file as shown in <xref linkend="ex-emacsNix" />, you
|
||||||
|
@ -483,8 +475,7 @@ systemctl --user enable emacs
|
||||||
<para>
|
<para>
|
||||||
The Emacs init file should be changed to load the extension packages at
|
The Emacs init file should be changed to load the extension packages at
|
||||||
startup:
|
startup:
|
||||||
<example xml:id="module-services-emacs-package-initialisation">
|
<anchor xml:id="module-services-emacs-package-initialisation" />
|
||||||
<title>Package initialization in <filename>.emacs</filename></title>
|
|
||||||
<programlisting><![CDATA[
|
<programlisting><![CDATA[
|
||||||
(require 'package)
|
(require 'package)
|
||||||
|
|
||||||
|
@ -494,7 +485,6 @@ systemctl --user enable emacs
|
||||||
(setq package-enable-at-startup nil)
|
(setq package-enable-at-startup nil)
|
||||||
(package-initialize)
|
(package-initialize)
|
||||||
]]></programlisting>
|
]]></programlisting>
|
||||||
</example>
|
|
||||||
</para>
|
</para>
|
||||||
|
|
||||||
<para>
|
<para>
|
||||||
|
@ -556,8 +546,7 @@ systemctl --user enable emacs
|
||||||
Then customize the variable <varname>rng-schema-locating-files</varname> to
|
Then customize the variable <varname>rng-schema-locating-files</varname> to
|
||||||
include <filename>~/.emacs.d/schemas.xml</filename> and put the following
|
include <filename>~/.emacs.d/schemas.xml</filename> and put the following
|
||||||
text into that file:
|
text into that file:
|
||||||
<example xml:id="ex-emacs-docbook-xml">
|
<anchor xml:id="ex-emacs-docbook-xml" />
|
||||||
<title>nXML Schema Configuration (<filename>~/.emacs.d/schemas.xml</filename>)</title>
|
|
||||||
<programlisting language="xml"><![CDATA[
|
<programlisting language="xml"><![CDATA[
|
||||||
<?xml version="1.0"?>
|
<?xml version="1.0"?>
|
||||||
<!--
|
<!--
|
||||||
|
@ -577,7 +566,6 @@ systemctl --user enable emacs
|
||||||
-->
|
-->
|
||||||
</locatingRules>
|
</locatingRules>
|
||||||
]]></programlisting>
|
]]></programlisting>
|
||||||
</example>
|
|
||||||
</para>
|
</para>
|
||||||
</section>
|
</section>
|
||||||
</section>
|
</section>
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue