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:
102
docs/astro.config.mjs
Normal file
102
docs/astro.config.mjs
Normal file
@@ -0,0 +1,102 @@
|
||||
// @ts-check
|
||||
import { readFileSync } from 'node:fs';
|
||||
import { defineConfig } from 'astro/config';
|
||||
import starlight from '@astrojs/starlight';
|
||||
import starlightLinksValidator from 'starlight-links-validator';
|
||||
import { satteri } from '@astrojs/markdown-satteri';
|
||||
import baseLinks from './scripts/base-links.mjs';
|
||||
import nowrapCode from './scripts/nowrap-code.mjs';
|
||||
import fairmqData from './scripts/integration.mjs';
|
||||
|
||||
const base = '/FairMQ';
|
||||
const codeTheme = JSON.parse(readFileSync(new URL('./src/styles/code-theme.json', import.meta.url), 'utf8'));
|
||||
|
||||
export default defineConfig({
|
||||
site: 'https://fairrootgroup.github.io',
|
||||
base,
|
||||
markdown: {
|
||||
processor: satteri({ hastPlugins: [baseLinks({ base }), nowrapCode()] }),
|
||||
// Keep -- and ... as typed: options like --rate and quoted log output must stay exact.
|
||||
smartypants: false,
|
||||
},
|
||||
integrations: [
|
||||
fairmqData(),
|
||||
starlight({
|
||||
title: 'FairMQ',
|
||||
description: 'FairMQ is a C++17 message queuing library and framework for large-scale data processing.',
|
||||
favicon: '/favicon.svg',
|
||||
social: [{ icon: 'github', label: 'GitHub', href: 'https://github.com/FairRootGroup/FairMQ' }],
|
||||
editLink: { baseUrl: 'https://github.com/FairRootGroup/FairMQ/edit/dev/docs/' },
|
||||
lastUpdated: true,
|
||||
disable404Route: true,
|
||||
customCss: [
|
||||
'@fontsource-variable/archivo/wdth.css',
|
||||
'@fontsource-variable/jetbrains-mono/wght.css',
|
||||
'@fontsource-variable/jetbrains-mono/wght-italic.css',
|
||||
'./src/styles/theme.css',
|
||||
],
|
||||
components: {
|
||||
Header: './src/components/overrides/Header.astro',
|
||||
PageTitle: './src/components/overrides/PageTitle.astro',
|
||||
Footer: './src/components/overrides/Footer.astro',
|
||||
PageSidebar: './src/components/overrides/PageSidebar.astro',
|
||||
Hero: './src/components/overrides/Hero.astro',
|
||||
MobileMenuFooter: './src/components/overrides/MobileMenuFooter.astro',
|
||||
},
|
||||
expressiveCode: {
|
||||
themes: [codeTheme],
|
||||
useStarlightDarkModeSwitch: false,
|
||||
useStarlightUiThemeColors: false,
|
||||
styleOverrides: {
|
||||
borderRadius: '6px',
|
||||
borderColor: 'var(--fmq-code-rule)',
|
||||
codeBackground: 'var(--fmq-code-bg)',
|
||||
codeFontFamily: 'var(--fmq-font-mono)',
|
||||
codeFontSize: '0.84rem',
|
||||
codeLineHeight: '1.65',
|
||||
uiFontFamily: 'var(--fmq-font-body)',
|
||||
frames: {
|
||||
editorBackground: 'var(--fmq-code-bg)',
|
||||
editorTabBarBackground: 'var(--fmq-code-bg)',
|
||||
editorActiveTabBackground: 'var(--fmq-code-bg)',
|
||||
editorActiveTabIndicatorTopColor: 'transparent',
|
||||
editorActiveTabIndicatorBottomColor: 'var(--fmq-saffron)',
|
||||
editorTabBarBorderBottomColor: 'var(--fmq-code-rule)',
|
||||
terminalBackground: 'var(--fmq-code-bg)',
|
||||
terminalTitlebarBackground: 'var(--fmq-code-bg)',
|
||||
terminalTitlebarBorderBottomColor: 'var(--fmq-code-rule)',
|
||||
terminalTitlebarDotsForeground: 'var(--fmq-stage-line)',
|
||||
terminalTitlebarDotsOpacity: '1',
|
||||
frameBoxShadowCssValue: 'none',
|
||||
inlineButtonBorder: 'var(--fmq-code-rule)',
|
||||
},
|
||||
},
|
||||
},
|
||||
sidebar: [
|
||||
{ label: 'Start', items: [{ autogenerate: { directory: 'start' } }] },
|
||||
{ label: 'Concepts', items: [{ autogenerate: { directory: 'concepts' } }] },
|
||||
{ label: 'Guides', items: [{ autogenerate: { directory: 'guides' } }] },
|
||||
{ label: 'Shared memory', items: [{ autogenerate: { directory: 'shmem' } }] },
|
||||
{ label: 'Tools', items: [{ autogenerate: { directory: 'tools' } }] },
|
||||
{ label: 'Reference', items: [{ autogenerate: { directory: 'reference' } }] },
|
||||
{ label: 'Examples', collapsed: true, items: [{ autogenerate: { directory: 'examples' } }] },
|
||||
{ label: 'Project', collapsed: true, items: [{ autogenerate: { directory: 'project' } }] },
|
||||
{
|
||||
label: 'Code',
|
||||
items: [
|
||||
{ label: 'API reference', link: '/api/' },
|
||||
{ label: 'Source browser', link: '/source/' },
|
||||
],
|
||||
},
|
||||
],
|
||||
plugins: [
|
||||
starlightLinksValidator({
|
||||
errorOnRelativeLinks: false,
|
||||
// Generated pages, and the row anchors of <OptionsTable> (the validator sees only
|
||||
// headings). scripts/check-links.mjs checks these links in dist/.
|
||||
exclude: ['/FairMQ/api/**', '/FairMQ/source/**', '/FairMQ/reference/options/#opt-*'],
|
||||
}),
|
||||
],
|
||||
}),
|
||||
],
|
||||
});
|
||||
Reference in New Issue
Block a user