mirror of
https://github.com/FairRootGroup/FairMQ.git
synced 2026-11-25 13:11:36 +00:00
feat(docs): add the documentation site
- Astro and Starlight site in docs/ for https://fairrootgroup.github.io/FairMQ/ - 64 pages in eight groups: start, concepts, guides, shared memory, examples, tools, reference and project - API reference and source browser from the Doxygen XML of fairmq/ - Code samples are snippets of the repository files; the build fails when a snippet does not match - Option tables take the names, types and defaults from the code - Interactive diagrams: state machine, zero-copy transfer, region acknowledgements, session objects, topology and channel anatomy - The 404 page sends the URLs of the Doxygen site to the new pages - scripts/check-pages.mjs checks pages, snippets and links without a build; scripts/check-links.mjs checks all links in dist/ Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
26
docs/scripts/base-links.mjs
Normal file
26
docs/scripts/base-links.mjs
Normal file
@@ -0,0 +1,26 @@
|
||||
// Sätteri hast plugin: prefixes root-relative links and images in Markdown and MDX
|
||||
// with the site base, so that pages can link to `/concepts/channels/`
|
||||
// instead of `/FairMQ/concepts/channels/`.
|
||||
|
||||
function prefix(url, base) {
|
||||
if (typeof url !== 'string' || !url.startsWith('/') || url.startsWith('//')) return url;
|
||||
if (url === base || url.startsWith(base + '/')) return url;
|
||||
return base + url;
|
||||
}
|
||||
|
||||
export default function baseLinks({ base }) {
|
||||
const b = base.replace(/\/$/, '');
|
||||
return {
|
||||
name: 'fairmq-base-links',
|
||||
element: {
|
||||
filter: ['a', 'img'],
|
||||
visit(node, ctx) {
|
||||
if (!b) return;
|
||||
const key = node.tagName === 'a' ? 'href' : 'src';
|
||||
const value = node.properties?.[key];
|
||||
const next = prefix(value, b);
|
||||
if (next !== value) ctx.setProperty(node, key, next);
|
||||
},
|
||||
},
|
||||
};
|
||||
}
|
||||
Reference in New Issue
Block a user