Skip to content

Commit 86e214f

Browse files
committed
docs: Update docs design to match Rossum API docs style
1 parent 24802ce commit 86e214f

File tree

8 files changed

+218
-27
lines changed

8 files changed

+218
-27
lines changed

docs/_static/custom.css

Lines changed: 154 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,155 @@
1-
/* Make the documentation content wider */
2-
.wy-nav-content {
3-
max-width: 1200px !important;
1+
/* ============================================================
2+
Rossum API SDK — Custom theme overrides
3+
Matches the visual design of https://rossum.app/api/docs/
4+
============================================================ */
5+
6+
/* -- Narrower sidebar ------------------------------------------- */
7+
.sidebar-drawer {
8+
width: 200px !important;
9+
}
10+
11+
body {
12+
--sidebar-width: 200px !important;
13+
}
14+
15+
.sidebar-brand {
16+
padding: 1rem 0.75rem 0.5rem;
17+
}
18+
19+
.sidebar-logo {
20+
max-width: 120px;
21+
margin: 0 auto;
22+
padding: 0.25rem 0;
23+
}
24+
25+
.sidebar-tree .reference {
26+
font-size: 0.8rem;
27+
letter-spacing: 0.01em;
28+
}
29+
30+
.sidebar-tree li.current > .reference {
31+
font-weight: 600;
32+
}
33+
34+
/* -- Headings --------------------------------------------------- */
35+
h1, h2, h3, h4, h5, h6 {
36+
font-weight: 600;
37+
letter-spacing: -0.01em;
38+
}
39+
40+
h1 { font-size: 1.75rem; }
41+
h2 { font-size: 1.35rem; margin-top: 2rem; }
42+
43+
/* -- Links ------------------------------------------------------ */
44+
a {
45+
text-decoration: none;
46+
}
47+
48+
a:hover {
49+
text-decoration: underline;
50+
}
51+
52+
/* -- Code blocks ------------------------------------------------ */
53+
.highlight {
54+
border-radius: 6px;
55+
}
56+
57+
.highlight pre {
58+
font-size: 0.8rem;
59+
line-height: 1.5;
60+
overflow-x: auto;
61+
}
62+
63+
code.literal {
64+
border-radius: 4px;
65+
padding: 0.15em 0.4em;
66+
font-size: 0.85em;
67+
}
68+
69+
/* -- Admonitions ------------------------------------------------ */
70+
.admonition {
71+
border-radius: 6px;
72+
box-shadow: none;
73+
}
74+
75+
/* -- API class / method blocks ---------------------------------- */
76+
dl.py.class > dt,
77+
dl.py.method > dt,
78+
dl.py.function > dt,
79+
dl.py.attribute > dt {
80+
font-size: 0.85rem;
81+
word-break: break-word;
82+
overflow-wrap: anywhere;
83+
}
84+
85+
.sig:not(.sig-inline) {
86+
background: rgba(30, 110, 229, 0.06) !important;
87+
border-left: 3px solid #1E6EE5;
88+
border-radius: 0 6px 6px 0;
89+
padding: 0.75rem 1rem 0.75rem 1rem !important;
90+
text-indent: 0 !important;
91+
margin-left: 0 !important;
92+
margin-right: 0 !important;
93+
}
94+
95+
.sig:not(.sig-inline):hover {
96+
background: rgba(30, 110, 229, 0.10) !important;
97+
}
98+
99+
/* -- Right-side TOC (on this page) ------------------------------ */
100+
.toc-tree {
101+
font-size: 0.75rem;
102+
line-height: 1.4;
103+
}
104+
105+
.toc-tree li > a {
106+
display: block;
107+
white-space: normal;
108+
word-break: break-all;
109+
overflow-wrap: anywhere;
110+
padding: 0.2em 0.5em;
111+
border-radius: 4px;
112+
background: rgba(30, 110, 229, 0.06);
113+
margin-bottom: 2px;
114+
}
115+
116+
.toc-tree li > a:hover {
117+
background: rgba(30, 110, 229, 0.14);
118+
}
119+
120+
.toc-tree li.scroll-current > a {
121+
background: rgba(30, 110, 229, 0.18);
122+
font-weight: 600;
123+
}
124+
125+
/* -- Tables ----------------------------------------------------- */
126+
table.docutils {
127+
border-collapse: collapse;
128+
width: 100%;
129+
border-radius: 6px;
130+
overflow: hidden;
131+
font-size: 0.875rem;
132+
}
133+
134+
table.docutils td, table.docutils th {
135+
padding: 0.5rem 0.75rem;
136+
}
137+
138+
/* -- Version badge under sidebar title --------------------------- */
139+
.sidebar-version-badge {
140+
display: inline-block;
141+
font-size: 0.7rem;
142+
font-weight: 600;
143+
color: #1E6EE5;
144+
background: rgba(30, 110, 229, 0.1);
145+
border-radius: 4px;
146+
padding: 0.1em 0.5em;
147+
margin-top: 0.25rem;
148+
letter-spacing: 0.02em;
149+
}
150+
151+
/* -- Footer ----------------------------------------------------- */
152+
.bottom-of-page {
153+
font-size: 0.8rem;
154+
opacity: 0.7;
4155
}

docs/_static/custom.js

Lines changed: 34 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,41 @@
1-
// Hide class prefix from method names in sidebar
21
document.addEventListener('DOMContentLoaded', function() {
3-
const methodLinks = document.querySelectorAll('li.toctree-l4 a code span.pre');
2+
// Add version badge under sidebar brand text
3+
var brandText = document.querySelector('.sidebar-brand-text');
4+
if (brandText) {
5+
var version = document.querySelector('meta[name="version"]');
6+
var versionStr = version ? version.getAttribute('content') : null;
7+
if (!versionStr) {
8+
var match = document.body.innerHTML.match(/release\s*=\s*["']([^"']+)["']/);
9+
if (!match) {
10+
var el = document.querySelector('[data-version]');
11+
versionStr = el ? el.getAttribute('data-version') : null;
12+
}
13+
}
14+
// Fallback: extract from the page metadata
15+
if (!versionStr) {
16+
var metaTags = document.querySelectorAll('meta');
17+
metaTags.forEach(function(m) {
18+
if (m.getAttribute('name') === 'generator') {
19+
// not useful, skip
20+
}
21+
});
22+
}
23+
// Use the version from conf.py injected into the template
24+
var badge = document.createElement('span');
25+
badge.className = 'sidebar-version-badge';
26+
badge.textContent = 'v' + (document.querySelector('.footer-item a[href*="pypi"]') ? '' : DOCUMENTATION_OPTIONS.VERSION || '');
27+
if (typeof DOCUMENTATION_OPTIONS !== 'undefined' && DOCUMENTATION_OPTIONS.VERSION) {
28+
badge.textContent = 'v' + DOCUMENTATION_OPTIONS.VERSION;
29+
brandText.parentNode.insertBefore(badge, brandText.nextSibling);
30+
}
31+
}
432

33+
// Hide class prefix from method names in sidebar
34+
var methodLinks = document.querySelectorAll('li.toctree-l4 a code span.pre');
535
methodLinks.forEach(function(span) {
6-
const fullText = span.textContent;
7-
// Match pattern like "ClassName.method_name()"
8-
const match = fullText.match(/\.([^.()]+\(\))/);
9-
36+
var fullText = span.textContent;
37+
var match = fullText.match(/\.([^.()]+\(\))/);
1038
if (match) {
11-
// Extract just the method name with parentheses
1239
span.textContent = match[1];
1340
}
1441
});

docs/_static/logo.png

-11.7 KB
Binary file not shown.

docs/_static/rossum-logo.svg

Lines changed: 1 addition & 0 deletions
Loading

docs/clients.rst

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5,10 +5,6 @@ The Rossum API SDK provides both synchronous and asynchronous clients for intera
55
with the Rossum API. Both clients offer identical functionality, so choose the one
66
that best fits your application architecture.
77

8-
.. contents:: Table of Contents
9-
:local:
10-
:depth: 2
11-
128
Overview
139
--------
1410

docs/conf.py

Lines changed: 28 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -79,17 +79,37 @@
7979
# -- Options for HTML output -------------------------------------------------
8080
# https://www.sphinx-doc.org/en/master/usage/configuration.html#options-for-html-output
8181

82-
html_theme = "sphinx_rtd_theme"
82+
html_theme = "furo"
8383
html_static_path = ["_static"]
84-
html_logo = "_static/logo.png"
84+
html_logo = "_static/rossum-logo.svg"
85+
html_favicon = "_static/rossum-logo.svg"
86+
html_title = "Rossum API SDK"
8587

86-
# Theme options
8788
html_theme_options = {
88-
"navigation_depth": 4,
89-
"collapse_navigation": False,
90-
"sticky_navigation": True,
91-
"version_selector": True,
92-
"logo_only": False,
89+
"light_css_variables": {
90+
"color-brand-primary": "#1E6EE5",
91+
"color-brand-content": "#1E6EE5",
92+
"color-admonition-background": "rgba(30, 110, 229, 0.05)",
93+
"color-sidebar-background": "#ffffff",
94+
"color-sidebar-search-background": "#f5f7fa",
95+
"color-sidebar-search-border": "#e0e6ed",
96+
"color-sidebar-link-text--top-level": "#0d1117",
97+
"color-sidebar-item-background--hover": "rgba(30, 110, 229, 0.08)",
98+
"color-sidebar-item-expander-background--hover": "rgba(30, 110, 229, 0.08)",
99+
"font-stack": "-apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif",
100+
"font-stack--monospace": "'SFMono-Regular', Menlo, Consolas, 'Liberation Mono', monospace",
101+
},
102+
"dark_css_variables": {
103+
"color-brand-primary": "#61A0FF",
104+
"color-brand-content": "#61A0FF",
105+
"color-admonition-background": "rgba(97, 160, 255, 0.1)",
106+
},
107+
"sidebar_hide_name": False,
108+
"navigation_with_keys": True,
109+
"top_of_page_buttons": ["view"],
110+
"source_repository": "https://github.com/rossumai/rossum-api",
111+
"source_branch": "main",
112+
"source_directory": "docs/",
93113
}
94114

95115

docs/models.rst

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5,10 +5,6 @@ The Rossum API SDK provides type-safe dataclass models for all API resources.
55
These models are automatically populated from API responses and provide
66
clear type hints for all fields.
77

8-
.. contents:: Table of Contents
9-
:local:
10-
:depth: 1
11-
128
Overview
139
--------
1410

pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ tests = [
4646
]
4747
docs = [
4848
"sphinx>=8.2,<9.0",
49-
"sphinx-rtd-theme",
49+
"furo",
5050
"sphinx-autodoc-typehints",
5151
]
5252

0 commit comments

Comments
 (0)