nix-community / nixdoc

Tool to generate documentation for Nix library functions [maintainer=@infinisil]
GNU General Public License v3.0
122 stars 14 forks source link

Multiline function attribute argument docs render incorrectly #75

Closed infinisil closed 11 months ago

infinisil commented 12 months ago

This file:

{
  /* Some description */
  f =
    {
      /*
      First line

      Second line
      */
      x,
    }: x;
}

Produces this markdown:

Some description

structured function argument

: `x`

  : First line

        Second line

The second line is indented too much, rendering it as code (only because of the spacing between the lines).

In Nixpkgs I had to unident the entire second paragraph as a workaround: https://github.com/NixOS/nixpkgs/blob/08f615eb1b3c5cf7481996f29c6092c7c891b15b/lib/fileset/default.nix#L72-L76

This could probably use the same fix as in #62