fn document_short(
    w: &mut Buffer,
    item: &clean::Item,
    cx: &Context<'_>,
    link: AssocItemLink<'_>,
    prefix: &str,
    is_hidden: bool,
    parent: Option<&clean::Item>,
    show_def_docs: bool,
) {
    document_item_info(w, cx, item, is_hidden, parent);
    if !show_def_docs {
        return;
    }
    if let Some(s) = item.doc_value() {
        let mut summary_html = MarkdownSummaryLine(&s, &item.links(&cx.cache)).into_string();

        if s.contains('\n') {
            let link =
                format!(r#" <a href="{}">Read more</a>"#, naive_assoc_href(item, link, cx.cache()));

            if let Some(idx) = summary_html.rfind("</p>") {
                summary_html.insert_str(idx, &link);
            } else {
                summary_html.push_str(&link);
            }
        }

        write!(
            w,
            "<div class='docblock{}'>{}{}</div>",
            if is_hidden { " hidden" } else { "" },
            prefix,
            summary_html,
        );
    } else if !prefix.is_empty() {
        write!(
            w,
            "<div class=\"docblock{}\">{}</div>",
            if is_hidden { " hidden" } else { "" },
            prefix
        );
    }
}
/// Writes a documentation block containing only the first paragraph of the documentation. If the
/// docs are longer, a "Read more" link is appended to the end.
Writes a documentation block containing only the first paragraph of the documentation. If the
docs are longer, a "Read more" link is appended to the end.
Writes a documentation block containing only the first paragraph of the documentation . If the docs are longer a " Read more " link is appended to the end .
fn document_short(
    w: &mut Buffer,
    item: &clean::Item,
    cx: &Context<'_>,
    link: AssocItemLink<'_>,
    prefix: &str,
    is_hidden: bool,
    parent: Option<&clean::Item>,
    show_def_docs: bool,
) {
    document_item_info(w, cx, item, is_hidden, parent);
    if !show_def_docs {
        return;
    }
    if let Some(s) = item.doc_value() {
        let mut summary_html = MarkdownSummaryLine(&s, &item.links(&cx.cache)).into_string();
        if s.contains('\n') {
            let link =
                format!(r#" <a href="{}">Read more</a>"#, naive_assoc_href(item, link, cx.cache()));
            if let Some(idx) = summary_html.rfind("</p>") {
                summary_html.insert_str(idx, &link);
            } else {
                summary_html.push_str(&link);
            }
        }
        write!(
            w,
            "<div class='docblock{}'>{}{}</div>",
            if is_hidden { " hidden" } else { "" },
            prefix,
            summary_html,
        );
    } else if !prefix.is_empty() {
        write!(
            w,
            "<div class=\"docblock{}\">{}</div>",
            if is_hidden { " hidden" } else { "" },
            prefix
        );
    }
}
fn document_short ( w : & mut Buffer , item : & clean :: Item , cx : & Context < ' _ > , link : AssocItemLink < ' _ > , prefix : & str , is_hidden : bool , parent : Option < & clean :: Item > , show_def_docs : bool , ) { document_item_info ( w , cx , item , is_hidden , parent ) ; if ! show_def_docs { return ; } if let Some ( s ) = item . doc_value ( ) { let mut summary_html = MarkdownSummaryLine ( & s , & item . links ( & cx . cache ) ) . into_string ( ) ; if s . contains ( '\n' ) { let link = format ! ( r#" <a href="{}">Read more</a>"# naive_assoc_href ( item link cx cache ( ) ) ) ; if let Some ( idx ) = summary_html . rfind ( " " ) { summary_html . insert_str ( idx , & link ) ; } else { summary_html . push_str ( & link ) ; } } write ! ( w " " if is_hidden { " " } else { " " } prefix summary_html ) ; } else if ! prefix . is_empty ( ) { write ! ( w " \" \" " if is_hidden { " " } else { " " } prefix ) ; } }
Writes a documentation block containing only the first paragraph of the documentation.
Writes a documentation block containing only the first paragraph of the documentation .
w
&mut Buffer
item
&clean::Item
cx
&Context<'_>
link
AssocItemLink<'_>
prefix
&str
is_hidden
bool
parent
Option<&clean::Item>
show_def_docs
bool
w
&mut Buffer
item
&clean::Item
cx
&Context<'_>
link
AssocItemLink<'_>
prefix
&str
is_hidden
bool
parent
Option<&clean::Item>
show_def_docs
bool