From f78d54a83434d162dddb7f7d7651781c750fbb46 Mon Sep 17 00:00:00 2001 From: bunnie Date: Mon, 17 Feb 2025 22:53:56 +0800 Subject: [PATCH 1/3] add configuration for doc build --- libs/blitstr2/src/platform/doc.rs | 6 ++++++ libs/blitstr2/src/platform/mod.rs | 19 +++++++++++++++++++ 2 files changed, 25 insertions(+) create mode 100644 libs/blitstr2/src/platform/doc.rs diff --git a/libs/blitstr2/src/platform/doc.rs b/libs/blitstr2/src/platform/doc.rs new file mode 100644 index 000000000..7a019cd0f --- /dev/null +++ b/libs/blitstr2/src/platform/doc.rs @@ -0,0 +1,6 @@ +// Dummy values to allow cargo doc to build +pub const LINES: isize = 536; +pub const WIDTH: isize = 336; +pub const WORDS_PER_LINE: usize = 11; +pub type FrBuf = [u32; WORDS_PER_LINE * LINES as usize]; +pub const FB_SIZE: usize = WORDS_PER_LINE * LINES as usize; // 44 bytes by 536 lines diff --git a/libs/blitstr2/src/platform/mod.rs b/libs/blitstr2/src/platform/mod.rs index 18f9c17c6..c1010b569 100644 --- a/libs/blitstr2/src/platform/mod.rs +++ b/libs/blitstr2/src/platform/mod.rs @@ -9,3 +9,22 @@ pub use baosec::*; mod precursor; #[cfg(any(feature = "hosted", feature = "renode", feature = "precursor"))] pub use precursor::*; + +// Dummy configuration to allow cargo doc to run - this has no board specified +#[cfg(any( + all( + not(any(feature = "board-baosec", feature = "hosted-baosec")), + not(any(feature = "hosted", feature = "renode", feature = "precursor")) + ), + doc +))] +mod doc; + +#[cfg(any( + all( + not(any(feature = "board-baosec", feature = "hosted-baosec")), + not(any(feature = "hosted", feature = "renode", feature = "precursor")) + ), + doc +))] +pub use doc::*; From 13590c302af2ccfe48fe31ff995b99ef9c197a35 Mon Sep 17 00:00:00 2001 From: bunnie Date: Mon, 17 Feb 2025 22:54:27 +0800 Subject: [PATCH 2/3] fix warning in doc comment --- services/graphics-server/src/wordwrap.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/services/graphics-server/src/wordwrap.rs b/services/graphics-server/src/wordwrap.rs index 88bb8f404..15f532824 100644 --- a/services/graphics-server/src/wordwrap.rs +++ b/services/graphics-server/src/wordwrap.rs @@ -44,7 +44,7 @@ pub struct TypesetWord { /// overall height for the word pub height: i16, /// set if this `word` is not drawable, e.g. a newline placeholder. - /// *however* the Vec should still be checked for an insertion point, so that + /// *however* the `Vec` should still be checked for an insertion point, so that /// successive newlines properly get their insertion point drawn pub non_drawable: bool, /// the position in the originating abstract string of the first character in the word @@ -294,7 +294,7 @@ impl Typesetter { /// the caller must reset the cursor to the desired resume position, otherwise it will pick /// up again at the overflow position. /// - /// The final Vec:: is snapped to the top left of the Renderable region. This + /// The final `Vec::` is snapped to the top left of the Renderable region. This /// needs to be transformed into the final screen coordinate space before blitting. pub fn typeset(&mut self, strat: OverflowStrategy) -> ComposedType { // a composition only lasts as long as the lifetime of this call, and is passed back to the caller From 23c96f2d96b24ef8269b598f8636e21c60319440 Mon Sep 17 00:00:00 2001 From: bunnie Date: Mon, 17 Feb 2025 22:55:29 +0800 Subject: [PATCH 3/3] add a default graphics library for cargo doc runs 'gam' in the case of modals. --- services/modals/Cargo.toml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/services/modals/Cargo.toml b/services/modals/Cargo.toml index 92f4a6e94..52ccb19fb 100644 --- a/services/modals/Cargo.toml +++ b/services/modals/Cargo.toml @@ -43,4 +43,5 @@ board-baosec = ["ux-api/board-baosec"] tts = [] ditherpunk = [] hazardous-debug = [] -default = ["trng"] +# "gam" is required for cargo doc to run successfully +default = ["trng", "gam"]