Skip to content

Commit e07cc8c

Browse files
committed
created new files from scratch
1 parent f1292d6 commit e07cc8c

3 files changed

Lines changed: 9 additions & 15 deletions

File tree

demo/docusaurus.config.js

Lines changed: 5 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,8 @@
22
// Note: type annotations allow type checking and IDEs autocompletion
33

44
const { DOCUSAURUS_VERSION } = require("@docusaurus/utils");
5+
const lightTheme = require("./src/utils/prismLight.js");
6+
const darkTheme = require("./src/utils/prismDark.js");
57

68
/** @type {import('@docusaurus/types').Config} */
79
const config = {
@@ -134,6 +136,8 @@ const config = {
134136
copyright: `Copyright © ${new Date().getFullYear()} Palo Alto Networks, Inc. Built with Docusaurus ${DOCUSAURUS_VERSION}.`,
135137
},
136138
prism: {
139+
theme: lightTheme,
140+
darkTheme: darkTheme,
137141
additionalLanguages: ["ruby", "csharp", "php", "java", "powershell"],
138142
},
139143
languageTabs: [
@@ -266,14 +270,4 @@ const config = {
266270
],
267271
};
268272

269-
async function createConfig() {
270-
const lightTheme = (await import("./src/utils/prismLight.mjs")).default;
271-
const darkTheme = (await import("./src/utils/prismDark.mjs")).default;
272-
// @ts-expect-error: we know it exists, right
273-
config.themeConfig.prism.theme = lightTheme;
274-
// @ts-expect-error: we know it exists, right
275-
config.themeConfig.prism.darkTheme = darkTheme;
276-
return config;
277-
}
278-
279-
module.exports = createConfig;
273+
module.exports = config;
Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,10 +5,10 @@
55
* LICENSE file in the root directory of this source tree.
66
*/
77

8-
import { themes } from "prism-react-renderer";
8+
const { themes } = require("prism-react-renderer");
99
const darkTheme = themes.vsDark;
1010

11-
export default {
11+
module.exports = {
1212
plain: {
1313
color: "#D4D4D4",
1414
backgroundColor: "#212121",
Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,10 +5,10 @@
55
* LICENSE file in the root directory of this source tree.
66
*/
77

8-
import { themes } from "prism-react-renderer";
8+
const { themes } = require("prism-react-renderer");
99
const lightTheme = themes.github;
1010

11-
export default {
11+
module.exports = {
1212
...lightTheme,
1313
styles: [
1414
...lightTheme.styles,

0 commit comments

Comments
 (0)