File tree 1 file changed +31
-0
lines changed
1 file changed +31
-0
lines changed Original file line number Diff line number Diff line change 96
96
{ options , ... } :
97
97
let
98
98
opts = lib . getAttrFromPath loc options ;
99
+ docsfile = lib . concatStringsSep "/" loc ;
99
100
url =
100
101
if args . url or null == null then
101
102
opts . package . default . meta . homepage or ( throw "unable to get URL for `${ lib . showOption loc } `." )
102
103
else
103
104
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 ;
104
117
in
105
118
{
106
119
meta = {
110
123
path = loc ;
111
124
} ;
112
125
} ;
126
+
127
+ docs . pages . ${ docsfile } . text = lib . mkMerge (
128
+ [
129
+ "# ${ lib . last loc } "
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
+ ) ;
113
144
} ;
114
145
}
You can’t perform that action at this time.
0 commit comments