Skip to content

Commit 4b48ea4

Browse files
committed
Add SIGs remote content integration
- Updated .gitignore to include new sigs.md file. - Modified remote-content.js to import and register the new SIGs source. - Created remote-sources/sigs.js to handle the retrieval and transformation of SIGS.md content. - Enhanced content transformation in contribute.js to fix links to SIGS.md. Signed-off-by: Pete Cheslock <[email protected]>
1 parent 0b7b0af commit 4b48ea4

File tree

4 files changed

+55
-2
lines changed

4 files changed

+55
-2
lines changed

.gitignore

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,4 +6,5 @@ build
66
# Remote content files (downloaded automatically)
77
docs/community/contribute.md
88
docs/community/code-of-conduct.md
9-
docs/community/security.md
9+
docs/community/security.md
10+
docs/community/sigs.md

remote-content/remote-content.js

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
import contributeSource from './remote-sources/contribute.js';
55
import codeOfConductSource from './remote-sources/code-of-conduct.js';
66
import securitySource from './remote-sources/security.js';
7+
import sigsSource from './remote-sources/sigs.js';
78

89
/**
910
* Remote Content Plugin System
@@ -27,6 +28,7 @@ const remoteContentPlugins = [
2728
contributeSource,
2829
codeOfConductSource,
2930
securitySource,
31+
sigsSource,
3032

3133
// Add more remote sources here
3234
];

remote-content/remote-sources/contribute.js

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,9 @@ export default [
3434
branch: 'dev',
3535
content,
3636
// Fix relative links in the content
37-
contentTransform: (content) => content.replace(/\(CODE_OF_CONDUCT\.md\)/g, '(code-of-conduct)')
37+
contentTransform: (content) => content
38+
.replace(/\(CODE_OF_CONDUCT\.md\)/g, '(code-of-conduct)')
39+
.replace(/\(SIGS\.md\)/g, '(sigs)')
3840
});
3941
}
4042
return undefined;

remote-content/remote-sources/sigs.js

Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
1+
/**
2+
* Special Interest Groups (SIGs) Remote Content
3+
*
4+
* Downloads the SIGS.md file from the llm-d repository
5+
* and transforms it into docs/community/sigs.md
6+
*/
7+
8+
import { createContentWithSource } from './utils.js';
9+
10+
export default [
11+
'docusaurus-plugin-remote-content',
12+
{
13+
// Basic configuration
14+
name: 'sigs-guide',
15+
sourceBaseUrl: 'https://raw.githubusercontent.com/llm-d/llm-d/dev/',
16+
outDir: 'docs/community',
17+
documents: ['SIGS.md'],
18+
19+
// Plugin behavior
20+
noRuntimeDownloads: false, // Download automatically when building
21+
performCleanup: true, // Clean up files after build
22+
23+
// Transform the content for this specific document
24+
modifyContent(filename, content) {
25+
if (filename === 'SIGS.md') {
26+
return createContentWithSource({
27+
title: 'Special Interest Groups (SIGs)',
28+
description: 'Information about Special Interest Groups in the llm-d project',
29+
sidebarLabel: 'Special Interest Groups (SIGs)',
30+
sidebarPosition: 2,
31+
filename: 'SIGS.md',
32+
newFilename: 'sigs.md',
33+
repoUrl: 'https://github.com/llm-d/llm-d',
34+
branch: 'dev',
35+
content,
36+
// Fix relative links and HTML tags for MDX compatibility
37+
contentTransform: (content) => content
38+
.replace(/<br>/g, '<br/>')
39+
.replace(/<hr>/g, '<hr/>')
40+
.replace(/<img([^>]*?)>/g, '<img$1/>')
41+
.replace(/\(CONTRIBUTING\.md\)/g, '(contribute)')
42+
.replace(/\(PROJECT\.md\)/g, '(https://github.com/llm-d/llm-d/blob/dev/PROJECT.md)')
43+
});
44+
}
45+
return undefined;
46+
},
47+
},
48+
];

0 commit comments

Comments
 (0)