Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

doc: remove references to mdDoc in the manual #300738

Merged
merged 12 commits into from
Apr 1, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 8 additions & 11 deletions nixos/doc/manual/development/option-declarations.section.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ looks like this:
type = type specification;
default = default value;
example = example value;
description = lib.mdDoc "Description for use in the NixOS manual.";
description = "Description for use in the NixOS manual.";
};
};
}
Expand Down Expand Up @@ -58,12 +58,9 @@ The function `mkOption` accepts the following arguments.

`description`

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

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

Expand All @@ -81,13 +78,13 @@ For example:
::: {#ex-options-declarations-util-mkEnableOption-magic .example}
### `mkEnableOption` usage
```nix
lib.mkEnableOption (lib.mdDoc "magic")
lib.mkEnableOption "magic"
# is like
lib.mkOption {
type = lib.types.bool;
default = false;
example = true;
description = lib.mdDoc "Whether to enable magic.";
description = "Whether to enable magic.";
}
```
:::
Expand Down Expand Up @@ -135,7 +132,7 @@ lib.mkOption {
type = lib.types.package;
default = pkgs.hello;
defaultText = lib.literalExpression "pkgs.hello";
description = lib.mdDoc "The hello package to use.";
description = "The hello package to use.";
}
```
:::
Expand All @@ -153,7 +150,7 @@ lib.mkOption {
default = pkgs.ghc;
defaultText = lib.literalExpression "pkgs.ghc";
example = lib.literalExpression "pkgs.haskell.packages.ghc92.ghc.withPackages (hkgs: [ hkgs.primes ])";
description = lib.mdDoc "The GHC package to use.";
description = "The GHC package to use.";
}
```
:::
Expand Down
4 changes: 1 addition & 3 deletions nixos/lib/make-options-doc/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -117,9 +117,7 @@
# deprecated since 23.11.
# TODO remove in a while.
, allowDocBook ? false
# whether lib.mdDoc is required for descriptions to be read as markdown.
# deprecated since 23.11.
# TODO remove in a while.
# TODO remove in a while (see https://github.com/NixOS/nixpkgs/issues/300735)
, markdownByDefault ? true
}:

Expand Down
9 changes: 4 additions & 5 deletions nixos/lib/systemd-types.nix
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,6 @@ let
;

inherit (lib)
mdDoc
mkDefault
mkDerivedConfig
mkEnableOption
Expand Down Expand Up @@ -81,11 +80,11 @@ rec {

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

target = mkOption {
type = path;
description = mdDoc ''
description = ''
Path of the symlink.
'';
default = name;
Expand All @@ -94,12 +93,12 @@ rec {
text = mkOption {
default = null;
type = nullOr lines;
description = mdDoc "Text of the file.";
description = "Text of the file.";
};

source = mkOption {
type = path;
description = mdDoc "Path of the source file.";
description = "Path of the source file.";
};
};

Expand Down
Loading