rustdoc: clean up CSS/DOM for deprecation warnings
This commit is contained in:
parent
8ab71ab59f
commit
dedf6fcde4
3 changed files with 12 additions and 24 deletions
|
@ -111,14 +111,9 @@ pub(crate) struct MarkdownWithToc<'a>(
|
||||||
pub(crate) Edition,
|
pub(crate) Edition,
|
||||||
pub(crate) &'a Option<Playground>,
|
pub(crate) &'a Option<Playground>,
|
||||||
);
|
);
|
||||||
/// A tuple struct like `Markdown` that renders the markdown escaping HTML tags.
|
/// A tuple struct like `Markdown` that renders the markdown escaping HTML tags
|
||||||
pub(crate) struct MarkdownHtml<'a>(
|
/// and includes no paragraph tags.
|
||||||
pub(crate) &'a str,
|
pub(crate) struct MarkdownItemInfo<'a>(pub(crate) &'a str, pub(crate) &'a mut IdMap);
|
||||||
pub(crate) &'a mut IdMap,
|
|
||||||
pub(crate) ErrorCodes,
|
|
||||||
pub(crate) Edition,
|
|
||||||
pub(crate) &'a Option<Playground>,
|
|
||||||
);
|
|
||||||
/// A tuple struct like `Markdown` that renders only the first paragraph.
|
/// A tuple struct like `Markdown` that renders only the first paragraph.
|
||||||
pub(crate) struct MarkdownSummaryLine<'a>(pub &'a str, pub &'a [RenderedLink]);
|
pub(crate) struct MarkdownSummaryLine<'a>(pub &'a str, pub &'a [RenderedLink]);
|
||||||
|
|
||||||
|
@ -1072,9 +1067,9 @@ impl MarkdownWithToc<'_> {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
impl MarkdownHtml<'_> {
|
impl MarkdownItemInfo<'_> {
|
||||||
pub(crate) fn into_string(self) -> String {
|
pub(crate) fn into_string(self) -> String {
|
||||||
let MarkdownHtml(md, ids, codes, edition, playground) = self;
|
let MarkdownItemInfo(md, ids) = self;
|
||||||
|
|
||||||
// This is actually common enough to special-case
|
// This is actually common enough to special-case
|
||||||
if md.is_empty() {
|
if md.is_empty() {
|
||||||
|
@ -1093,7 +1088,9 @@ impl MarkdownHtml<'_> {
|
||||||
let p = HeadingLinks::new(p, None, ids, HeadingOffset::H1);
|
let p = HeadingLinks::new(p, None, ids, HeadingOffset::H1);
|
||||||
let p = Footnotes::new(p);
|
let p = Footnotes::new(p);
|
||||||
let p = TableWrapper::new(p.map(|(ev, _)| ev));
|
let p = TableWrapper::new(p.map(|(ev, _)| ev));
|
||||||
let p = CodeBlocks::new(p, codes, edition, playground);
|
let p = p.filter(|event| {
|
||||||
|
!matches!(event, Event::Start(Tag::Paragraph) | Event::End(Tag::Paragraph))
|
||||||
|
});
|
||||||
html::push_html(&mut s, p);
|
html::push_html(&mut s, p);
|
||||||
|
|
||||||
s
|
s
|
||||||
|
|
|
@ -74,7 +74,9 @@ use crate::html::format::{
|
||||||
PrintWithSpace,
|
PrintWithSpace,
|
||||||
};
|
};
|
||||||
use crate::html::highlight;
|
use crate::html::highlight;
|
||||||
use crate::html::markdown::{HeadingOffset, IdMap, Markdown, MarkdownHtml, MarkdownSummaryLine};
|
use crate::html::markdown::{
|
||||||
|
HeadingOffset, IdMap, Markdown, MarkdownItemInfo, MarkdownSummaryLine,
|
||||||
|
};
|
||||||
use crate::html::sources;
|
use crate::html::sources;
|
||||||
use crate::html::static_files::SCRAPE_EXAMPLES_HELP_MD;
|
use crate::html::static_files::SCRAPE_EXAMPLES_HELP_MD;
|
||||||
use crate::scrape_examples::{CallData, CallLocation};
|
use crate::scrape_examples::{CallData, CallLocation};
|
||||||
|
@ -582,7 +584,6 @@ fn short_item_info(
|
||||||
parent: Option<&clean::Item>,
|
parent: Option<&clean::Item>,
|
||||||
) -> Vec<String> {
|
) -> Vec<String> {
|
||||||
let mut extra_info = vec![];
|
let mut extra_info = vec![];
|
||||||
let error_codes = cx.shared.codes;
|
|
||||||
|
|
||||||
if let Some(depr @ Deprecation { note, since, is_since_rustc_version: _, suggestion: _ }) =
|
if let Some(depr @ Deprecation { note, since, is_since_rustc_version: _, suggestion: _ }) =
|
||||||
item.deprecation(cx.tcx())
|
item.deprecation(cx.tcx())
|
||||||
|
@ -606,13 +607,7 @@ fn short_item_info(
|
||||||
|
|
||||||
if let Some(note) = note {
|
if let Some(note) = note {
|
||||||
let note = note.as_str();
|
let note = note.as_str();
|
||||||
let html = MarkdownHtml(
|
let html = MarkdownItemInfo(note, &mut cx.id_map);
|
||||||
note,
|
|
||||||
&mut cx.id_map,
|
|
||||||
error_codes,
|
|
||||||
cx.shared.edition(),
|
|
||||||
&cx.shared.playground,
|
|
||||||
);
|
|
||||||
message.push_str(&format!(": {}", html.into_string()));
|
message.push_str(&format!(": {}", html.into_string()));
|
||||||
}
|
}
|
||||||
extra_info.push(format!(
|
extra_info.push(format!(
|
||||||
|
|
|
@ -1078,10 +1078,6 @@ so that we can apply CSS-filters to change the arrow color in themes */
|
||||||
font-size: 0.875rem;
|
font-size: 0.875rem;
|
||||||
font-weight: normal;
|
font-weight: normal;
|
||||||
}
|
}
|
||||||
.stab p {
|
|
||||||
display: inline;
|
|
||||||
margin: 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
.stab .emoji {
|
.stab .emoji {
|
||||||
font-size: 1.25rem;
|
font-size: 1.25rem;
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue