macro_rules! topics {
(
$(use HelpTopic $topic:ident for $desc:literal;)+
) => {
pub mod topics {
$(
#[doc = concat!(
"# ",
$desc,
"\n\nTo access this help from Lua, call `help '",
stringify!($topic),
"'`.\n\n```txt\n",
include_str!(
concat!("help_system/topics/", stringify!($topic), ".txt")
))]
pub mod $topic {
use crate::userscript_api::help_system::HelpTopic;
#[doc = "Userscript API help topic definition."]
pub struct Topic;
impl HelpTopic for Topic {
fn name(&self) -> &'static str {
stringify!($topic)
}
fn short_description(&self) -> &'static str {
$desc
}
fn content(&self) -> &'static str {
include_str!(
concat!("help_system/topics/", stringify!($topic), ".txt")
)
}
}
}
)+
}
};
}
pub(crate) use topics;