#[doc = crate::_tags!(internal)]
#[doc = crate::_doc_location!("yard")]
#[cfg_attr(cargo_primary_package, doc(hidden))]
#[cfg_attr(not(feature = "__docs_internal"), doc(hidden))]
#[cfg_attr(nightly_doc, doc(cfg(feature = "__docs_internal")))]
#[macro_export]
macro_rules! __doc {
(@meta_start_br) => {
"<br/><i style='margin-left:0em;'></i><span style='font-size:90%;word-spacing:0px'>"
};
(@meta_start_lf) => {
"\n\n<i style='margin-left:0em;margin-top:-2em;'></i><span style='font-size:90%;word-spacing:0px'>"
};
(@meta_start_nobr) => {
"<i style='margin-left:0em;margin-top:-2em;'></i><span style='font-size:90%;word-spacing:0px'>"
};
(@meta_end) => { "</span>" };
(@meta_end_hr) => { "</span><hr/>" };
(newline) => { "<br/><br style='display:block;content:\"\";margin-top:10px;' />" }; (lf) => { "\n\n" };
(br) => { "<br/><br style='display:block;content:\"\";margin-top:10px;' />" };
(br+lf) => { "<br/><br style='display:block;content:\"\";margin-top:10px;' />\n\n" };
(br+hr) => { "<br/><hr/>" };
(hr) => { "<hr/>" };
(flat: $mod:literal) => {
concat!["<a title='See the flat view of the `", $mod, "` module' href='",
$crate::doclink![custom_current_crate concat!["zall_/_", $mod], @mod], "'>◉</a>"] };
(root: $mod:literal) => {
concat!["<a title='See the hierarchical view of the `", $mod, "` module' href='",
$crate::doclink![custom_current_crate $mod, @mod], "'>▽</a>"] };
( // no submodules:
modules: $path:path; $self:ident) => {
concat!(
$crate::_doc!(@meta_start_lf),
"[", stringify!($self), "][mod@", stringify!($path), "::", stringify!($self), "]",
$crate::_doc!(@meta_end),
)
};
( // without submodules, but showing the module line.
modules: $path:path; $self:ident: _ $(,)?) => {
concat!(
$crate::_doc!(@meta_start_br),
"[", stringify!($self), "][mod@", stringify!($path), "::", stringify!($self), "]",
$crate::_doc!(@meta_end),
)
};
( // with submodules:
modules: $path:path; $self:ident: $($mod:ident),+ $(,)?) => {
concat!(
$crate::_doc!(@meta_start_br),
"[", stringify!($self), "][mod@", stringify!($path), "::", stringify!($self), "]::{",
$crate::_doc!(@modules: $path; $self: $($mod),+), "}",
$crate::_doc!(@meta_end),
)
};
(@modules: $path:path; $self:ident: $first:ident $(, $rest:ident)*) => {
concat!(
"[", stringify!($first), "](mod@",
stringify!($path), "::", stringify!($self), "::",
stringify!($first), ")",
$(
", [", stringify!($rest), "](mod@", stringify!($path), "::",
stringify!($self), "::", stringify!($rest), ")"
),*
)
};
(extends: $($mod:ident),+ $(,)?) => {
concat!(
$crate::_doc!(@meta_start_lf), "Extends: ",
"std::{", $crate::_doc!(@extends: $($mod),+), "}",
$crate::_doc!(@meta_end_hr),
)
};
(@extends: $first:ident $(, $rest:ident)*) => {
concat!(
"[", stringify!($first), "](https://doc.rust-lang.org/std/", stringify!($first), ")",
$(
", [", stringify!($rest), "](https://doc.rust-lang.org/std/", stringify!($rest), ")"
),*
)
};
(
// Shows the `Vendored` doc section and links to the info line.
//
// $crate_id: the crate's name and html id anchor on the docs.
vendor: $crate_id:literal) => {
concat!("\n\n# Vendored\n\nThis is adapted work from [", $crate_id, "](",
$crate::doclink![custom devela "_doc/vendored" @mod],
"#", $crate_id, ").\n\n"
)
};
(
// Assumes the path is in current directory. Used in `_doc/vendored`.
//
// $crate_id: the crate's name and html id anchor on the docs.
// $text_path: the path to the text file to include, explaining the modifications.
//
// MAYBE: link to crate
// MAYBE: add more information
vendor_mod: $crate_id:literal, $mod_id:ident) => {
#[doc = concat!(
"# `", $crate_id,
"` modifications\n\n[*(↑)*][crate::_doc::vendored#", $crate_id, "] ",
include_str!(concat!("./", $crate_id, ".md"))
)]
pub mod $mod_id {}
};
}
#[doc(inline)]
pub use __doc as _doc;
#[doc = crate::_tags!(internal)]
#[doc = crate::_doc_location!("yard")]
#[cfg_attr(cargo_primary_package, doc(hidden))]
#[cfg_attr(not(feature = "__docs_internal"), doc(hidden))]
#[cfg_attr(nightly_doc, doc(cfg(feature = "__docs_internal")))]
#[macro_export]
macro_rules! __doc_availability {
(feature = $feat:literal) => {
$crate::_doc_availability!{@wrap
"Available on <strong>crate feature ",
$crate::_doc_availability!{@code $feat},
"</strong> only."
}
};
( all( $(feature = $feat:literal),+ ) ) => {
$crate::_doc_availability!{@wrap
"Available on <strong>crate features ",
$crate::_doc_availability!{@join_features_and $($feat),+},
"</strong> only."
}
};
( any( $(feature = $feat:literal),+ ) ) => {
$crate::_doc_availability!{@wrap
"Available on <strong>crate features ",
$crate::_doc_availability!{@join_features_or $($feat),+},
"</strong> only."
}
};
(@wrap $($strings:tt)+) => {
concat!(
"<div class='item-info' style='margin-left:0;'>",
"<div class='stab portability'>",
$($strings)+,
"</div></div>"
)
};
(@code $string:literal) => {
concat!("<code style='background:none'>", $string, "</code>")
};
(@join_features_and $first:literal $(, $rest:literal)*) => {
concat!(
$crate::_doc_availability!{@code $first}
$(
, " and ", $crate::_doc_availability!{@code $rest}
)*
)
};
(@join_features_or $first:literal $(, $rest:literal)*) => {
concat!(
$crate::_doc_availability!{@code $first}
$(
, " or ", $crate::_doc_availability!{@code $rest}
)*
)
};
}
#[doc(inline)]
pub use __doc_availability as _doc_availability;
#[doc = crate::_tags!(internal)]
#[doc = crate::_doc_location!("yard")]
#[cfg_attr(cargo_primary_package, doc(hidden))]
#[cfg_attr(not(feature = "__docs_internal"), doc(hidden))]
#[cfg_attr(nightly_doc, doc(cfg(feature = "__docs_internal")))]
#[macro_export]
#[allow(clippy::crate_in_macro_def, reason = "to invoke __crate_name from crate of invocation")]
macro_rules! _doc_location {
($path:literal) => {
concat!(
"\n\n---\n\n",
"<sup title='home in `devela`'><b>[`📍 ", $path,
"`](", $crate::doclink![custom devela $path @mod], ")</b></sup>",
"\n\n---\n\n" )
};
(proc $path:literal) => {
concat!(
"\n\n---\n\n<sup title='defined in `", crate::__crate_name!(),
"`'>[`📍`](", $crate::doclink![custom_current_proc_crate @mod], ")</sup>",
"<sup title='location in `devela`'><b>[`", $path,
"`](", $crate::doclink![custom devela $path @mod], ")</b></sup>",
"\n\n---\n\n" )
};
(re-exported $path:literal) => {
concat!(
"\n\n<sup title='re-exported from `", crate::__crate_name!(),
"`'>[`📍`](", $crate::doclink![custom_current_crate $path, @mod], ")</sup>",
"<sup title='location in `devela`'><b>[`", $path,
"`](", $crate::doclink![custom devela $path @mod], ")</b></sup>",
)
};
}
#[doc(inline)]
pub use _doc_location;
#[doc = crate::_tags!(internal)]
#[doc = crate::_doc_location!("yard")]
#[cfg_attr(cargo_primary_package, doc(hidden))]
#[cfg_attr(not(feature = "__docs_internal"), doc(hidden))]
#[cfg_attr(nightly_doc, doc(cfg(feature = "__docs_internal")))]
#[macro_export]
macro_rules! __doc_miri_warn {
(tag) => {
concat!(
"<span class='stab portability' ",
"title='Fails to compile with Miri.'>",
"<code>⚠️</code></span>"
)
};
(body $(, url: $url:literal)?) => {
concat!(
"<div class='warning'>",
"Fails to compile with Miri.",
$( "<p><em>See <a href = '", $url, "'>", $url, "</a>.</em></p>", )?
"</div>"
)
};
}
#[doc(inline)]
pub use __doc_miri_warn as _doc_miri_warn;