From 407f6196a23f8b0b42c74c66f2717645aa277bbd Mon Sep 17 00:00:00 2001 From: pennae Date: Wed, 8 Mar 2023 09:15:48 +0100 Subject: nixos-render-docs: add examples support the nixos manual contains enough examples to support them as a proper toc entity with specialized rendering, and if in the future the nixpkgs wants to use nixos-render-docs we will definitely have to support them. this also allows us to restore some examples that were lost in previous translation steps because there were too few to add renderer support back then. --- nixos/doc/manual/development/option-types.section.md | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) (limited to 'nixos/doc/manual/development/option-types.section.md') diff --git a/nixos/doc/manual/development/option-types.section.md b/nixos/doc/manual/development/option-types.section.md index 51977c58333f9..9e2ecb8e35626 100644 --- a/nixos/doc/manual/development/option-types.section.md +++ b/nixos/doc/manual/development/option-types.section.md @@ -36,7 +36,7 @@ merging is handled. together. This type is recommended when the option type is unknown. ::: {#ex-types-anything .example} - **Example: `types.anything` Example** + ### `types.anything` Two definitions of this type like @@ -356,7 +356,7 @@ you will still need to provide a default value (e.g. an empty attribute set) if you want to allow users to leave it undefined. ::: {#ex-submodule-direct .example} -**Example: Directly defined submodule** +### Directly defined submodule ```nix options.mod = mkOption { description = "submodule example"; @@ -375,7 +375,7 @@ options.mod = mkOption { ::: ::: {#ex-submodule-reference .example} -**Example: Submodule defined as a reference** +### Submodule defined as a reference ```nix let modOptions = { @@ -403,7 +403,7 @@ multiple definitions of the submodule option set ([Example: Definition of a list of submodules](#ex-submodule-listof-definition)). ::: {#ex-submodule-listof-declaration .example} -**Example: Declaration of a list of submodules** +### Declaration of a list of submodules ```nix options.mod = mkOption { description = "submodule example"; @@ -422,7 +422,7 @@ options.mod = mkOption { ::: ::: {#ex-submodule-listof-definition .example} -**Example: Definition of a list of submodules** +### Definition of a list of submodules ```nix config.mod = [ { foo = 1; bar = "one"; } @@ -437,7 +437,7 @@ multiple named definitions of the submodule option set ([Example: Definition of attribute sets of submodules](#ex-submodule-attrsof-definition)). ::: {#ex-submodule-attrsof-declaration .example} -**Example: Declaration of attribute sets of submodules** +### Declaration of attribute sets of submodules ```nix options.mod = mkOption { description = "submodule example"; @@ -456,7 +456,7 @@ options.mod = mkOption { ::: ::: {#ex-submodule-attrsof-definition .example} -**Example: Definition of attribute sets of submodules** +### Definition of attribute sets of submodules ```nix config.mod.one = { foo = 1; bar = "one"; }; config.mod.two = { foo = 2; bar = "two"; }; @@ -476,7 +476,7 @@ Types are mainly characterized by their `check` and `merge` functions. ([Example: Overriding a type check](#ex-extending-type-check-2)). ::: {#ex-extending-type-check-1 .example} - **Example: Adding a type check** + ### Adding a type check ```nix byte = mkOption { @@ -487,7 +487,7 @@ Types are mainly characterized by their `check` and `merge` functions. ::: ::: {#ex-extending-type-check-2 .example} - **Example: Overriding a type check** + ### Overriding a type check ```nix nixThings = mkOption { -- cgit 1.4.1