aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--.run/src/bin/doc.ps12
-rw-r--r--.run/src/bin/doc.sh2
-rw-r--r--.vscode/settings.json1
-rw-r--r--.zed/settings.json1
-rw-r--r--mingling/Cargo.toml5
-rw-r--r--mingling/src/features.rs11
-rw-r--r--mingling/src/lib.md2
-rw-r--r--mingling/src/lib.rs6
8 files changed, 25 insertions, 5 deletions
diff --git a/.run/src/bin/doc.ps1 b/.run/src/bin/doc.ps1
index b589ded..0e55141 100644
--- a/.run/src/bin/doc.ps1
+++ b/.run/src/bin/doc.ps1
@@ -1,5 +1,5 @@
cargo doc `
--manifest-path mingling/Cargo.toml `
--no-deps `
- --features core,macros,builds,structural_renderer,repl,comp,parser,picker,clap,extra_macros `
+ --features docs_rs,core,macros,builds,structural_renderer,repl,comp,parser,picker,clap,extra_macros `
--open
diff --git a/.run/src/bin/doc.sh b/.run/src/bin/doc.sh
index b98941a..014ea44 100644
--- a/.run/src/bin/doc.sh
+++ b/.run/src/bin/doc.sh
@@ -3,5 +3,5 @@
cargo doc \
--manifest-path mingling/Cargo.toml \
--no-deps \
- --features core,macros,builds,structural_renderer,repl,comp,parser,picker,clap,extra_macros \
+ --features docs_rs,core,macros,builds,structural_renderer,repl,comp,parser,picker,clap,extra_macros \
--open
diff --git a/.vscode/settings.json b/.vscode/settings.json
index 1b585d1..8b49198 100644
--- a/.vscode/settings.json
+++ b/.vscode/settings.json
@@ -11,6 +11,7 @@
"structural_renderer",
"mingling_support",
"all_serde_fmt",
+ "docs_rs",
"picker",
"parser",
"comp",
diff --git a/.zed/settings.json b/.zed/settings.json
index 727f955..6469826 100644
--- a/.zed/settings.json
+++ b/.zed/settings.json
@@ -15,6 +15,7 @@
"structural_renderer",
"mingling_support",
"all_serde_fmt",
+ "docs_rs",
"picker",
"parser",
"comp",
diff --git a/mingling/Cargo.toml b/mingling/Cargo.toml
index 2509029..351384f 100644
--- a/mingling/Cargo.toml
+++ b/mingling/Cargo.toml
@@ -21,7 +21,9 @@ mingling = { path = ".", features = [
] }
[package.metadata.docs.rs]
+rustdoc-args = ["--generate-link-to-definition"]
features = [
+ "docs_rs",
"core",
"macros",
"builds",
@@ -87,6 +89,9 @@ ron_serde_fmt = ["mingling_core/ron_serde_fmt"]
extra_macros = ["mingling_macros/extra_macros"]
+# Section only shown in docs.rs
+docs_rs = []
+
[dependencies]
mingling_core = { workspace = true, optional = true }
mingling_macros = { workspace = true, optional = true }
diff --git a/mingling/src/features.rs b/mingling/src/features.rs
index cb474ae..78d6226 100644
--- a/mingling/src/features.rs
+++ b/mingling/src/features.rs
@@ -97,6 +97,17 @@ pub const MINGLING_DISPATCH_TREE: bool = false;
#[cfg(feature = "dispatch_tree")]
#[allow(unused)]
pub const MINGLING_DISPATCH_TREE: bool = true;
+/// Whether the `docs_rs` feature is enabled
+/// Current: `disabled`
+#[cfg(not(feature = "docs_rs"))]
+#[allow(unused)]
+pub const MINGLING_DOCS_RS: bool = false;
+
+/// Whether the `docs_rs` feature is enabled
+/// Current: `enabled`
+#[cfg(feature = "docs_rs")]
+#[allow(unused)]
+pub const MINGLING_DOCS_RS: bool = true;
/// Whether the `extra_macros` feature is enabled
/// Current: `disabled`
#[cfg(not(feature = "extra_macros"))]
diff --git a/mingling/src/lib.md b/mingling/src/lib.md
index 03fa61d..4d20a8b 100644
--- a/mingling/src/lib.md
+++ b/mingling/src/lib.md
@@ -76,7 +76,7 @@ Command not found: [great]
## Examples
`Mingling` provides detailed usage examples for your reference.
-See [Examples](_mingling_examples/index.html) or [Helpdoc](https://mingling-rs.github.io/mingling/docs/examples.html)
+See [Examples](EXAMPLES/index.html) or [Helpdoc](https://mingling-rs.github.io/mingling/docs/examples.html)
## About Features
diff --git a/mingling/src/lib.rs b/mingling/src/lib.rs
index b6c9a5a..8f5dc38 100644
--- a/mingling/src/lib.rs
+++ b/mingling/src/lib.rs
@@ -1,3 +1,4 @@
+#![doc(html_logo_url = "https://github.com/mingling-rs/mingling/raw/main/docs/res/icon3.png")]
#![doc = include_str!("lib.md")]
#[cfg(feature = "core")]
@@ -139,8 +140,9 @@ pub use mingling_macros::Grouped;
pub use mingling_macros::StructuralData;
/// Example projects for `Mingling`, for learning how to use `Mingling`
-#[cfg(feature = "core")]
-pub mod _mingling_examples {
+#[cfg(all(feature = "core", feature = "docs_rs"))]
+#[allow(nonstandard_style)]
+pub mod EXAMPLES {
pub use crate::example_docs::*;
}