summaryrefslogtreecommitdiff
path: root/src/systems/helpdoc.rs
diff options
context:
space:
mode:
author魏曹先生 <1992414357@qq.com>2026-03-12 19:04:12 +0800
committer魏曹先生 <1992414357@qq.com>2026-03-12 19:04:12 +0800
commit72c57380883a1c1cc796dea6d35048ab5bed5f53 (patch)
tree936e04d2ec0f5bae54667beac6bf069208900a80 /src/systems/helpdoc.rs
parent9d812580557cdc343378816cd65678b8aa75d944 (diff)
Add helpdoc system with interactive viewer
Diffstat (limited to 'src/systems/helpdoc.rs')
-rw-r--r--src/systems/helpdoc.rs18
1 files changed, 18 insertions, 0 deletions
diff --git a/src/systems/helpdoc.rs b/src/systems/helpdoc.rs
new file mode 100644
index 0000000..4e5b2a6
--- /dev/null
+++ b/src/systems/helpdoc.rs
@@ -0,0 +1,18 @@
+pub mod helpdoc_viewer;
+
+helpdoc_system_macros::generate_helpdoc_mapping!();
+helpdoc_system_macros::generate_helpdoc_list!();
+helpdoc_system_macros::generate_helpdoc_test!();
+
+pub fn get_helpdoc<'a>(doc_name: &'a str, lang: &'a str) -> &'a str {
+ let doc = get_doc(doc_name, lang);
+ if doc.is_empty() && lang != "en" {
+ get_doc(doc_name, "en")
+ } else {
+ doc
+ }
+}
+
+pub fn get_helpdoc_list<'a>() -> Vec<&'a str> {
+ get_docs_list()
+}