From 128f975feb1765153aed2e84a9ab57e19063c7cf Mon Sep 17 00:00:00 2001 From: Anvesh <127006149+Xploit-Ghost@users.noreply.github.com> Date: Mon, 1 Jun 2026 16:14:03 +0530 Subject: [PATCH 1/3] docs(buffer): add missing # Example blocks to Layout API Signed-off-by: Anvesh <127006149+Xploit-Ghost@users.noreply.github.com> --- crates/mohu-buffer/src/layout.rs | 29 +++++++++++++++++++++++++++++ 1 file changed, 29 insertions(+) diff --git a/crates/mohu-buffer/src/layout.rs b/crates/mohu-buffer/src/layout.rs index b5d3bd9..196d665 100644 --- a/crates/mohu-buffer/src/layout.rs +++ b/crates/mohu-buffer/src/layout.rs @@ -122,6 +122,19 @@ fn e_reversed_empty(start: usize, stop: usize) -> bool { /// array view. /// /// Does not own memory — it is always paired with a backing `Buffer`. +/// +/// # Example +/// +/// ``` +/// use mohu_buffer::layout::Layout; +/// +/// let shape = [2, 3]; +/// let itemsize = 4; // e.g., f32 +/// let layout = Layout::new_c(&shape, itemsize).unwrap(); +/// +/// assert_eq!(layout.shape(), &[2, 3]); +/// assert_eq!(layout.strides(), &[12, 4]); // C-contiguous strides +/// ``` #[derive(Clone, PartialEq, Eq)] pub struct Layout { shape: ShapeVec, @@ -136,12 +149,28 @@ impl Layout { // ─── Constructors ───────────────────────────────────────────────────────── /// Creates a C-contiguous (row-major) layout for `shape`. + /// + /// # Example + /// + /// ``` + /// use mohu_buffer::layout::Layout; + /// let layout = Layout::new_c(&[2, 3], 4).unwrap(); + /// assert_eq!(layout.strides(), &[12, 4]); + /// ``` pub fn new_c(shape: &[usize], itemsize: usize) -> MohuResult { let strides = c_strides(shape, itemsize); Self::new_custom(shape, &strides, 0, itemsize) } /// Creates a Fortran-contiguous (column-major) layout for `shape`. + /// + /// # Example + /// + /// ``` + /// use mohu_buffer::layout::Layout; + /// let layout = Layout::new_f(&[2, 3], 4).unwrap(); + /// assert_eq!(layout.strides(), &[4, 8]); + /// ``` pub fn new_f(shape: &[usize], itemsize: usize) -> MohuResult { let strides = f_strides(shape, itemsize); Self::new_custom(shape, &strides, 0, itemsize) From ab7c6673fe3b264d7acbffb0a16a557cfcb44112 Mon Sep 17 00:00:00 2001 From: Anvesh <127006149+Xploit-Ghost@users.noreply.github.com> Date: Mon, 1 Jun 2026 16:28:31 +0530 Subject: [PATCH 2/3] docs(ui): enhance mdbook docs aesthetics with custom css Signed-off-by: Anvesh <127006149+Xploit-Ghost@users.noreply.github.com> --- docs/book.toml | 1 + docs/theme/custom.css | 37 +++++++++++++++++++++++++++++++++++++ 2 files changed, 38 insertions(+) create mode 100644 docs/theme/custom.css diff --git a/docs/book.toml b/docs/book.toml index 98b4f95..26dab98 100644 --- a/docs/book.toml +++ b/docs/book.toml @@ -9,6 +9,7 @@ src = "src" site-url = "/mohu/" git-repository-url = "https://github.com/mohu-org/mohu" edit-url-template = "https://github.com/mohu-org/mohu/edit/main/docs/{path}" +additional-css = ["theme/custom.css"] [output.html.fold] enable = true diff --git a/docs/theme/custom.css b/docs/theme/custom.css new file mode 100644 index 0000000..f5a9924 --- /dev/null +++ b/docs/theme/custom.css @@ -0,0 +1,37 @@ +/* docs/theme/custom.css */ +:root { + --fonts: 'Inter', 'Segoe UI', Roboto, Helvetica, Arial, sans-serif; +} + +body { + font-family: var(--fonts); + letter-spacing: -0.01em; +} + +/* Improve readability of main content */ +.content main { + max-width: 850px; + line-height: 1.6; +} + +h1, h2, h3, h4, h5, h6 { + font-weight: 700; + letter-spacing: -0.02em; +} + +/* Make code blocks look slightly cleaner */ +pre { + border-radius: 6px; +} + +/* Sticky transparent menu on mobile */ +@media (max-width: 1080px) { + .menu-bar { + position: sticky; + top: 0; + z-index: 50; + backdrop-filter: blur(8px); + -webkit-backdrop-filter: blur(8px); + border-bottom: 1px solid var(--sidebar-border); + } +} From 91b16f22f8f9db1036a4f9145bf4d87f7588d464 Mon Sep 17 00:00:00 2001 From: Anvesh Anand Pol <127006149+Xploit-Ghost@users.noreply.github.com> Date: Mon, 1 Jun 2026 19:50:05 +0530 Subject: [PATCH 3/3] Update docs/theme/custom.css Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com> --- docs/theme/custom.css | 3 +++ 1 file changed, 3 insertions(+) diff --git a/docs/theme/custom.css b/docs/theme/custom.css index f5a9924..1146dc7 100644 --- a/docs/theme/custom.css +++ b/docs/theme/custom.css @@ -1,3 +1,6 @@ +/* docs/theme/custom.css */ +`@import` url('https://fonts.googleapis.com/css2?family=Inter:wght@400;700&display=swap'); + /* docs/theme/custom.css */ :root { --fonts: 'Inter', 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;