Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions docs/examples.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,8 @@ QuickFIX/J comes with several example applications located in the `quickfix/exam
The QuickFIX/J version number can be determined by running the core JAR file from the command line:

```bash
java -jar quickfixj-core-3.0.0.jar
java -jar quickfixj-core-{{QUICKFIXJ_VERSION}}.jar

# Output:
# Version: 3.0.0
# Version: {{QUICKFIXJ_VERSION}}
```
4 changes: 2 additions & 2 deletions docs/overview.md
Original file line number Diff line number Diff line change
Expand Up @@ -40,14 +40,14 @@ To start using QuickFIX/J, add the following dependencies to your `pom.xml`. Qui
<dependency>
<groupId>org.quickfixj</groupId>
<artifactId>quickfixj-core</artifactId>
<version>3.0.0</version>
<version>{{QUICKFIXJ_VERSION}}</version>
</dependency>

<!-- FIX 4.4 Message Definitions (Add versions as needed) -->
<dependency>
<groupId>org.quickfixj</groupId>
<artifactId>quickfixj-messages-fix44</artifactId>
<version>3.0.0</version>
<version>{{QUICKFIXJ_VERSION}}</version>
</dependency>
```

Expand Down
314 changes: 182 additions & 132 deletions docusaurus.config.ts
Original file line number Diff line number Diff line change
@@ -1,151 +1,201 @@
import {themes as prismThemes} from 'prism-react-renderer';
import type {Config} from '@docusaurus/types';
import type * as Preset from '@docusaurus/preset-classic';
import type {Plugin} from 'unified';
import type {Node} from 'unist';
import type {Root} from 'mdast';

const config: Config = {
title: 'QuickFIX/J',
tagline: 'The Open Source FIX Protocol Engine for Java',
favicon: 'img/favicon.png',
const VERSION_PLACEHOLDER = '{{QUICKFIXJ_VERSION}}';
const VERSION_FALLBACK = '3.0.1';

future: {
v4: true,
},
async function fetchLatestVersion(fallback: string): Promise<string> {
try {
const response = await fetch(
'https://api.github.com/repos/quickfix-j/quickfixj/releases/latest',
{headers: {'User-Agent': 'quickfixj-pages-docusaurus'}},
);
if (!response.ok) {
console.warn(`GitHub API returned ${response.status}, using fallback version ${fallback}`);
return fallback;
}
const data = (await response.json()) as {tag_name: string};
return data.tag_name.replace(/^v/, '');
} catch (err) {
console.warn(`Failed to fetch latest QuickFIX/J version: ${err}. Using fallback ${fallback}`);
return fallback;
}
}

url: 'https://quickfixj.org', // Placeholder URL
baseUrl: process.env.BASE_URL || '/',
// Remark plugin that replaces {{QUICKFIXJ_VERSION}} in all markdown text,
// inline-code, and fenced-code-block nodes at build time.
function versionReplacerPlugin(version: string): Plugin<[], Root> {
return () => (tree: Root) => {
function walk(node: Node & {value?: string; children?: Node[]}) {
if (
['text', 'inlineCode', 'code'].includes(node.type) &&
typeof node.value === 'string'
) {
node.value = node.value.replaceAll(VERSION_PLACEHOLDER, version);
}
if (Array.isArray(node.children)) {
node.children.forEach(walk);
}
}
walk(tree);
};
}

organizationName: 'quickfix-j',
projectName: 'quickfixj',
export default async function createConfig(): Promise<Config> {
const quickfixjVersion = await fetchLatestVersion(VERSION_FALLBACK);

onBrokenLinks: 'throw',
return {
title: 'QuickFIX/J',
tagline: 'The Open Source FIX Protocol Engine for Java',
favicon: 'img/favicon.png',

i18n: {
defaultLocale: 'en',
locales: ['en'],
},
future: {
v4: true,
},

markdown: {
mermaid: true,
},
url: 'https://quickfixj.org', // Placeholder URL
baseUrl: process.env.BASE_URL || '/',

themes: ['@docusaurus/theme-mermaid'],
organizationName: 'quickfix-j',
projectName: 'quickfixj',

presets: [
[
'classic',
{
docs: {
sidebarPath: './sidebars.ts',
editUrl: 'https://github.com/quickfix-j/quickfixj-pages/edit/main/',
},
blog: false, // Disabling blog for a purely technical docs site
theme: {
customCss: './src/css/custom.css',
},
} satisfies Preset.Options,
],
],
onBrokenLinks: 'throw',

themeConfig: {
image: 'img/quickfixj-social-card.jpg',
announcementBar: {
id: 'quickfixj_news',
content:
'⚡ QuickFIX/J — The industry standard open source FIX engine for Java. <a target="_blank" rel="noopener noreferrer" href="https://github.com/quickfix-j/quickfixj">Star us on GitHub</a>',
isCloseable: true,
i18n: {
defaultLocale: 'en',
locales: ['en'],
},
colorMode: {
defaultMode: 'dark',
disableSwitch: false,
respectPrefersColorScheme: true,

markdown: {
mermaid: true,
},
navbar: {
title: 'QuickFIX/J',
logo: {
alt: 'QuickFIX/J Logo',
src: 'img/logo.png',
srcDark: 'img/logo-dark.png',
},
items: [
{
type: 'docSidebar',
sidebarId: 'docsSidebar',
position: 'left',
label: 'Documentation',
},
{
to: '/docs/architecture',
label: 'Core Concepts',
position: 'left',
},
{
to: '/docs/developer-docs',
label: 'Developer Guide',
position: 'left',
},
{
to: '/docs/acceptor-dynamic',
label: 'Advanced Topics',
position: 'left',
},
{
href: 'https://github.com/quickfix-j/quickfixj',
label: 'GitHub',
position: 'right',
},
],

themes: ['@docusaurus/theme-mermaid'],

customFields: {
quickfixjVersion,
},
footer: {
style: 'dark',
links: [
{
title: 'Learn',
items: [
{
label: 'Overview',
to: '/docs/overview',
},
{
label: 'Architecture',
to: '/docs/architecture',
},
{
label: 'Configuration',
to: '/docs/configuration',
},
],
},
{
title: 'Community',
items: [
{
label: 'Mailing List',
href: 'https://sourceforge.net/p/quickfixj/mailman/',
},
{
label: 'Stack Overflow',
href: 'https://stackoverflow.com/questions/tagged/quickfixj',
},
],
},

presets: [
[
'classic',
{
title: 'More',
items: [
{
label: 'GitHub',
href: 'https://github.com/quickfix-j/quickfixj',
},
],
},
docs: {
sidebarPath: './sidebars.ts',
editUrl: 'https://github.com/quickfix-j/quickfixj-pages/edit/main/',
remarkPlugins: [versionReplacerPlugin(quickfixjVersion)],
},
blog: false, // Disabling blog for a purely technical docs site
theme: {
customCss: './src/css/custom.css',
},
} satisfies Preset.Options,
],
copyright: `Copyright © ${new Date().getFullYear()} QuickFIX/J Contributors. Built with Docusaurus.`,
},
prism: {
theme: prismThemes.github,
darkTheme: prismThemes.dracula,
additionalLanguages: ['java', 'properties', 'bash'],
},
} satisfies Preset.ThemeConfig,
};
],

export default config;
themeConfig: {
image: 'img/quickfixj-social-card.jpg',
announcementBar: {
id: 'quickfixj_news',
content:
'⚡ QuickFIX/J — The industry standard open source FIX engine for Java. <a target="_blank" rel="noopener noreferrer" href="https://github.com/quickfix-j/quickfixj">Star us on GitHub</a>',
isCloseable: true,
},
colorMode: {
defaultMode: 'dark',
disableSwitch: false,
respectPrefersColorScheme: true,
},
navbar: {
title: 'QuickFIX/J',
logo: {
alt: 'QuickFIX/J Logo',
src: 'img/logo.png',
srcDark: 'img/logo-dark.png',
},
items: [
{
type: 'docSidebar',
sidebarId: 'docsSidebar',
position: 'left',
label: 'Documentation',
},
{
to: '/docs/architecture',
label: 'Core Concepts',
position: 'left',
},
{
to: '/docs/developer-docs',
label: 'Developer Guide',
position: 'left',
},
{
to: '/docs/acceptor-dynamic',
label: 'Advanced Topics',
position: 'left',
},
{
href: 'https://github.com/quickfix-j/quickfixj',
label: 'GitHub',
position: 'right',
},
],
},
footer: {
style: 'dark',
links: [
{
title: 'Learn',
items: [
{
label: 'Overview',
to: '/docs/overview',
},
{
label: 'Architecture',
to: '/docs/architecture',
},
{
label: 'Configuration',
to: '/docs/configuration',
},
],
},
{
title: 'Community',
items: [
{
label: 'Mailing List',
href: 'https://sourceforge.net/p/quickfixj/mailman/',
},
{
label: 'Stack Overflow',
href: 'https://stackoverflow.com/questions/tagged/quickfixj',
},
],
},
{
title: 'More',
items: [
{
label: 'GitHub',
href: 'https://github.com/quickfix-j/quickfixj',
},
],
},
],
copyright: `Copyright © ${new Date().getFullYear()} QuickFIX/J Contributors. Built with Docusaurus.`,
},
prism: {
theme: prismThemes.github,
darkTheme: prismThemes.dracula,
additionalLanguages: ['java', 'properties', 'bash'],
},
} satisfies Preset.ThemeConfig,
};
}
6 changes: 4 additions & 2 deletions src/pages/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -235,6 +235,8 @@ function TechStackSection() {
}

function QuickStartSection() {
const { siteConfig } = useDocusaurusContext();
const version = siteConfig.customFields?.quickfixjVersion as string;
return (
<section className={styles.quickStart}>
<div className="container">
Expand All @@ -248,12 +250,12 @@ function QuickStartSection() {
<dependency>
<groupId>org.quickfixj</groupId>
<artifactId>quickfixj-core</artifactId>
<version>3.0.0</version>
<version>${version}</version>
</dependency>
<dependency>
<groupId>org.quickfixj</groupId>
<artifactId>quickfixj-messages-fix44</artifactId>
<version>3.0.0</version>
<version>${version}</version>
</dependency>`}</code>
</pre>
</div>
Expand Down