Skip to content

Commit dc7695f

Browse files
authored
docs: use typedoc default HTML output (#59)
This transitions the node binding's API docs to use typedoc's default HTML output. Most hyperlinks to node binding's API docs' remain intact (compared to previous deployments on npm.org). I'm not overly excited about the typedoc organization of the API members, but at least they look familiar to node.js devs that are accustomed to reading typedoc-generated docs. I also found some typos in the doc comments during local review, so there are some fixes in the docs' content also. Lastly, spellings are checked in a pre-commit hook.
1 parent 3635077 commit dc7695f

18 files changed

Lines changed: 61 additions & 73 deletions

File tree

.config/nextest.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ slow-timeout = "10s"
1515
# This is all tests in tests/ folder + unit test for --extra-args.
1616
default-filter = "all()"
1717

18-
# show wich tests were skipped
18+
# show which tests were skipped
1919
status-level = "skip"
2020

2121
# show log output from each test

.github/workflows/bump-n-release.yml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,10 @@ on:
44
workflow_dispatch:
55
inputs:
66
package:
7+
description: >-
8+
The package to deploy.
9+
Binding packages are named `rf24-<lang>` for simplicity,
10+
even if the actual deployed package name is different.
711
type: choice
812
required: true
913
options:
@@ -14,6 +18,7 @@ on:
1418
# - 'rf24network-rs'
1519
# - 'rf24mesh-rs'
1620
bump-component:
21+
description: The semantic version component to increase by 1.
1722
type: choice
1823
default: 'patch'
1924
required: true

.github/workflows/bump_version.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,6 @@ class _PkgPaths(NamedTuple):
2828
"README.md",
2929
".gitattributes",
3030
".gitignore",
31-
"justfile",
3231
".pre-commit-config.yaml",
3332
"crates/README.md",
3433
"package.json",

.pre-commit-config.yaml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,3 +23,7 @@ repos:
2323
- id: ruff
2424
# Run the formatter.
2525
- id: ruff-format
26+
- repo: https://github.com/streetsidesoftware/cspell-cli
27+
rev: v9.0.1
28+
hooks:
29+
- id: cspell # Spell check changed files

bindings/node/src/fake_ble/mod.rs

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,11 +6,14 @@ pub mod services;
66
/// Returns a {@link RadioConfig} object tailored for
77
/// OTA compatibility with BLE specifications.
88
///
9-
/// !!! note "See also"
10-
/// This configuration complies with inherent
11-
/// [Limitations](https://docs.rs/rf24ble-rs/latest/rf24ble/index.html#limitations).
9+
/// > [!NOTE]
10+
/// > This configuration complies with inherent
11+
/// > [Limitations](https://docs.rs/rf24ble-rs/latest/rf24ble/index.html#limitations).
1212
#[napi]
13-
#[allow(dead_code)]
13+
#[allow(
14+
dead_code,
15+
reason = "function is exported publicly in generated binding"
16+
)]
1417
pub fn ble_config() -> RadioConfig {
1518
RadioConfig::from_inner(rf24ble::ble_config())
1619
}

bindings/node/src/fake_ble/radio.rs

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -11,23 +11,23 @@ use super::services::BlePayload;
1111

1212
/// A class to use the nRF24L01 as a Fake BLE beacon.
1313
///
14-
/// !!! note "See also"
15-
/// This implementation is subject to
16-
/// [Limitations](https://docs.rs/rf24ble-rs/latest/rf24ble/index.html#limitations).
14+
/// > [!NOTE]
15+
/// > This implementation is subject to
16+
/// > [Limitations](https://docs.rs/rf24ble-rs/latest/rf24ble/index.html#limitations).
1717
///
18-
/// Use {@link bleConfig} to properly configure the radio for
19-
/// BLE compatibility.
18+
/// Use {@link bleConfig} to properly configure the radio for
19+
/// BLE compatibility.
2020
///
21-
/// ```ts
22-
/// import { bleConfig, FakeBle, RF24 } from "@rf24/rf24";
21+
/// ```ts
22+
/// import { bleConfig, FakeBle, RF24 } from "@rf24/rf24";
2323
///
24-
/// const radio = new RF24(22, 0);
25-
/// radio.begin();
26-
/// radio.withConfig(bleConfig());
27-
/// const ble = new FakeBle(radio);
24+
/// const radio = new RF24(22, 0);
25+
/// radio.begin();
26+
/// radio.withConfig(bleConfig());
27+
/// const ble = new FakeBle(radio);
2828
///
29-
/// radio.printDetails();
30-
/// ```
29+
/// radio.printDetails();
30+
/// ```
3131
#[napi]
3232
pub struct FakeBle {
3333
radio: Reference<RF24>,
@@ -184,7 +184,7 @@ impl FakeBle {
184184
/// Use {@link RF24.available} to check if there is data in the radio's RX FIFO.
185185
///
186186
/// If the payload was somehow malformed or incomplete,
187-
/// then this function returns an undefined value.
187+
/// then this function returns an `undefined` value.
188188
#[napi]
189189
pub fn read(&mut self) -> Result<Option<BlePayload>> {
190190
let mut buf = self.radio.read(Some(32))?;

bindings/node/src/radio/config.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ impl RadioConfig {
4747
/// | 4[^2] | closed | `0xC5` |
4848
/// | 5[^2] | closed | `0xC6` |
4949
///
50-
/// [^1]: The RX address default value is the same as pipe 0 default RX address.
50+
/// [^1]: The RX address default value is the same as pipe 0 default TX address.
5151
/// [^2]: Remember, pipes 2 - 5 share the same 4 LSBytes as the address on pipe 1.
5252
#[napi(constructor)]
5353
pub fn new() -> Self {

bindings/python/src/radio/config.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ use std::borrow::Cow;
3838
/// | 4[^2] | closed | `0xC5` |
3939
/// | 5[^2] | closed | `0xC6` |
4040
///
41-
/// [^1]: The RX address default value is the same as pipe 0 default RX address.
41+
/// [^1]: The RX address default value is the same as pipe 0 default TX address.
4242
/// [^2]: Remember, pipes 2 - 5 share the same 4 LSBytes as the address on pipe 1.
4343
#[pyclass(module = "rf24_py")]
4444
#[derive(Debug, Clone, Copy)]

crates/rf24-rs/src/radio/config.rs

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,9 @@ impl EsbPipeConfig {
7272
/// This struct follows a builder pattern. Since all fields are private, users should
7373
/// start with the [`RadioConfig::default`] constructor, then mutate the object accordingly.
7474
/// ```
75-
/// let mut config = Config::default();
75+
/// use rf24::radio::RadioConfig;
76+
///
77+
/// let mut config = RadioConfig::default();
7678
/// config = config.with_channel(42);
7779
/// ```
7880
#[derive(Debug, Clone, Copy)]
@@ -123,7 +125,7 @@ impl Default for RadioConfig {
123125
/// | 5[^1] | closed | `0xC6` |
124126
///
125127
/// [^1]: Remember, pipes 2 - 5 share the same 4 LSBytes as the address on pipe 1.
126-
/// [^2]: The RX address default value is the same as pipe 0 default RX address.
128+
/// [^2]: The RX address default value is the same as pipe 0 default TX address.
127129
fn default() -> Self {
128130
Self {
129131
/*
@@ -382,6 +384,8 @@ impl RadioConfig {
382384
///
383385
/// To enable the feature for pipes 0, 1 and 4:
384386
/// ```
387+
/// use rf24::radio::RadioConfig;
388+
///
385389
/// let config = RadioConfig::default().with_auto_ack(0b010011);
386390
/// ```
387391
/// If enabling the feature for any pipe other than 0, then the pipe 0 should also have the

crates/rf24-rs/src/radio/rf24/details.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -220,9 +220,9 @@ where
220220
std::println!(" Data Fail triggered___{}", self.status.tx_df());
221221

222222
let fifo = self.get_fifo_state(true)?;
223-
std::println!("TX FIFO___________________{}", fifo);
223+
std::println!("TX FIFO___________________{fifo}");
224224
let fifo = self.get_fifo_state(false)?;
225-
std::println!("RX FIFO___________________{}", fifo);
225+
std::println!("RX FIFO___________________{fifo}");
226226

227227
self.spi_read(1, registers::FEATURE)?;
228228
let features = self.buf[1];

0 commit comments

Comments
 (0)