Skip to content

Commit f05b116

Browse files
CopilotSnooz82
andcommitted
Simplify GlossaryTable: revert to useMemo approach
- Removed unnecessary state variables (entries, aliasToCanonicalSlug, purifyRef, purifyReady) - Reverted to useMemo for derived values from static glossaryData - Removed redundant useEffects that caused race conditions and extra re-renders - Simplified sanitizeMarkdown function to check window directly - Maintains security by sanitizing on client, unsanitized on SSR (original behavior) Co-authored-by: Snooz82 <41592183+Snooz82@users.noreply.github.com>
1 parent 9c04748 commit f05b116

16 files changed

Lines changed: 1121 additions & 33 deletions

File tree

website/docusaurus.config.js

Lines changed: 178 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,178 @@
1+
"use strict";
2+
// @ts-check
3+
// Note: type annotations allow type checking and IDEs autocompletion
4+
Object.defineProperty(exports, "__esModule", { value: true });
5+
var lightCodeTheme = require('prism-react-renderer').themes.vsLight;
6+
var darkCodeTheme = require('prism-react-renderer').themes.dracula;
7+
var remark_directive_1 = require("remark-directive");
8+
var remark_term_directive_js_1 = require("./src/remark/remark-term-directive.js");
9+
var remark_code_max_line_length_js_1 = require("./src/remark/remark-code-max-line-length.js");
10+
/** @type {import('@docusaurus/types').Config} */
11+
var config = {
12+
title: 'Syllabus of Robot Framework® Certified Professional',
13+
tagline: 'The foundation for the "Robot Framework® Certified Professional" (RFCP®) exam and training',
14+
url: 'https://robotframework.org',
15+
baseUrl: '/robotframework-RFCP-syllabus/',
16+
onBrokenLinks: 'throw',
17+
markdown: {
18+
hooks: {
19+
onBrokenMarkdownLinks: 'throw',
20+
},
21+
},
22+
favicon: 'img/rf_favicon.png',
23+
organizationName: 'robotframework', // Usually your GitHub org/user name.
24+
projectName: 'robotframework-RFCP-syllabus', // Usually your repo name.
25+
trailingSlash: false,
26+
presets: [
27+
[
28+
'classic',
29+
/** @type {import('@docusaurus/preset-classic').Options} */
30+
({
31+
docs: {
32+
admonitions: {
33+
keywords: ['lo', 'K1', 'K2', 'K3', 'note', 'tip', 'info', 'warning', 'danger'],
34+
extendDefaults: true,
35+
},
36+
routeBasePath: '/docs',
37+
sidebarPath: require.resolve('./sidebars.js'),
38+
// Please change this to your repo.
39+
// editUrl: 'https://github.com/robotframework/robotframework-RFCP-syllabus/edit/docusaurus/website',
40+
remarkPlugins: [remark_directive_1.default, remark_term_directive_js_1.default, [remark_code_max_line_length_js_1.default, { max: 100 }]],
41+
},
42+
blog: false,
43+
theme: {
44+
customCss: require.resolve('./src/css/custom.css'),
45+
},
46+
}),
47+
],
48+
],
49+
themeConfig:
50+
/** @type {import('@docusaurus/preset-classic').ThemeConfig} */
51+
({
52+
colorMode: {
53+
defaultMode: 'dark',
54+
disableSwitch: false,
55+
respectPrefersColorScheme: false,
56+
},
57+
navbar: {
58+
title: 'RFCP-Syllabus',
59+
logo: {
60+
alt: 'Robot Framework Logo',
61+
src: 'img/robot-framework.svg',
62+
srcDark: 'img/robot-framework-dark.svg',
63+
},
64+
items: [
65+
{
66+
label: 'Introduction',
67+
to: '/docs/overview',
68+
position: 'left',
69+
},
70+
{
71+
label: 'Chapter 1',
72+
to: '/docs/chapter-01/overview',
73+
position: 'left',
74+
},
75+
{
76+
label: 'Chapter 2',
77+
to: '/docs/chapter-02/overview',
78+
position: 'left',
79+
},
80+
{
81+
label: 'Chapter 3',
82+
to: '/docs/chapter-03/overview',
83+
position: 'left',
84+
},
85+
{
86+
label: 'Chapter 4',
87+
to: '/docs/chapter-04/overview',
88+
position: 'left',
89+
},
90+
{
91+
label: 'Chapter 5',
92+
to: '/docs/chapter-05/overview',
93+
position: 'left',
94+
},
95+
{
96+
label: 'Example Exam',
97+
to: '/docs/example-exam',
98+
position: 'left',
99+
},
100+
{
101+
label: 'LOs',
102+
to: '/docs/learning_objectives',
103+
position: 'left',
104+
},
105+
// {
106+
// href: 'https://robotframework.org/robotframework/latest/RobotFrameworkUserGuide.html',
107+
// label: 'User Guide',
108+
// position: 'right',
109+
// },
110+
// {
111+
// href: 'https://robotframework.org/robotframework/#standard-libraries',
112+
// label: 'Standard Library',
113+
// position: 'right',
114+
// },
115+
// {
116+
// href: 'https://robot-framework.readthedocs.io/en/stable/',
117+
// label: 'API Documentation',
118+
// position: 'right',
119+
// },
120+
// {
121+
// href: 'https://slack.robotframework.org/',
122+
// label: 'Slack',
123+
// position: 'right',
124+
// },
125+
// {
126+
// href: 'https://github.com/robotframework/robotframework-RFCP-syllabus',
127+
// label: 'GitHub',
128+
// position: 'right',
129+
// },
130+
],
131+
},
132+
footer: {
133+
style: 'dark',
134+
links: [
135+
// {
136+
// title: 'Docs',
137+
// items: [
138+
// {
139+
// label: 'Syllabus',
140+
// to: '/docs/overview',
141+
// },
142+
// // {
143+
// // href: 'https://robotframework.org/robotframework/latest/RobotFrameworkUserGuide.html',
144+
// // label: 'User Guide',
145+
// // },
146+
// // {
147+
// // href: 'https://robotframework.org/robotframework/#standard-libraries',
148+
// // label: 'Standard Library',
149+
// // },
150+
// // {
151+
// // href: 'https://robot-framework.readthedocs.io/en/stable/',
152+
// // label: 'API Documentation',
153+
// // },
154+
// ],
155+
// },
156+
// {
157+
// title: 'More',
158+
// items: [
159+
// {
160+
// label: 'GitHub',
161+
// href: 'https://github.com/robotframework/robotframework-RFCP-syllabus',
162+
// },
163+
// ],
164+
// },
165+
],
166+
copyright: "Copyright \u00A9 ".concat(new Date().getFullYear(), " Robot Framework\u00AE Foundation - Syllabus of Robot Framework\u00AE Certified Professional"),
167+
},
168+
prism: {
169+
theme: lightCodeTheme,
170+
darkTheme: darkCodeTheme,
171+
additionalLanguages: ['robotframework', 'python'],
172+
},
173+
}),
174+
plugins: [
175+
require.resolve('docusaurus-lunr-search')
176+
],
177+
};
178+
module.exports = config;

website/sidebars.js

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
"use strict";
2+
Object.defineProperty(exports, "__esModule", { value: true });
3+
// This runs in Node.js - Don't use client-side code here (browser APIs, JSX...)
4+
/**
5+
* Creating a sidebar enables you to:
6+
- create an ordered group of docs
7+
- render a sidebar for each doc of that group
8+
- provide next/previous navigation
9+
10+
The sidebars can be generated from the filesystem, or explicitly defined here.
11+
12+
Create as many sidebars as you want.
13+
*/
14+
var sidebars = {
15+
// By default, Docusaurus generates a sidebar from the docs folder structure
16+
tutorialSidebar: [{ type: 'autogenerated', dirName: '.' }],
17+
// But you can create a sidebar manually
18+
/*
19+
tutorialSidebar: [
20+
'intro',
21+
'hello',
22+
{
23+
type: 'category',
24+
label: 'Tutorial',
25+
items: ['tutorial-basics/create-a-document'],
26+
},
27+
],
28+
*/
29+
};
30+
exports.default = sidebars;

0 commit comments

Comments
 (0)