diff options
author | Jan Tojnar <jtojnar@gmail.com> | 2020-09-23 00:38:04 +0200 |
---|---|---|
committer | Jan Tojnar <jtojnar@gmail.com> | 2020-09-23 01:25:25 +0200 |
commit | e1af37634b387e18361f15b2db1c7f7f93d37ebc (patch) | |
tree | b2d13f6759d5212216bba8e454ba0d2d41391f7e /doc/builders | |
parent | 47297487c55762e206d53127f3b02b9c2901d31f (diff) |
doc: Improve code listings
By adding prompts and removing unnecessary indentation.
Diffstat (limited to 'doc/builders')
-rw-r--r-- | doc/builders/images/dockertools.xml | 12 | ||||
-rw-r--r-- | doc/builders/images/ocitools.xml | 3 | ||||
-rw-r--r-- | doc/builders/packages/citrix.xml | 8 | ||||
-rw-r--r-- | doc/builders/packages/urxvt.xml | 50 |
4 files changed, 43 insertions, 30 deletions
diff --git a/doc/builders/images/dockertools.xml b/doc/builders/images/dockertools.xml index 126698d0a9ed..d881e712a041 100644 --- a/doc/builders/images/dockertools.xml +++ b/doc/builders/images/dockertools.xml @@ -132,11 +132,11 @@ buildImage { <para> By default <function>buildImage</function> will use a static date of one second past the UNIX Epoch. This allows <function>buildImage</function> to produce binary reproducible images. When listing images with <command>docker images</command>, the newly created images will be listed like this: </para> -<screen><![CDATA[ -$ docker images +<screen> +<prompt>$ </prompt>docker images REPOSITORY TAG IMAGE ID CREATED SIZE hello latest 08c791c7846e 48 years ago 25.2MB -]]></screen> +</screen> <para> You can break binary reproducibility but have a sorted, meaningful <literal>CREATED</literal> column by setting <literal>created</literal> to <literal>now</literal>. </para> @@ -152,11 +152,11 @@ pkgs.dockerTools.buildImage { ]]></programlisting> <para> and now the Docker CLI will display a reasonable date and sort the images as expected: -<screen><![CDATA[ -$ docker images +<screen> +<prompt>$ </prompt>docker images REPOSITORY TAG IMAGE ID CREATED SIZE hello latest de2bf4786de6 About a minute ago 25.2MB -]]></screen> +</screen> however, the produced images will not be binary reproducible. </para> </example> diff --git a/doc/builders/images/ocitools.xml b/doc/builders/images/ocitools.xml index e8cd3472f54d..f26ed8644276 100644 --- a/doc/builders/images/ocitools.xml +++ b/doc/builders/images/ocitools.xml @@ -38,8 +38,7 @@ buildContainer { readonly = false; <co xml:id='ex-ociTools-buildContainer-3' /> } - - </programlisting> +</programlisting> <calloutlist> <callout arearefs='ex-ociTools-buildContainer-1'> <para> diff --git a/doc/builders/packages/citrix.xml b/doc/builders/packages/citrix.xml index 16f1bc6f8f21..803eb2e4fc40 100644 --- a/doc/builders/packages/citrix.xml +++ b/doc/builders/packages/citrix.xml @@ -22,10 +22,10 @@ </para> <para> In order to set this up, you first have to <link xlink:href="https://its.uiowa.edu/support/article/102186">download the <literal>.cr</literal> file from the Netscaler Gateway</link>. After that you can configure the <command>selfservice</command> like this: - <screen> - <prompt>$ </prompt>storebrowse -C ~/Downloads/receiverconfig.cr - <prompt>$ </prompt>selfservice - </screen> +<screen> +<prompt>$ </prompt>storebrowse -C ~/Downloads/receiverconfig.cr +<prompt>$ </prompt>selfservice +</screen> </para> </section> diff --git a/doc/builders/packages/urxvt.xml b/doc/builders/packages/urxvt.xml index 135cc82a0b51..330e056b6560 100644 --- a/doc/builders/packages/urxvt.xml +++ b/doc/builders/packages/urxvt.xml @@ -18,10 +18,13 @@ includes all available plugins. To make use of this functionality, use an overlay or directly install an expression that overrides its configuration, such as - <programlisting>rxvt-unicode.override { configure = { availablePlugins, ... }: { +<programlisting> +rxvt-unicode.override { + configure = { availablePlugins, ... }: { plugins = with availablePlugins; [ perls resize-font vtwheel ]; - } -}</programlisting> + }; +} +</programlisting> If the <literal>configure</literal> function returns an attrset without the <literal>plugins</literal> attribute, <literal>availablePlugins</literal> will be used automatically. @@ -30,18 +33,22 @@ <para> In order to add plugins but also keep all default plugins installed, it is possible to use the following method: - <programlisting>rxvt-unicode.override { configure = { availablePlugins, ... }: { - plugins = (builtins.attrValues availablePlugins) ++ [ custom-plugin ]; - }; -}</programlisting> +<programlisting> +rxvt-unicode.override { + configure = { availablePlugins, ... }: { + plugins = (builtins.attrValues availablePlugins) ++ [ custom-plugin ]; + }; +} +</programlisting> </para> <para> To get a list of all the plugins available, open the Nix REPL and run - <programlisting>$ nix repl +<screen> +<prompt>$ </prompt>nix repl :l <nixpkgs> map (p: p.name) pkgs.rxvt-unicode.plugins - </programlisting> +</screen> Alternatively, if your shell is bash or zsh and have completion enabled, simply type <literal>nixpkgs.rxvt-unicode.plugins.<tab></literal>. </para> @@ -53,18 +60,24 @@ map (p: p.name) pkgs.rxvt-unicode.plugins <literal>extraDeps</literal> can be used, for example, to provide <literal>xsel</literal> (a clipboard manager) to the clipboard plugin, without installing it globally: - <programlisting>rxvt-unicode.override { configure = { availablePlugins, ... }: { - pluginsDeps = [ xsel ]; - } -}</programlisting> +<programlisting> +rxvt-unicode.override { + configure = { availablePlugins, ... }: { + pluginsDeps = [ xsel ]; + }; +} +</programlisting> <literal>perlDeps</literal> is a handy way to provide Perl packages to your custom plugins (in <literal>$HOME/.urxvt/ext</literal>). For example, if you need <literal>AnyEvent</literal> you can do: - <programlisting>rxvt-unicode.override { configure = { availablePlugins, ... }: { - perlDeps = with perlPackages; [ AnyEvent ]; - } -}</programlisting> +<programlisting> +rxvt-unicode.override { + configure = { availablePlugins, ... }: { + perlDeps = with perlPackages; [ AnyEvent ]; + }; +} +</programlisting> </para> </section> @@ -90,7 +103,8 @@ map (p: p.name) pkgs.rxvt-unicode.plugins <para> If the plugin is itself a perl package that needs to be imported from other plugins or scripts, add the following passthrough: - <programlisting>passthru.perlPackages = [ "self" ]; +<programlisting> +passthru.perlPackages = [ "self" ]; </programlisting> This will make the urxvt wrapper pick up the dependency and set up the perl path accordingly. |