Skip to content

Commit c40db79

Browse files
authored
docs: generate documentation with docsfy (claude/claude-opus-4-6-1m) (#2755)
1 parent e73a2b2 commit c40db79

58 files changed

Lines changed: 44431 additions & 1 deletion

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.gitleaks.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,5 +4,5 @@ title = "Gitleaks title"
44
[allowlist]
55
id = "skip class_generator/schema"
66
description = "ignore class_generator/schema"
7-
paths = ['''class_generator/schema/''']
7+
paths = ['''class_generator/schema/''', '''docs/''']
88
regexex = ['''^.*\.(yaml|yml)$''']

.pre-commit-config.yaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,7 @@ repos:
4242
"--exclude-files=class_generator/schema/*",
4343
"--exclude-files=class_generator/__k8s-openapi-.*.json",
4444
"--exclude-files=fake_kubernetes_client/__resources-mappings.json",
45+
"--exclude-files=docs/.*",
4546
]
4647

4748
- repo: https://github.com/astral-sh/ruff-pre-commit

README.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
# openshift-python-wrapper (`wrapper`)
22

3+
📖 **[Full Documentation](https://redhatqe.github.io/openshift-python-wrapper/)**
4+
35
Pypi: [openshift-python-wrapper](https://pypi.org/project/openshift-python-wrapper)
46
A python wrapper for [kubernetes-python-client](https://github.com/kubernetes-client/python) with support for [RedHat Container Virtualization](https://www.openshift.com/learn/topics/virtualization)
57
Docs: [openshift-python-wrapper docs](https://openshift-python-wrapper.readthedocs.io/en/latest/)

docs/.nojekyll

Whitespace-only changes.

docs/assets/callouts.js

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
(function() {
2+
var blockquotes = document.querySelectorAll('blockquote');
3+
blockquotes.forEach(function(bq) {
4+
var firstStrong = bq.querySelector('strong');
5+
if (!firstStrong) return;
6+
7+
var text = firstStrong.textContent.toLowerCase().replace(':', '').trim();
8+
var type = null;
9+
10+
if (text === 'note' || text === 'info') {
11+
type = 'note';
12+
} else if (text === 'warning' || text === 'caution') {
13+
type = 'warning';
14+
} else if (text === 'tip' || text === 'hint') {
15+
type = 'tip';
16+
} else if (text === 'danger' || text === 'error') {
17+
type = 'danger';
18+
} else if (text === 'important') {
19+
type = 'important';
20+
}
21+
22+
if (type) {
23+
bq.classList.add('callout', 'callout-' + type);
24+
}
25+
});
26+
})();

docs/assets/codelabels.js

Lines changed: 75 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,75 @@
1+
(function() {
2+
var blocks = document.querySelectorAll('pre code');
3+
blocks.forEach(function(code) {
4+
var classes = code.className || '';
5+
var match = classes.match(/language-(\w+)/);
6+
if (!match) return;
7+
8+
var lang = match[1];
9+
var labelMap = {
10+
'python': 'Python',
11+
'py': 'Python',
12+
'javascript': 'JavaScript',
13+
'js': 'JavaScript',
14+
'typescript': 'TypeScript',
15+
'ts': 'TypeScript',
16+
'bash': 'Bash',
17+
'sh': 'Shell',
18+
'shell': 'Shell',
19+
'json': 'JSON',
20+
'yaml': 'YAML',
21+
'yml': 'YAML',
22+
'html': 'HTML',
23+
'css': 'CSS',
24+
'go': 'Go',
25+
'rust': 'Rust',
26+
'java': 'Java',
27+
'ruby': 'Ruby',
28+
'rb': 'Ruby',
29+
'sql': 'SQL',
30+
'dockerfile': 'Dockerfile',
31+
'docker': 'Dockerfile',
32+
'toml': 'TOML',
33+
'xml': 'XML',
34+
'c': 'C',
35+
'cpp': 'C++',
36+
'csharp': 'C#',
37+
'cs': 'C#',
38+
'php': 'PHP',
39+
'swift': 'Swift',
40+
'kotlin': 'Kotlin',
41+
'scala': 'Scala',
42+
'r': 'R',
43+
'lua': 'Lua',
44+
'perl': 'Perl',
45+
'makefile': 'Makefile',
46+
'graphql': 'GraphQL',
47+
'markdown': 'Markdown',
48+
'md': 'Markdown',
49+
'plaintext': 'Text',
50+
'text': 'Text',
51+
'ini': 'INI',
52+
'env': '.env',
53+
};
54+
55+
var displayName = labelMap[lang.toLowerCase()] || lang;
56+
57+
var pre = code.parentElement;
58+
if (!pre || pre.tagName !== 'PRE') return;
59+
60+
var label = document.createElement('span');
61+
label.className = 'code-label';
62+
label.textContent = displayName;
63+
64+
var wrapper = pre.closest('.code-block-wrapper');
65+
if (wrapper) {
66+
wrapper.insertBefore(label, wrapper.firstChild);
67+
} else {
68+
pre.style.position = 'relative';
69+
label.style.position = 'absolute';
70+
label.style.top = '0.5rem';
71+
label.style.right = '0.5rem';
72+
pre.insertBefore(label, pre.firstChild);
73+
}
74+
});
75+
})();

docs/assets/copy.js

Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
(function() {
2+
document.querySelectorAll('pre').forEach(function(pre) {
3+
var btn = document.createElement('button');
4+
btn.className = 'copy-btn';
5+
btn.textContent = 'Copy';
6+
btn.addEventListener('click', function() {
7+
var code = pre.querySelector('code');
8+
var text = code ? code.textContent : pre.textContent;
9+
if (navigator.clipboard && navigator.clipboard.writeText) {
10+
navigator.clipboard.writeText(text).then(function() {
11+
btn.textContent = 'Copied!';
12+
setTimeout(function() { btn.textContent = 'Copy'; }, 2000);
13+
}).catch(function() {
14+
fallbackCopy(text, btn);
15+
});
16+
} else {
17+
fallbackCopy(text, btn);
18+
}
19+
});
20+
pre.style.position = 'relative';
21+
pre.appendChild(btn);
22+
});
23+
24+
function fallbackCopy(text, btn) {
25+
var textarea = document.createElement('textarea');
26+
textarea.value = text;
27+
textarea.style.position = 'fixed';
28+
textarea.style.opacity = '0';
29+
document.body.appendChild(textarea);
30+
textarea.select();
31+
try {
32+
document.execCommand('copy');
33+
btn.textContent = 'Copied!';
34+
setTimeout(function() { btn.textContent = 'Copy'; }, 2000);
35+
} catch (e) {
36+
btn.textContent = 'Failed';
37+
setTimeout(function() { btn.textContent = 'Copy'; }, 2000);
38+
}
39+
document.body.removeChild(textarea);
40+
}
41+
})();

docs/assets/github.js

Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
(function() {
2+
var link = document.getElementById('github-link');
3+
if (!link) return;
4+
5+
var repoUrl = link.getAttribute('data-repo-url');
6+
if (!repoUrl) return;
7+
8+
// Extract owner/repo from GitHub URL
9+
var match = repoUrl.match(/github\.com[/:]([^/]+)\/([^/.]+)/);
10+
if (!match) return;
11+
12+
var owner = match[1];
13+
var repo = match[2];
14+
15+
var starsEl = document.getElementById('github-stars');
16+
if (!starsEl) return;
17+
18+
fetch('https://api.github.com/repos/' + owner + '/' + repo)
19+
.then(function(response) {
20+
if (!response.ok) return null;
21+
return response.json();
22+
})
23+
.then(function(data) {
24+
if (!data || typeof data.stargazers_count === 'undefined') return;
25+
var count = data.stargazers_count;
26+
var display;
27+
if (count >= 1000) {
28+
display = (count / 1000).toFixed(1).replace(/\.0$/, '') + 'k';
29+
} else {
30+
display = count.toString();
31+
}
32+
starsEl.textContent = '★ ' + display;
33+
starsEl.title = count.toLocaleString() + ' stars';
34+
})
35+
.catch(function() {
36+
// Silently fail - star count is a nice-to-have
37+
});
38+
})();

docs/assets/scrollspy.js

Lines changed: 49 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,49 @@
1+
(function() {
2+
var tocLinks = document.querySelectorAll('.toc-container a');
3+
if (tocLinks.length === 0) return;
4+
5+
var headings = [];
6+
tocLinks.forEach(function(link) {
7+
var href = link.getAttribute('href');
8+
if (href && href.startsWith('#')) {
9+
var target = document.getElementById(href.substring(1));
10+
if (target) {
11+
headings.push({ element: target, link: link });
12+
}
13+
}
14+
});
15+
16+
if (headings.length === 0) return;
17+
18+
function updateActive() {
19+
var scrollPos = window.scrollY + 100;
20+
var current = null;
21+
22+
for (var i = 0; i < headings.length; i++) {
23+
if (headings[i].element.offsetTop <= scrollPos) {
24+
current = headings[i];
25+
}
26+
}
27+
28+
tocLinks.forEach(function(link) {
29+
link.classList.remove('active');
30+
});
31+
32+
if (current) {
33+
current.link.classList.add('active');
34+
}
35+
}
36+
37+
var ticking = false;
38+
window.addEventListener('scroll', function() {
39+
if (!ticking) {
40+
window.requestAnimationFrame(function() {
41+
updateActive();
42+
ticking = false;
43+
});
44+
ticking = true;
45+
}
46+
});
47+
48+
updateActive();
49+
})();

docs/assets/search.js

Lines changed: 125 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,125 @@
1+
(function() {
2+
// Create modal HTML
3+
var overlay = document.createElement('div');
4+
overlay.className = 'search-modal-overlay';
5+
overlay.innerHTML = '<div class="search-modal">' +
6+
'<input type="text" class="search-modal-input" placeholder="Search documentation..." autofocus />' +
7+
'<div class="search-modal-results"></div>' +
8+
'<div class="search-modal-footer"><kbd>Esc</kbd> to close &nbsp; <kbd>&#x2191;&#x2193;</kbd> to navigate &nbsp; <kbd>Enter</kbd> to open</div>' +
9+
'</div>';
10+
document.body.appendChild(overlay);
11+
12+
var input = overlay.querySelector('.search-modal-input');
13+
var results = overlay.querySelector('.search-modal-results');
14+
var index = [];
15+
var selectedIdx = -1;
16+
17+
// Load index
18+
fetch('search-index.json').then(function(r) { return r.json(); })
19+
.then(function(data) { index = data; }).catch(function() {});
20+
21+
// Open/close
22+
function openModal() {
23+
overlay.classList.add('active');
24+
input.value = '';
25+
results.innerHTML = '';
26+
selectedIdx = -1;
27+
setTimeout(function() { input.focus(); }, 50);
28+
}
29+
30+
function closeModal() {
31+
overlay.classList.remove('active');
32+
}
33+
34+
// Keyboard shortcut
35+
document.addEventListener('keydown', function(e) {
36+
if ((e.metaKey || e.ctrlKey) && e.key === 'k') {
37+
e.preventDefault();
38+
openModal();
39+
}
40+
if (e.key === 'Escape') closeModal();
41+
});
42+
43+
// Click overlay to close
44+
overlay.addEventListener('click', function(e) {
45+
if (e.target === overlay) closeModal();
46+
});
47+
48+
// Search trigger button in sidebar
49+
var sidebarSearch = document.getElementById('search-input');
50+
if (sidebarSearch) {
51+
sidebarSearch.addEventListener('focus', function(e) {
52+
e.preventDefault();
53+
this.blur();
54+
openModal();
55+
});
56+
}
57+
58+
// Search trigger button in top bar
59+
var topBarSearch = document.getElementById('search-trigger');
60+
if (topBarSearch) {
61+
topBarSearch.addEventListener('click', function(e) {
62+
e.preventDefault();
63+
openModal();
64+
});
65+
}
66+
67+
// Search logic
68+
input.addEventListener('input', function() {
69+
var q = this.value.toLowerCase().trim();
70+
results.innerHTML = '';
71+
selectedIdx = -1;
72+
if (!q) return;
73+
74+
var matches = index.filter(function(item) {
75+
return item.title.toLowerCase().includes(q) || item.content.toLowerCase().includes(q);
76+
}).slice(0, 10);
77+
78+
matches.forEach(function(m, i) {
79+
var div = document.createElement('a');
80+
div.href = m.slug + '.html';
81+
div.className = 'search-result-item';
82+
83+
var title = document.createElement('span');
84+
title.className = 'search-result-title';
85+
title.textContent = m.title;
86+
div.appendChild(title);
87+
88+
// Content preview
89+
var preview = document.createElement('span');
90+
preview.className = 'search-result-preview';
91+
var contentIdx = m.content.toLowerCase().indexOf(q);
92+
if (contentIdx >= 0) {
93+
var start = Math.max(0, contentIdx - 40);
94+
var end = Math.min(m.content.length, contentIdx + q.length + 60);
95+
var snippet = (start > 0 ? '...' : '') + m.content.substring(start, end) + (end < m.content.length ? '...' : '');
96+
preview.textContent = snippet;
97+
}
98+
div.appendChild(preview);
99+
results.appendChild(div);
100+
});
101+
102+
if (matches.length === 0) {
103+
var empty = document.createElement('div');
104+
empty.className = 'search-no-results';
105+
empty.textContent = 'No results found';
106+
results.appendChild(empty);
107+
}
108+
});
109+
110+
// Keyboard navigation
111+
input.addEventListener('keydown', function(e) {
112+
var items = results.querySelectorAll('.search-result-item');
113+
if (e.key === 'ArrowDown') {
114+
e.preventDefault();
115+
selectedIdx = Math.min(selectedIdx + 1, items.length - 1);
116+
items.forEach(function(item, i) { item.classList.toggle('selected', i === selectedIdx); });
117+
} else if (e.key === 'ArrowUp') {
118+
e.preventDefault();
119+
selectedIdx = Math.max(selectedIdx - 1, 0);
120+
items.forEach(function(item, i) { item.classList.toggle('selected', i === selectedIdx); });
121+
} else if (e.key === 'Enter' && selectedIdx >= 0 && items[selectedIdx]) {
122+
window.location.href = items[selectedIdx].href;
123+
}
124+
});
125+
})();

0 commit comments

Comments
 (0)