@@ -174,27 +174,38 @@ fn render_deps<'a, 'b>(
174
174
license_set : & mut BTreeSet < String > ,
175
175
) -> Result < ( ) , Error > {
176
176
for dep in deps {
177
- let authors_list = dep. authors . join ( ", " ) ;
177
+ let authors_list = if dep. authors . is_empty ( ) {
178
+ "None Specified" . to_owned ( )
179
+ } else {
180
+ dep. authors . join ( ", " )
181
+ } ;
178
182
let url = format ! ( "https://crates.io/crates/{}/{}" , dep. name, dep. version) ;
179
183
writeln ! ( buffer) ?;
180
184
writeln ! (
181
185
buffer,
182
- r#"<h3><a href="{url}">{ name} {version}</a> </h3>"# ,
186
+ r#"<h3>📦 { name}- {version}</h3>"# ,
183
187
name = dep. name,
184
188
version = dep. version,
185
- url = url,
186
189
) ?;
187
- writeln ! ( buffer, "<h4>Authors</h4><p>{}</p>" , escape_html( & authors_list) ) ?;
188
- writeln ! ( buffer, "<h4>License</h4><p>{}</p>" , escape_html( & dep. license) ) ?;
190
+ writeln ! ( buffer, r#"<p><b>URL:</b> <a href="{url}">{url}</a></p>"# , ) ?;
191
+ writeln ! ( buffer, "<p><b>Authors:</b> {}</p>" , escape_html( & authors_list) ) ?;
192
+ writeln ! ( buffer, "<p><b>License:</b> {}</p>" , escape_html( & dep. license) ) ?;
189
193
license_set. insert ( dep. license . clone ( ) ) ;
190
- for ( name, contents) in & dep. notices {
191
- writeln ! ( buffer) ?;
192
- writeln ! ( buffer, "<h4>{}</h3>" , name. to_string_lossy( ) ) ?;
193
- writeln ! ( buffer) ?;
194
- writeln ! ( buffer, "<details><summary>Click to expand</summary>" ) ?;
195
- writeln ! ( buffer, "<pre>\n {}\n </pre>" , contents) ?;
196
- writeln ! ( buffer, "</details>" ) ?;
194
+ writeln ! ( buffer, "<p><b>Notices:</b> " ) ?;
195
+ if dep. notices . is_empty ( ) {
196
+ writeln ! ( buffer, "None" ) ?;
197
+ } else {
198
+ for ( name, contents) in & dep. notices {
199
+ writeln ! (
200
+ buffer,
201
+ "<details><summary><code>{}</code></summary>" ,
202
+ name. to_string_lossy( )
203
+ ) ?;
204
+ writeln ! ( buffer, "<pre>\n {}\n </pre>" , contents) ?;
205
+ writeln ! ( buffer, "</details>" ) ?;
206
+ }
197
207
}
208
+ writeln ! ( buffer, "</p>" ) ?;
198
209
}
199
210
Ok ( ( ) )
200
211
}
0 commit comments