|
51 | 51 |
|
52 | 52 | ${maybeSubcommands}
|
53 | 53 |
|
54 |
| - ${maybeStoreDocs} |
| 54 | + ${maybeProse} |
55 | 55 |
|
56 | 56 | ${maybeOptions}
|
57 | 57 | '';
|
|
91 | 91 | * [`${command} ${name}`](./${appendName filename name}.md) - ${subcmd.description}
|
92 | 92 | '';
|
93 | 93 |
|
94 |
| - # FIXME: this is a hack. |
95 |
| - # store parameters should not be part of command documentation to begin |
96 |
| - # with, but instead be rendered on separate pages. |
97 |
| - maybeStoreDocs = optionalString (details ? doc) |
98 |
| - (replaceStrings [ "@stores@" ] [ (showStoreDocs inlineHTML commandInfo.stores) ] details.doc); |
99 |
| - |
100 |
| - maybeOptions = let |
101 |
| - allVisibleOptions = filterAttrs |
102 |
| - (_: o: ! o.hiddenCategory) |
103 |
| - (details.flags // toplevel.flags); |
104 |
| - in optionalString (allVisibleOptions != {}) '' |
105 |
| - # Options |
106 |
| -
|
107 |
| - ${showOptions inlineHTML allVisibleOptions} |
| 94 | + maybeProse = |
| 95 | + # FIXME: this is a horrible hack to keep `nix help-stores` working. |
| 96 | + # the correct answer to this is to remove that command and replace it |
| 97 | + # by statically generated manpages or the output of something like `nix |
| 98 | + # store info <store type>`. |
| 99 | + let |
| 100 | + help-stores = '' |
| 101 | + ${index} |
108 | 102 |
|
109 |
| - > **Note** |
110 |
| - > |
111 |
| - > See [`man nix.conf`](@docroot@/command-ref/conf-file.md#command-line-flags) for overriding configuration settings with command line flags. |
112 |
| - ''; |
| 103 | + ${allStores} |
| 104 | + ''; |
| 105 | + index = replaceStrings |
| 106 | + [ "@store-types@" ] [ storesOverview ] |
| 107 | + details.doc; |
| 108 | + storesOverview = |
| 109 | + let |
| 110 | + showEntry = store: |
| 111 | + "- [${store.name}](#${store.slug})"; |
| 112 | + in |
| 113 | + concatStringsSep "\n" (map showEntry storesList) + "\n"; |
| 114 | + allStores = concatStringsSep "\n" (attrValues storePages); |
| 115 | + storePages = listToAttrs |
| 116 | + (map (s: { name = s.filename; value = s.page; }) storesList); |
| 117 | + storesList = showStoreDocs { |
| 118 | + storeInfo = commandInfo.stores; |
| 119 | + inherit inlineHTML; |
| 120 | + }; |
| 121 | + in |
| 122 | + optionalString (details ? doc) ( |
| 123 | + if match "@store-types@" details.doc != [ ] |
| 124 | + then help-stores |
| 125 | + else details.doc |
| 126 | + ); |
| 127 | + |
| 128 | + maybeOptions = |
| 129 | + let |
| 130 | + allVisibleOptions = filterAttrs |
| 131 | + (_: o: ! o.hiddenCategory) |
| 132 | + (details.flags // toplevel.flags); |
| 133 | + in |
| 134 | + optionalString (allVisibleOptions != { }) '' |
| 135 | + # Options |
| 136 | +
|
| 137 | + ${showOptions inlineHTML allVisibleOptions} |
| 138 | +
|
| 139 | + > **Note** |
| 140 | + > |
| 141 | + > See [`man nix.conf`](@docroot@/command-ref/conf-file.md#command-line-flags) for overriding configuration settings with command line flags. |
| 142 | + ''; |
113 | 143 |
|
114 | 144 | showOptions = inlineHTML: allOptions:
|
115 | 145 | let
|
|
0 commit comments