Skip to content

Commit 1a9d75b

Browse files
committed
Make docs look better
We also enable bluetooth-le for the docs. In addition, the doc_cfg attribute marks the required feature for each module/struct/method/...
1 parent 79a6514 commit 1a9d75b

File tree

4 files changed

+11
-4
lines changed

4 files changed

+11
-4
lines changed

Cargo.toml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ name = "meshtastic"
33
description = "A Rust library for communicating with and configuring Meshtastic devices."
44
homepage = "https://meshtastic.org/"
55
repository = "https://github.com/meshtastic/rust"
6+
documentation = "https://docs.rs/heapless"
67
keywords = ["meshtastic", "mesh", "lora", "tcp", "serial"]
78
categories = ["embedded", "config", "encoding"]
89
authors = ["Adam McQuilkin"]
@@ -83,3 +84,7 @@ bluez-async = { version = "=0.8.0", optional = true }
8384
[dev-dependencies]
8485
fern = { version = "0.7.1", features = ["colored"] }
8586
humantime = "2.1.0"
87+
88+
[package.metadata.docs.rs]
89+
features = ["bluetooth-le"]
90+
rustdoc-args = ["--cfg", "docsrs"]

src/connections/handlers.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ use crate::connections::stream_buffer::StreamBuffer;
1515
use super::wrappers::encoded_data::IncomingStreamData;
1616

1717
/// Interval for sending heartbeat packets to the radio (in seconds).
18-
/// Needs to be less than this: https://github.com/meshtastic/firmware/blob/eb372c190ec82366998c867acc609a418130d842/src/SerialConsole.cpp#L8
18+
/// Needs to be less than this: <https://github.com/meshtastic/firmware/blob/eb372c190ec82366998c867acc609a418130d842/src/SerialConsole.cpp#L8>
1919
pub const CLIENT_HEARTBEAT_INTERVAL: u64 = 5 * 60; // 5 minutes
2020

2121
pub fn spawn_read_handler<R>(

src/generated/meshtastic.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7862,7 +7862,7 @@ pub struct GeoChat {
78627862
}
78637863
///
78647864
/// ATAK Group
7865-
/// <__group role='Team Member' name='Cyan'/>
7865+
/// `<__group role='Team Member' name='Cyan'/>`
78667866
#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
78677867
#[cfg_attr(feature = "serde", serde(rename_all = "camelCase"))]
78687868
#[cfg_attr(feature = "ts-gen", derive(specta::Type))]
@@ -7880,7 +7880,7 @@ pub struct Group {
78807880
}
78817881
///
78827882
/// ATAK EUD Status
7883-
/// <status battery='100' />
7883+
/// `<status battery='100' />`
78847884
#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
78857885
#[cfg_attr(feature = "serde", serde(rename_all = "camelCase"))]
78867886
#[cfg_attr(feature = "ts-gen", derive(specta::Type))]
@@ -7893,7 +7893,7 @@ pub struct Status {
78937893
}
78947894
///
78957895
/// ATAK Contact
7896-
/// <contact endpoint='0.0.0.0:4242:tcp' phone='+12345678' callsign='FALKE'/>
7896+
/// `<contact endpoint='0.0.0.0:4242:tcp' phone='+12345678' callsign='FALKE'/>`
78977897
#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
78987898
#[cfg_attr(feature = "serde", serde(rename_all = "camelCase"))]
78997899
#[cfg_attr(feature = "ts-gen", derive(specta::Type))]

src/lib.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
#![cfg_attr(docsrs, feature(doc_cfg))]
2+
13
//! A Rust library for communicating with and configuring Meshtastic devices.
24
#[cfg(feature = "tokio")]
35
pub(crate) mod connections;

0 commit comments

Comments
 (0)