Do optional the crate description
parent
d65343d912
commit
beead99db8
|
@ -4,7 +4,7 @@ use serde::Serialize;
|
||||||
#[derive(Serialize, Debug, Clone)]
|
#[derive(Serialize, Debug, Clone)]
|
||||||
pub struct CrateInfo {
|
pub struct CrateInfo {
|
||||||
pub name: String,
|
pub name: String,
|
||||||
pub description: String,
|
pub description: Option<String>,
|
||||||
pub owner: String,
|
pub owner: String,
|
||||||
pub latest_version: Version,
|
pub latest_version: Version,
|
||||||
pub versions: Vec<Version>,
|
pub versions: Vec<Version>,
|
||||||
|
|
|
@ -106,11 +106,7 @@ pub fn search_crate(crate_name: String) -> Option<CrateInfo> {
|
||||||
} else {
|
} else {
|
||||||
let description = resp
|
let description = resp
|
||||||
.css_once(".desc")
|
.css_once(".desc")
|
||||||
.unwrap()
|
.map(|desc| desc.content().trim().replace("\n", " ").into());
|
||||||
.content()
|
|
||||||
.trim()
|
|
||||||
.replace('\n', " ")
|
|
||||||
.into();
|
|
||||||
let owner = resp
|
let owner = resp
|
||||||
.css("a.owner")
|
.css("a.owner")
|
||||||
.iter()
|
.iter()
|
||||||
|
|
|
@ -7,7 +7,9 @@
|
||||||
|
|
||||||
{%- if item -%}
|
{%- if item -%}
|
||||||
## {{ item.name }} v{{ item.latest_version.version }}
|
## {{ item.name }} v{{ item.latest_version.version }}
|
||||||
|
{% if item.description -%}
|
||||||
> {{ item.description }}
|
> {{ item.description }}
|
||||||
|
{%- endif %}
|
||||||
by {{ item.owner }} {% if item.license %}[{{ item.license }}]{% endif %}
|
by {{ item.owner }} {% if item.license %}[{{ item.license }}]{% endif %}
|
||||||
|
|
||||||
### Install by:
|
### Install by:
|
||||||
|
|
Loading…
Reference in New Issue