Skip to content

Commit 0f5a11d

Browse files
committed
fix(docs): improve layout width and AsciiDoc table rendering
- Increase main content max-width to 1050px for better readability on large screens - Reduce main content horizontal padding to 1.5rem to prevent layout squishing - Fix table rendering by changing table-layout to auto, allowing AsciiDoc column widths to be respected naturally - Remove aggressive `overflow-wrap: anywhere` from tables to stop words from breaking mid-line - Retain native collapsible sidebar (TOC) functionality
1 parent 1238f86 commit 0f5a11d

File tree

3 files changed

+11
-13
lines changed

3 files changed

+11
-13
lines changed

docs/asciidoc/modules/openapi.adoc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -411,7 +411,7 @@ Whitespaces (including new lines) are ignored. To introduce a new line, you must
411411
|===
412412
| Tag | Main | Controller | Method | Description
413413

414-
|@version 4.0.4
414+
|@version
415415
| [x]
416416
|
417417
|

docs/js/styles/theme.css

Lines changed: 5 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@
2828

2929
/* Layout */
3030
--sidebar-width: 300px;
31-
--content-max-width: 900px;
31+
--content-max-width: 1050px; /* INCREASED from 900px */
3232
--border-radius: 6px;
3333

3434
/* Typography Stacks */
@@ -129,7 +129,7 @@ li { margin-bottom: 0.35rem; }
129129
#content, #footer {
130130
max-width: var(--content-max-width);
131131
margin: 0 auto;
132-
padding: 2.5rem 3rem;
132+
padding: 2.5rem 1.5rem; /* REDUCED horizontal padding */
133133
}
134134
}
135135

@@ -558,13 +558,13 @@ pre.highlightjs.badges-loaded code { opacity: 1; }
558558
========================================================================== */
559559
table.tableblock {
560560
width: 100%;
561-
table-layout: fixed !important;
561+
table-layout: auto; /* FIXED: Let the browser respect Asciidoc col widths */
562562
border-collapse: separate;
563563
border-spacing: 0;
564564
margin: 1.5rem 0;
565565
border: 1px solid var(--border-color);
566566
border-radius: var(--border-radius);
567-
overflow: hidden;
567+
overflow-x: auto;
568568
}
569569

570570
table.tableblock td, table.tableblock th {
@@ -575,20 +575,14 @@ table.tableblock td, table.tableblock th {
575575
text-align: left;
576576
vertical-align: top;
577577
word-wrap: break-word;
578-
overflow-wrap: anywhere;
578+
overflow-wrap: break-word; /* FIXED: Removed 'anywhere' word chopping */
579579
}
580580

581581
table.tableblock thead th {
582582
background-color: var(--bg-surface);
583583
font-weight: 600;
584584
border-bottom: 2px solid var(--border-color);
585585
color: var(--heading-color);
586-
white-space: nowrap;
587-
}
588-
589-
table.tableblock:not(:has(colgroup col[style*="width"])) td:first-child {
590-
white-space: nowrap;
591-
width: 1%;
592586
}
593587

594588
table.tableblock td:first-child { font-weight: 500; color: var(--heading-color); }
@@ -800,4 +794,3 @@ html[data-theme="dark"] .DocSearch-Button-Keys kbd {
800794
color: #e2e8f0 !important;
801795
background: #334155 !important;
802796
}
803-

docs/src/main/java/io/jooby/adoc/DocApp.java

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,9 @@
77

88
import static org.slf4j.helpers.NOPLogger.NOP_LOGGER;
99

10+
import java.nio.file.Files;
1011
import java.nio.file.Path;
12+
import java.nio.file.StandardCopyOption;
1113
import java.util.Arrays;
1214
import java.util.List;
1315

@@ -51,6 +53,7 @@ public static void main(String[] args) throws Exception {
5153
runApp(args, server, DocApp::new);
5254

5355
Path outdir = basedir.resolve("asciidoc").resolve("site");
56+
Path themeCssDir = basedir.resolve("js").resolve("styles");
5457

5558
DirectoryWatcher watcher =
5659
DirectoryWatcher.builder()
@@ -69,6 +72,8 @@ public static void main(String[] args) throws Exception {
6972
} catch (Exception x) {
7073
log.error("Site build resulted in exception", x);
7174
}
75+
} else if (file.toString().endsWith("theme.css")) {
76+
Files.copy(file, outdir.resolve("js").resolve("styles").resolve("theme.css"), StandardCopyOption.REPLACE_EXISTING);
7277
}
7378
}
7479
})

0 commit comments

Comments
 (0)