Skip to content

Commit 09036b8

Browse files
committed
adding API reference pages for main classes of module
1 parent 9a1c770 commit 09036b8

File tree

9 files changed

+3697
-1
lines changed

9 files changed

+3697
-1
lines changed

docs/api/domain.html

Lines changed: 667 additions & 0 deletions
Large diffs are not rendered by default.

docs/api/index_api.html

Lines changed: 534 additions & 0 deletions
Large diffs are not rendered by default.

docs/api/patch.html

Lines changed: 531 additions & 0 deletions
Large diffs are not rendered by default.

docs/api/script_api.js

Lines changed: 425 additions & 0 deletions
Large diffs are not rendered by default.

docs/api/style_api.css

Lines changed: 715 additions & 0 deletions
Large diffs are not rendered by default.

docs/api/tree.html

Lines changed: 613 additions & 0 deletions
Large diffs are not rendered by default.

docs/doc.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ <h3>Concept Guides</h3>
5252
<h3>API Reference</h3>
5353
<p>Detailed signatures and docstrings auto‑generated from the source code.</p>
5454
<ul>
55-
<li><a href="https://github.com/SimVascular/svVascularize">Python API (svv.*)</a></li>
55+
<li><a href="api/index_api.html">Python API (svv.*)</a></li>
5656
<!-- <li><a href="api/cli.html">Command‑line interface (svv CLI)</a></li> -->
5757
</ul>
5858

docs/script.js

Lines changed: 65 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -70,3 +70,68 @@ document.addEventListener('DOMContentLoaded', () => {
7070
document.head.appendChild(py);
7171
};
7272
})();
73+
74+
75+
// --- Appended by API reference integration ---
76+
77+
/* =====================
78+
API REFERENCE ENHANCEMENTS
79+
===================== */
80+
(function () {
81+
// Build local TOC on the right if #local-toc exists
82+
const localToc = document.getElementById('local-toc');
83+
const content = document.querySelector('.content');
84+
if (localToc && content) {
85+
const heads = content.querySelectorAll('h2, h3');
86+
const ol = document.createElement('ol');
87+
heads.forEach(h => {
88+
if (!h.id) h.id = h.textContent.trim().toLowerCase().replace(/[^a-z0-9]+/g, '-');
89+
const li = document.createElement('li');
90+
const a = document.createElement('a');
91+
a.href = '#' + h.id;
92+
a.textContent = h.textContent;
93+
li.appendChild(a);
94+
ol.appendChild(li);
95+
96+
// Add anchor permalink to headings
97+
const anchor = document.createElement('a');
98+
anchor.href = '#' + h.id;
99+
anchor.className = 'anchor';
100+
anchor.setAttribute('aria-label', 'Permalink');
101+
anchor.textContent = '¶';
102+
h.appendChild(anchor);
103+
});
104+
localToc.appendChild(ol);
105+
106+
// Scroll spy to highlight current heading in TOC
107+
const tocLinks = localToc.querySelectorAll('a');
108+
const obs = new IntersectionObserver((entries) => {
109+
entries.forEach(entry => {
110+
const id = entry.target.getAttribute('id');
111+
const link = localToc.querySelector(`a[href="#${id}"]`);
112+
if (entry.isIntersecting) {
113+
tocLinks.forEach(l => l.classList.remove('active'));
114+
if (link) link.classList.add('active');
115+
}
116+
});
117+
}, { rootMargin: '-40% 0px -55% 0px', threshold: [0, 1.0] });
118+
heads.forEach(h => obs.observe(h));
119+
}
120+
121+
// Auto-enable copy-to-clipboard on code blocks
122+
document.querySelectorAll('pre').forEach(pre => pre.setAttribute('data-copy', ''));
123+
124+
// Smooth anchor scrolling with header offset
125+
function scrollWithOffset(e) {
126+
if (this.hash && this.pathname === location.pathname) {
127+
const target = document.querySelector(this.hash);
128+
if (target) {
129+
e.preventDefault();
130+
const top = target.getBoundingClientRect().top + window.pageYOffset - 80;
131+
window.scrollTo({ top, behavior: 'smooth' });
132+
history.replaceState(null, '', this.hash);
133+
}
134+
}
135+
}
136+
document.querySelectorAll('a[href^="#"]').forEach(a => a.addEventListener('click', scrollWithOffset));
137+
})();

docs/style.css

Lines changed: 146 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -291,3 +291,149 @@ footer {
291291
body { padding: 0 2rem; }
292292
.hero h2 { font-size: 2.75rem; }
293293
}
294+
295+
296+
/* --- Appended by API reference integration --- */
297+
298+
/* =====================
299+
API REFERENCE LAYOUT
300+
===================== */
301+
302+
/* Header (maps our .site-header to the existing .topnav look & feel) */
303+
.site-header {
304+
position: sticky;
305+
top: 0;
306+
z-index: 1000;
307+
background-color: var(--clr-primary-700);
308+
color: var(--clr-surface);
309+
box-shadow: var(--shadow-sm);
310+
transition: background-color var(--ease-fast), box-shadow var(--ease-fast);
311+
}
312+
.site-header .header-inner {
313+
display: flex;
314+
align-items: center;
315+
justify-content: space-between;
316+
padding: 0.9rem 0;
317+
}
318+
.site-header .brand {
319+
color: var(--clr-surface);
320+
font-weight: 700;
321+
letter-spacing: -.3px;
322+
}
323+
.site-header .primary-nav a {
324+
color: var(--clr-surface);
325+
font-weight: 600;
326+
margin-left: 1rem;
327+
position: relative;
328+
}
329+
.site-header .primary-nav a::after {
330+
content: "";
331+
position: absolute;
332+
left: 0; right: 0; bottom: -6px;
333+
height: 2px;
334+
background: var(--clr-primary-200);
335+
transform: scaleX(0);
336+
transform-origin: left;
337+
transition: transform var(--ease-fast);
338+
}
339+
.site-header .primary-nav a:hover::after,
340+
.site-header .primary-nav a:focus::after,
341+
.site-header .primary-nav a.active::after {
342+
transform: scaleX(1);
343+
}
344+
345+
/* Grid layout: left nav / content / right toc */
346+
.doc-grid {
347+
display: grid;
348+
grid-template-columns: 260px 1fr 260px;
349+
gap: 2rem;
350+
padding: 1.5rem 0 0;
351+
}
352+
.sidebar { position: sticky; top: 5.5rem; align-self: start; }
353+
.sidebar .sidebar-title { margin: 0 0 .5rem; font-size: 0.95rem; text-transform: uppercase; letter-spacing: .06em; color: var(--clr-grey-500); }
354+
.sidebar .sidebar-section {
355+
background: var(--clr-surface);
356+
border: 1px solid var(--clr-grey-300);
357+
border-radius: var(--radius-sm);
358+
box-shadow: var(--shadow-sm);
359+
padding: 0.75rem 0.85rem;
360+
}
361+
.left-nav .toc, .on-this-page .toc {
362+
margin: 0;
363+
padding-left: 1rem;
364+
}
365+
.left-nav .toc ol, .on-this-page .toc ol { list-style: none; margin: 0; padding-left: 0; }
366+
.left-nav .toc li, .on-this-page .toc li { margin: .25rem 0; }
367+
.left-nav .toc a, .on-this-page .toc a {
368+
color: var(--clr-grey-700);
369+
font-size: .92rem;
370+
}
371+
.left-nav .toc a.active, .on-this-page .toc a.active { color: var(--clr-primary-600); font-weight: 700; }
372+
373+
/* Content area */
374+
.content {
375+
background: var(--clr-surface);
376+
border: 1px solid var(--clr-grey-300);
377+
border-radius: var(--radius-sm);
378+
box-shadow: var(--shadow-sm);
379+
padding: 1.25rem 1.25rem;
380+
}
381+
.doc-header h1 { margin-top: 0; }
382+
.muted { color: var(--clr-grey-500); font-size: 0.9rem; }
383+
384+
/* Autosummary table */
385+
.api-table { border-collapse: collapse; width: 100%; margin: 1rem 0 1.5rem; }
386+
.api-table thead th {
387+
position: sticky;
388+
top: 0;
389+
background: var(--clr-grey-100);
390+
z-index: 1;
391+
}
392+
.api-table th, .api-table td { border: 1px solid var(--clr-grey-300); padding: .5rem .6rem; }
393+
.api-table tbody tr:nth-child(even) { background: rgba(0,0,0,.015); }
394+
395+
/* Signature blocks & field lists */
396+
.sig { font-family: Consolas, monospace; font-weight: 600; }
397+
.field-list { column-gap: 2rem; }
398+
.field-list dt { font-weight: 700; }
399+
.field-list dd { margin: 0 0 .6rem 0; color: var(--clr-grey-700); }
400+
401+
/* Admonitions (SciPy-like) */
402+
.admonition {
403+
border-left: 4px solid var(--clr-grey-300);
404+
background: var(--clr-grey-100);
405+
padding: .75rem 1rem;
406+
margin: 1.25rem 0;
407+
border-radius: var(--radius-sm);
408+
}
409+
.admonition p { margin: 0; }
410+
.admonition.info { border-left-color: var(--clr-primary-400); background: rgba(26,163,255,.12); }
411+
.admonition.warning { border-left-color: var(--clr-danger); background: rgba(255,107,107,.12); }
412+
.admonition.note { border-left-color: var(--clr-warning); background: rgba(255,182,39,.12); }
413+
.admonition.seealso { border-left-color: var(--clr-success); background: rgba(46,204,113,.12); }
414+
415+
/* Heading anchor permalink */
416+
.anchor {
417+
margin-left: .3rem;
418+
opacity: 0;
419+
text-decoration: none;
420+
font-weight: 700;
421+
}
422+
.content h2:hover .anchor,
423+
.content h3:hover .anchor,
424+
.content h4:hover .anchor { opacity: .8; }
425+
426+
/* Code blocks: add space for copy badge */
427+
pre[data-copy] { cursor: pointer; }
428+
pre[data-copy]::after { right: .75rem; top: .5rem; }
429+
430+
/* Responsive collapse */
431+
@media (max-width: 1100px) {
432+
.doc-grid { grid-template-columns: 220px 1fr; }
433+
.on-this-page { display: none; }
434+
}
435+
@media (max-width: 800px) {
436+
.doc-grid { grid-template-columns: 1fr; }
437+
.left-nav { display: none; }
438+
.content { padding: 1rem; }
439+
}

0 commit comments

Comments
 (0)