Skip to content

Commit ebde306

Browse files
authored
nixos/lib, doc: remove references to mdDoc (#300738)
* doc: remove references to mdDoc in nixos/doc/manual/development/option-declarations.section.md * nixos/lib: remove mdDoc in nixos/lib/make-options-doc/default.nix * nixos/lib: remove mdDoc in nixos/lib/systemd-types.nix * nixos/lib: remove mdDoc in nixos/lib/systemd-unit-options.nix * nixos/lib: remove mdDoc in nixos/lib/testing/driver.nix * nixos/lib: remove mdDoc in nixos/lib/testing/interactive.nix * nixos/lib: remove mdDoc in nixos/lib/testing/meta.nix * nixos/lib: remove mdDoc in nixos/lib/testing/name.nix * nixos/lib: remove mdDoc in nixos/lib/testing/network.nix * nixos/lib: remove mdDoc in nixos/lib/testing/nodes.nix * nixos/lib: remove mdDoc in nixos/lib/testing/run.nix * nixos/lib: remove mdDoc in nixos/lib/testing/testScript.nix
1 parent abe7e2f commit ebde306

File tree

12 files changed

+102
-111
lines changed

12 files changed

+102
-111
lines changed

nixos/doc/manual/development/option-declarations.section.md

Lines changed: 8 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ looks like this:
1212
type = type specification;
1313
default = default value;
1414
example = example value;
15-
description = lib.mdDoc "Description for use in the NixOS manual.";
15+
description = "Description for use in the NixOS manual.";
1616
};
1717
};
1818
}
@@ -58,12 +58,9 @@ The function `mkOption` accepts the following arguments.
5858

5959
`description`
6060

61-
: A textual description of the option, in [Nixpkgs-flavored Markdown](
62-
https://nixos.org/nixpkgs/manual/#sec-contributing-markup) format, that will be
63-
included in the NixOS manual. During the migration process from DocBook
64-
it is necessary to mark descriptions written in CommonMark with `lib.mdDoc`.
65-
The description may still be written in DocBook (without any marker), but this
66-
is discouraged and will be deprecated in the future.
61+
: A textual description of the option in [Nixpkgs-flavored Markdown](
62+
https://nixos.org/nixpkgs/manual/#sec-contributing-markup) format that will be
63+
included in the NixOS manual.
6764

6865
## Utility functions for common option patterns {#sec-option-declarations-util}
6966

@@ -81,13 +78,13 @@ For example:
8178
::: {#ex-options-declarations-util-mkEnableOption-magic .example}
8279
### `mkEnableOption` usage
8380
```nix
84-
lib.mkEnableOption (lib.mdDoc "magic")
81+
lib.mkEnableOption "magic"
8582
# is like
8683
lib.mkOption {
8784
type = lib.types.bool;
8885
default = false;
8986
example = true;
90-
description = lib.mdDoc "Whether to enable magic.";
87+
description = "Whether to enable magic.";
9188
}
9289
```
9390
:::
@@ -135,7 +132,7 @@ lib.mkOption {
135132
type = lib.types.package;
136133
default = pkgs.hello;
137134
defaultText = lib.literalExpression "pkgs.hello";
138-
description = lib.mdDoc "The hello package to use.";
135+
description = "The hello package to use.";
139136
}
140137
```
141138
:::
@@ -153,7 +150,7 @@ lib.mkOption {
153150
default = pkgs.ghc;
154151
defaultText = lib.literalExpression "pkgs.ghc";
155152
example = lib.literalExpression "pkgs.haskell.packages.ghc92.ghc.withPackages (hkgs: [ hkgs.primes ])";
156-
description = lib.mdDoc "The GHC package to use.";
153+
description = "The GHC package to use.";
157154
}
158155
```
159156
:::

nixos/lib/make-options-doc/default.nix

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -117,9 +117,7 @@
117117
# deprecated since 23.11.
118118
# TODO remove in a while.
119119
, allowDocBook ? false
120-
# whether lib.mdDoc is required for descriptions to be read as markdown.
121-
# deprecated since 23.11.
122-
# TODO remove in a while.
120+
# TODO remove in a while (see https://github.com/NixOS/nixpkgs/issues/300735)
123121
, markdownByDefault ? true
124122
}:
125123

nixos/lib/systemd-types.nix

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,6 @@ let
3131
;
3232

3333
inherit (lib)
34-
mdDoc
3534
mkDefault
3635
mkDerivedConfig
3736
mkEnableOption
@@ -81,11 +80,11 @@ rec {
8180

8281
initrdContents = attrsOf (submodule ({ config, options, name, ... }: {
8382
options = {
84-
enable = mkEnableOption (mdDoc "copying of this file and symlinking it") // { default = true; };
83+
enable = (mkEnableOption "copying of this file and symlinking it") // { default = true; };
8584

8685
target = mkOption {
8786
type = path;
88-
description = mdDoc ''
87+
description = ''
8988
Path of the symlink.
9089
'';
9190
default = name;
@@ -94,12 +93,12 @@ rec {
9493
text = mkOption {
9594
default = null;
9695
type = nullOr lines;
97-
description = mdDoc "Text of the file.";
96+
description = "Text of the file.";
9897
};
9998

10099
source = mkOption {
101100
type = path;
102-
description = mdDoc "Path of the source file.";
101+
description = "Path of the source file.";
103102
};
104103
};
105104

0 commit comments

Comments
 (0)