Skip to content

Commit 1aec910

Browse files
committed
docs: enhance documentation with visual improvements and better narrative
Major improvements to make documentation more engaging and easier to use: **Visual Enhancements:** - Add mdbook-admonish for beautiful callout boxes (info, tip, warning, success) - Create custom CSS theme with Redis brand colors - Improve typography, code blocks, tables, and overall styling - Add terminal-style bash prompts for commands - Better mobile responsiveness **Content Improvements:** - Rewrite introduction with compelling "FIRST CLI tool" narrative - Emphasize the problem (no tools existed before redisctl) - Show before/after comparison (50 lines of bash vs one command) - Complete rewrite of quickstart guide with: - Separate Cloud and Enterprise paths - Step-by-step instructions with callouts - Troubleshooting sections - Expected output examples - Better navigation and visual hierarchy **Technical Changes:** - Install mdbook-admonish preprocessor - Add custom.css theme file with Redis branding - Configure additional-css in book.toml - Maintain accessibility and print styles These changes make the docs more presentation-ready and easier for new users to navigate. Related to #412 (presentation prep)
1 parent b4faa4e commit 1aec910

File tree

5 files changed

+1187
-99
lines changed

5 files changed

+1187
-99
lines changed

docs/book.toml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,11 +10,16 @@ preferred-dark-theme = "ayu"
1010
git-repository-url = "https://github.com/joshrotenberg/redisctl"
1111
git-repository-icon = "fa-github"
1212
edit-url-template = "https://github.com/joshrotenberg/redisctl/edit/main/docs/{path}"
13+
additional-css = ["theme/custom.css", "./mdbook-admonish.css"]
1314

1415
[output.html.fold]
1516
enable = true
1617
level = 1
1718

19+
[preprocessor.admonish]
20+
command = "mdbook-admonish"
21+
assets_version = "3.0.2" # do not edit: managed by `mdbook-admonish install`
22+
1823
# Temporarily disabled for reorganization
1924
# [preprocessor.lint]
2025
# command = "mdbook-lint"

docs/mdbook-admonish.css

Lines changed: 348 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,348 @@
1+
@charset "UTF-8";
2+
:is(.admonition) {
3+
display: flow-root;
4+
margin: 1.5625em 0;
5+
padding: 0 1.2rem;
6+
color: var(--fg);
7+
page-break-inside: avoid;
8+
background-color: var(--bg);
9+
border: 0 solid black;
10+
border-inline-start-width: 0.4rem;
11+
border-radius: 0.2rem;
12+
box-shadow: 0 0.2rem 1rem rgba(0, 0, 0, 0.05), 0 0 0.1rem rgba(0, 0, 0, 0.1);
13+
}
14+
@media print {
15+
:is(.admonition) {
16+
box-shadow: none;
17+
}
18+
}
19+
:is(.admonition) > * {
20+
box-sizing: border-box;
21+
}
22+
:is(.admonition) :is(.admonition) {
23+
margin-top: 1em;
24+
margin-bottom: 1em;
25+
}
26+
:is(.admonition) > .tabbed-set:only-child {
27+
margin-top: 0;
28+
}
29+
html :is(.admonition) > :last-child {
30+
margin-bottom: 1.2rem;
31+
}
32+
33+
a.admonition-anchor-link {
34+
display: none;
35+
position: absolute;
36+
left: -1.2rem;
37+
padding-right: 1rem;
38+
}
39+
a.admonition-anchor-link:link, a.admonition-anchor-link:visited {
40+
color: var(--fg);
41+
}
42+
a.admonition-anchor-link:link:hover, a.admonition-anchor-link:visited:hover {
43+
text-decoration: none;
44+
}
45+
a.admonition-anchor-link::before {
46+
content: "§";
47+
}
48+
49+
:is(.admonition-title, summary.admonition-title) {
50+
position: relative;
51+
min-height: 4rem;
52+
margin-block: 0;
53+
margin-inline: -1.6rem -1.2rem;
54+
padding-block: 0.8rem;
55+
padding-inline: 4.4rem 1.2rem;
56+
font-weight: 700;
57+
background-color: rgba(68, 138, 255, 0.1);
58+
print-color-adjust: exact;
59+
-webkit-print-color-adjust: exact;
60+
display: flex;
61+
}
62+
:is(.admonition-title, summary.admonition-title) p {
63+
margin: 0;
64+
}
65+
html :is(.admonition-title, summary.admonition-title):last-child {
66+
margin-bottom: 0;
67+
}
68+
:is(.admonition-title, summary.admonition-title)::before {
69+
position: absolute;
70+
top: 0.625em;
71+
inset-inline-start: 1.6rem;
72+
width: 2rem;
73+
height: 2rem;
74+
background-color: #448aff;
75+
print-color-adjust: exact;
76+
-webkit-print-color-adjust: exact;
77+
mask-image: url('data:image/svg+xml;charset=utf-8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"></svg>');
78+
-webkit-mask-image: url('data:image/svg+xml;charset=utf-8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"></svg>');
79+
mask-repeat: no-repeat;
80+
-webkit-mask-repeat: no-repeat;
81+
mask-size: contain;
82+
-webkit-mask-size: contain;
83+
content: "";
84+
}
85+
:is(.admonition-title, summary.admonition-title):hover a.admonition-anchor-link {
86+
display: initial;
87+
}
88+
89+
details.admonition > summary.admonition-title::after {
90+
position: absolute;
91+
top: 0.625em;
92+
inset-inline-end: 1.6rem;
93+
height: 2rem;
94+
width: 2rem;
95+
background-color: currentcolor;
96+
mask-image: var(--md-details-icon);
97+
-webkit-mask-image: var(--md-details-icon);
98+
mask-repeat: no-repeat;
99+
-webkit-mask-repeat: no-repeat;
100+
mask-size: contain;
101+
-webkit-mask-size: contain;
102+
content: "";
103+
transform: rotate(0deg);
104+
transition: transform 0.25s;
105+
}
106+
details[open].admonition > summary.admonition-title::after {
107+
transform: rotate(90deg);
108+
}
109+
110+
:root {
111+
--md-details-icon: url("data:image/svg+xml;charset=utf-8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'><path d='M8.59 16.58 13.17 12 8.59 7.41 10 6l6 6-6 6-1.41-1.42Z'/></svg>");
112+
}
113+
114+
:root {
115+
--md-admonition-icon--admonish-note: url("data:image/svg+xml;charset=utf-8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'><path d='M20.71 7.04c.39-.39.39-1.04 0-1.41l-2.34-2.34c-.37-.39-1.02-.39-1.41 0l-1.84 1.83 3.75 3.75M3 17.25V21h3.75L17.81 9.93l-3.75-3.75L3 17.25z'/></svg>");
116+
--md-admonition-icon--admonish-abstract: url("data:image/svg+xml;charset=utf-8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'><path d='M17 9H7V7h10m0 6H7v-2h10m-3 6H7v-2h7M12 3a1 1 0 0 1 1 1 1 1 0 0 1-1 1 1 1 0 0 1-1-1 1 1 0 0 1 1-1m7 0h-4.18C14.4 1.84 13.3 1 12 1c-1.3 0-2.4.84-2.82 2H5a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h14a2 2 0 0 0 2-2V5a2 2 0 0 0-2-2z'/></svg>");
117+
--md-admonition-icon--admonish-info: url("data:image/svg+xml;charset=utf-8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'><path d='M13 9h-2V7h2m0 10h-2v-6h2m-1-9A10 10 0 0 0 2 12a10 10 0 0 0 10 10 10 10 0 0 0 10-10A10 10 0 0 0 12 2z'/></svg>");
118+
--md-admonition-icon--admonish-tip: url("data:image/svg+xml;charset=utf-8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'><path d='M17.66 11.2c-.23-.3-.51-.56-.77-.82-.67-.6-1.43-1.03-2.07-1.66C13.33 7.26 13 4.85 13.95 3c-.95.23-1.78.75-2.49 1.32-2.59 2.08-3.61 5.75-2.39 8.9.04.1.08.2.08.33 0 .22-.15.42-.35.5-.23.1-.47.04-.66-.12a.58.58 0 0 1-.14-.17c-1.13-1.43-1.31-3.48-.55-5.12C5.78 10 4.87 12.3 5 14.47c.06.5.12 1 .29 1.5.14.6.41 1.2.71 1.73 1.08 1.73 2.95 2.97 4.96 3.22 2.14.27 4.43-.12 6.07-1.6 1.83-1.66 2.47-4.32 1.53-6.6l-.13-.26c-.21-.46-.77-1.26-.77-1.26m-3.16 6.3c-.28.24-.74.5-1.1.6-1.12.4-2.24-.16-2.9-.82 1.19-.28 1.9-1.16 2.11-2.05.17-.8-.15-1.46-.28-2.23-.12-.74-.1-1.37.17-2.06.19.38.39.76.63 1.06.77 1 1.98 1.44 2.24 2.8.04.14.06.28.06.43.03.82-.33 1.72-.93 2.27z'/></svg>");
119+
--md-admonition-icon--admonish-success: url("data:image/svg+xml;charset=utf-8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'><path d='m9 20.42-6.21-6.21 2.83-2.83L9 14.77l9.88-9.89 2.83 2.83L9 20.42z'/></svg>");
120+
--md-admonition-icon--admonish-question: url("data:image/svg+xml;charset=utf-8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'><path d='m15.07 11.25-.9.92C13.45 12.89 13 13.5 13 15h-2v-.5c0-1.11.45-2.11 1.17-2.83l1.24-1.26c.37-.36.59-.86.59-1.41a2 2 0 0 0-2-2 2 2 0 0 0-2 2H8a4 4 0 0 1 4-4 4 4 0 0 1 4 4 3.2 3.2 0 0 1-.93 2.25M13 19h-2v-2h2M12 2A10 10 0 0 0 2 12a10 10 0 0 0 10 10 10 10 0 0 0 10-10c0-5.53-4.5-10-10-10z'/></svg>");
121+
--md-admonition-icon--admonish-warning: url("data:image/svg+xml;charset=utf-8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'><path d='M13 14h-2V9h2m0 9h-2v-2h2M1 21h22L12 2 1 21z'/></svg>");
122+
--md-admonition-icon--admonish-failure: url("data:image/svg+xml;charset=utf-8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'><path d='M20 6.91 17.09 4 12 9.09 6.91 4 4 6.91 9.09 12 4 17.09 6.91 20 12 14.91 17.09 20 20 17.09 14.91 12 20 6.91z'/></svg>");
123+
--md-admonition-icon--admonish-danger: url("data:image/svg+xml;charset=utf-8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'><path d='M11 15H6l7-14v8h5l-7 14v-8z'/></svg>");
124+
--md-admonition-icon--admonish-bug: url("data:image/svg+xml;charset=utf-8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'><path d='M14 12h-4v-2h4m0 6h-4v-2h4m6-6h-2.81a5.985 5.985 0 0 0-1.82-1.96L17 4.41 15.59 3l-2.17 2.17a6.002 6.002 0 0 0-2.83 0L8.41 3 7 4.41l1.62 1.63C7.88 6.55 7.26 7.22 6.81 8H4v2h2.09c-.05.33-.09.66-.09 1v1H4v2h2v1c0 .34.04.67.09 1H4v2h2.81c1.04 1.79 2.97 3 5.19 3s4.15-1.21 5.19-3H20v-2h-2.09c.05-.33.09-.66.09-1v-1h2v-2h-2v-1c0-.34-.04-.67-.09-1H20V8z'/></svg>");
125+
--md-admonition-icon--admonish-example: url("data:image/svg+xml;charset=utf-8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'><path d='M7 13v-2h14v2H7m0 6v-2h14v2H7M7 7V5h14v2H7M3 8V5H2V4h2v4H3m-1 9v-1h3v4H2v-1h2v-.5H3v-1h1V17H2m2.25-7a.75.75 0 0 1 .75.75c0 .2-.08.39-.21.52L3.12 13H5v1H2v-.92L4 11H2v-1h2.25z'/></svg>");
126+
--md-admonition-icon--admonish-quote: url("data:image/svg+xml;charset=utf-8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'><path d='M14 17h3l2-4V7h-6v6h3M6 17h3l2-4V7H5v6h3l-2 4z'/></svg>");
127+
}
128+
129+
:is(.admonition):is(.admonish-note) {
130+
border-color: #448aff;
131+
}
132+
133+
:is(.admonish-note) > :is(.admonition-title, summary.admonition-title) {
134+
background-color: rgba(68, 138, 255, 0.1);
135+
}
136+
:is(.admonish-note) > :is(.admonition-title, summary.admonition-title)::before {
137+
background-color: #448aff;
138+
mask-image: var(--md-admonition-icon--admonish-note);
139+
-webkit-mask-image: var(--md-admonition-icon--admonish-note);
140+
mask-repeat: no-repeat;
141+
-webkit-mask-repeat: no-repeat;
142+
mask-size: contain;
143+
-webkit-mask-repeat: no-repeat;
144+
}
145+
146+
:is(.admonition):is(.admonish-abstract, .admonish-summary, .admonish-tldr) {
147+
border-color: #00b0ff;
148+
}
149+
150+
:is(.admonish-abstract, .admonish-summary, .admonish-tldr) > :is(.admonition-title, summary.admonition-title) {
151+
background-color: rgba(0, 176, 255, 0.1);
152+
}
153+
:is(.admonish-abstract, .admonish-summary, .admonish-tldr) > :is(.admonition-title, summary.admonition-title)::before {
154+
background-color: #00b0ff;
155+
mask-image: var(--md-admonition-icon--admonish-abstract);
156+
-webkit-mask-image: var(--md-admonition-icon--admonish-abstract);
157+
mask-repeat: no-repeat;
158+
-webkit-mask-repeat: no-repeat;
159+
mask-size: contain;
160+
-webkit-mask-repeat: no-repeat;
161+
}
162+
163+
:is(.admonition):is(.admonish-info, .admonish-todo) {
164+
border-color: #00b8d4;
165+
}
166+
167+
:is(.admonish-info, .admonish-todo) > :is(.admonition-title, summary.admonition-title) {
168+
background-color: rgba(0, 184, 212, 0.1);
169+
}
170+
:is(.admonish-info, .admonish-todo) > :is(.admonition-title, summary.admonition-title)::before {
171+
background-color: #00b8d4;
172+
mask-image: var(--md-admonition-icon--admonish-info);
173+
-webkit-mask-image: var(--md-admonition-icon--admonish-info);
174+
mask-repeat: no-repeat;
175+
-webkit-mask-repeat: no-repeat;
176+
mask-size: contain;
177+
-webkit-mask-repeat: no-repeat;
178+
}
179+
180+
:is(.admonition):is(.admonish-tip, .admonish-hint, .admonish-important) {
181+
border-color: #00bfa5;
182+
}
183+
184+
:is(.admonish-tip, .admonish-hint, .admonish-important) > :is(.admonition-title, summary.admonition-title) {
185+
background-color: rgba(0, 191, 165, 0.1);
186+
}
187+
:is(.admonish-tip, .admonish-hint, .admonish-important) > :is(.admonition-title, summary.admonition-title)::before {
188+
background-color: #00bfa5;
189+
mask-image: var(--md-admonition-icon--admonish-tip);
190+
-webkit-mask-image: var(--md-admonition-icon--admonish-tip);
191+
mask-repeat: no-repeat;
192+
-webkit-mask-repeat: no-repeat;
193+
mask-size: contain;
194+
-webkit-mask-repeat: no-repeat;
195+
}
196+
197+
:is(.admonition):is(.admonish-success, .admonish-check, .admonish-done) {
198+
border-color: #00c853;
199+
}
200+
201+
:is(.admonish-success, .admonish-check, .admonish-done) > :is(.admonition-title, summary.admonition-title) {
202+
background-color: rgba(0, 200, 83, 0.1);
203+
}
204+
:is(.admonish-success, .admonish-check, .admonish-done) > :is(.admonition-title, summary.admonition-title)::before {
205+
background-color: #00c853;
206+
mask-image: var(--md-admonition-icon--admonish-success);
207+
-webkit-mask-image: var(--md-admonition-icon--admonish-success);
208+
mask-repeat: no-repeat;
209+
-webkit-mask-repeat: no-repeat;
210+
mask-size: contain;
211+
-webkit-mask-repeat: no-repeat;
212+
}
213+
214+
:is(.admonition):is(.admonish-question, .admonish-help, .admonish-faq) {
215+
border-color: #64dd17;
216+
}
217+
218+
:is(.admonish-question, .admonish-help, .admonish-faq) > :is(.admonition-title, summary.admonition-title) {
219+
background-color: rgba(100, 221, 23, 0.1);
220+
}
221+
:is(.admonish-question, .admonish-help, .admonish-faq) > :is(.admonition-title, summary.admonition-title)::before {
222+
background-color: #64dd17;
223+
mask-image: var(--md-admonition-icon--admonish-question);
224+
-webkit-mask-image: var(--md-admonition-icon--admonish-question);
225+
mask-repeat: no-repeat;
226+
-webkit-mask-repeat: no-repeat;
227+
mask-size: contain;
228+
-webkit-mask-repeat: no-repeat;
229+
}
230+
231+
:is(.admonition):is(.admonish-warning, .admonish-caution, .admonish-attention) {
232+
border-color: #ff9100;
233+
}
234+
235+
:is(.admonish-warning, .admonish-caution, .admonish-attention) > :is(.admonition-title, summary.admonition-title) {
236+
background-color: rgba(255, 145, 0, 0.1);
237+
}
238+
:is(.admonish-warning, .admonish-caution, .admonish-attention) > :is(.admonition-title, summary.admonition-title)::before {
239+
background-color: #ff9100;
240+
mask-image: var(--md-admonition-icon--admonish-warning);
241+
-webkit-mask-image: var(--md-admonition-icon--admonish-warning);
242+
mask-repeat: no-repeat;
243+
-webkit-mask-repeat: no-repeat;
244+
mask-size: contain;
245+
-webkit-mask-repeat: no-repeat;
246+
}
247+
248+
:is(.admonition):is(.admonish-failure, .admonish-fail, .admonish-missing) {
249+
border-color: #ff5252;
250+
}
251+
252+
:is(.admonish-failure, .admonish-fail, .admonish-missing) > :is(.admonition-title, summary.admonition-title) {
253+
background-color: rgba(255, 82, 82, 0.1);
254+
}
255+
:is(.admonish-failure, .admonish-fail, .admonish-missing) > :is(.admonition-title, summary.admonition-title)::before {
256+
background-color: #ff5252;
257+
mask-image: var(--md-admonition-icon--admonish-failure);
258+
-webkit-mask-image: var(--md-admonition-icon--admonish-failure);
259+
mask-repeat: no-repeat;
260+
-webkit-mask-repeat: no-repeat;
261+
mask-size: contain;
262+
-webkit-mask-repeat: no-repeat;
263+
}
264+
265+
:is(.admonition):is(.admonish-danger, .admonish-error) {
266+
border-color: #ff1744;
267+
}
268+
269+
:is(.admonish-danger, .admonish-error) > :is(.admonition-title, summary.admonition-title) {
270+
background-color: rgba(255, 23, 68, 0.1);
271+
}
272+
:is(.admonish-danger, .admonish-error) > :is(.admonition-title, summary.admonition-title)::before {
273+
background-color: #ff1744;
274+
mask-image: var(--md-admonition-icon--admonish-danger);
275+
-webkit-mask-image: var(--md-admonition-icon--admonish-danger);
276+
mask-repeat: no-repeat;
277+
-webkit-mask-repeat: no-repeat;
278+
mask-size: contain;
279+
-webkit-mask-repeat: no-repeat;
280+
}
281+
282+
:is(.admonition):is(.admonish-bug) {
283+
border-color: #f50057;
284+
}
285+
286+
:is(.admonish-bug) > :is(.admonition-title, summary.admonition-title) {
287+
background-color: rgba(245, 0, 87, 0.1);
288+
}
289+
:is(.admonish-bug) > :is(.admonition-title, summary.admonition-title)::before {
290+
background-color: #f50057;
291+
mask-image: var(--md-admonition-icon--admonish-bug);
292+
-webkit-mask-image: var(--md-admonition-icon--admonish-bug);
293+
mask-repeat: no-repeat;
294+
-webkit-mask-repeat: no-repeat;
295+
mask-size: contain;
296+
-webkit-mask-repeat: no-repeat;
297+
}
298+
299+
:is(.admonition):is(.admonish-example) {
300+
border-color: #7c4dff;
301+
}
302+
303+
:is(.admonish-example) > :is(.admonition-title, summary.admonition-title) {
304+
background-color: rgba(124, 77, 255, 0.1);
305+
}
306+
:is(.admonish-example) > :is(.admonition-title, summary.admonition-title)::before {
307+
background-color: #7c4dff;
308+
mask-image: var(--md-admonition-icon--admonish-example);
309+
-webkit-mask-image: var(--md-admonition-icon--admonish-example);
310+
mask-repeat: no-repeat;
311+
-webkit-mask-repeat: no-repeat;
312+
mask-size: contain;
313+
-webkit-mask-repeat: no-repeat;
314+
}
315+
316+
:is(.admonition):is(.admonish-quote, .admonish-cite) {
317+
border-color: #9e9e9e;
318+
}
319+
320+
:is(.admonish-quote, .admonish-cite) > :is(.admonition-title, summary.admonition-title) {
321+
background-color: rgba(158, 158, 158, 0.1);
322+
}
323+
:is(.admonish-quote, .admonish-cite) > :is(.admonition-title, summary.admonition-title)::before {
324+
background-color: #9e9e9e;
325+
mask-image: var(--md-admonition-icon--admonish-quote);
326+
-webkit-mask-image: var(--md-admonition-icon--admonish-quote);
327+
mask-repeat: no-repeat;
328+
-webkit-mask-repeat: no-repeat;
329+
mask-size: contain;
330+
-webkit-mask-repeat: no-repeat;
331+
}
332+
333+
.navy :is(.admonition) {
334+
background-color: var(--sidebar-bg);
335+
}
336+
337+
.ayu :is(.admonition),
338+
.coal :is(.admonition) {
339+
background-color: var(--theme-hover);
340+
}
341+
342+
.rust :is(.admonition) {
343+
background-color: var(--sidebar-bg);
344+
color: var(--sidebar-fg);
345+
}
346+
.rust .admonition-anchor-link:link, .rust .admonition-anchor-link:visited {
347+
color: var(--sidebar-fg);
348+
}

0 commit comments

Comments
 (0)