File tree Expand file tree Collapse file tree 1 file changed +18
-2
lines changed
Expand file tree Collapse file tree 1 file changed +18
-2
lines changed Original file line number Diff line number Diff line change 4747 in
4848 map ( p : repack ( unpack p ) ) ;
4949
50+ mkUrl = root : path : "${ root . url } /tree/${ root . branch } /${ path } " ;
51+
5052 # Transforms a module path into a (path, url) tuple where path is relative
5153 # to the repo root, and URL points to an online view of the module.
5254 mkDeclaration =
6971 else
7072 rec {
7173 path = removePrefix root . prefix decl ;
72- url = " ${ root . url } /tree/ ${ root . branch } / ${ path } " ;
74+ url = mkUrl root path ;
7375 } ;
7476
7577 # Sort modules and put "enable" and "package" declarations first.
114116 )
115117 ) ;
116118
117- inherit ( import ../nix/commands/lib.nix { inherit pkgs ; } ) mkLocLast nestedOptionsType ;
119+ inherit ( import ../nix/commands/lib.nix { inherit pkgs ; } )
120+ mkLocLast
121+ nestedOptionsType
122+ flatOptionsType
123+ ;
118124
119125 # TODO: display values like TOML instead.
120126 toMarkdown = optionsDocs :
174180 doc = [
175181 "# `devshell` options\n "
176182 "## Available only in `Nix`\n "
183+ (
184+ let
185+ root = head cfg . roots ;
186+ path = "nix/commands/examples.nix" ;
187+ mkLink = path : "[link](${ mkUrl root path } )" ;
188+ in
189+ ''
190+ See how `commands.<name>` (${ mkLink "nix/commands/examples.nix" } ) maps to `commands.*` (${ mkLink "tests/extra/lib.flattenCommands.nix" } ).
191+ ''
192+ )
177193 ( concatStringsSep "\n " ( map optToMd nixOnly_ ) )
178194 "## Available in `Nix` and `TOML`\n "
179195 ( concatStringsSep "\n " ( map optToMd nixTOML ) )
You can’t perform that action at this time.
0 commit comments