File tree Expand file tree Collapse file tree 1 file changed +32
-0
lines changed Expand file tree Collapse file tree 1 file changed +32
-0
lines changed Original file line number Diff line number Diff line change 9696 { options , ... } :
9797 let
9898 opts = lib . getAttrFromPath loc options ;
99+ docsfile = lib . concatStringsSep "/" loc ;
99100 url =
100101 if args . url or null == null then
101102 opts . package . default . meta . homepage or ( throw "unable to get URL for `${ lib . showOption loc } `." )
102103 else
103104 args . url ;
105+ maintainersString =
106+ let
107+ toMD = m : if m ? github then "[${ m . name } ](https://github.com/${ m . github } )" else m . name ;
108+ names = builtins . map toMD ( lib . unique maintainers ) ;
109+ count = builtins . length names ;
110+ in
111+ if count == 1 then
112+ builtins . head names
113+ else if count == 2 then
114+ lib . concatStringsSep " and " names
115+ else
116+ lib . concatMapStrings ( name : "\n - ${ name } " ) names ;
104117 in
105118 {
106119 meta = {
110123 path = loc ;
111124 } ;
112125 } ;
126+
127+ docs . options . ${ docsfile } = {
128+ title = lib . last loc ;
129+ description = lib . concatLines (
130+ [
131+ "**URL:** [${ url } ](${ url } )"
132+ ""
133+ ]
134+ ++ lib . optionals ( maintainers != [ ] ) [
135+ "**Maintainers:** ${ maintainersString } "
136+ ""
137+ ]
138+ ++ lib . optionals ( description != null && description != "" ) [
139+ "---"
140+ ""
141+ description
142+ ]
143+ ) ;
144+ } ;
113145 } ;
114146}
You can’t perform that action at this time.
0 commit comments