The API documentation is good as it stands, but not great as a reference while developing code. I’d love to hack on my own extract to generate a more-useful-to-me document. Is the code that generates the API doc site public, and does it draw from the MAAS code itself or is it separately maintained?
Thanks to the help here, I found the Makefile target ‘api-docs.rst’ that does what I needed; that, combined with rst2html and a tiny bit of Javascript to expand all the details tags, has resulted in a much more usable (and correct, no substitutions of ‘-’ for ‘=’) document that I can also create terse summaries for, and search with browser or editor.
If anyone else wants it, make api-docs.rst; rst2html, then add this JS snippet to the end before </body>:
<script>
document.addEventListener('DOMContentLoaded', function() {
// Create the toggle button
const btn = document.createElement('button');
btn.textContent = 'Expand all';
btn.style.cssText = `
position: fixed;
top: 10px;
right: 10px;
z-index: 9999;
padding: 6px 12px;
font-size: 14px;
`;
document.body.appendChild(btn);
let allOpen = false;
btn.addEventListener('click', function() {
const details = document.querySelectorAll('details');
allOpen = !allOpen;
details.forEach(d => d.open = allOpen);
btn.textContent = allOpen ? 'Collapse all' : 'Expand all';
});
});
</script>