-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
website: Add basic syntax highlighting
- Loading branch information
Showing
7 changed files
with
116 additions
and
72 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
{ | ||
"name": "website", | ||
"nx": { | ||
"$schema": "../../node_modules/nx/schemas/project-schema.json", | ||
"projectType": "application", | ||
"sourceRoot": "pkg/website/src", | ||
"targets": { | ||
"build": { | ||
"executor": "@nx-extend/docusaurus:browser", | ||
"options": { | ||
"outputPath": "dist/pkg/website" | ||
} | ||
}, | ||
"serve": { | ||
"executor": "@nx-extend/docusaurus:dev-server", | ||
"options": { | ||
"port": 3000 | ||
} | ||
}, | ||
"deploy": { | ||
"dependsOn": [ | ||
"build" | ||
], | ||
"executor": "nx:run-commands", | ||
"options": { | ||
"command": "go run pkg/website/cmd/main.go", | ||
"cwd": "{workspaceRoot}" | ||
} | ||
} | ||
}, | ||
"tags": [] | ||
} | ||
} |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
Prism.languages.fysh = { | ||
comment: [ | ||
{ | ||
pattern: /><\/\*>[\s\S]*?<\*\/></, | ||
greedy: true, | ||
}, | ||
{ | ||
pattern: /><\/\/>.*$/m, | ||
greedy: true, | ||
}, | ||
], | ||
string: [ | ||
{ | ||
pattern: /\*[^*]*\*/, | ||
greedy: true, | ||
}, | ||
{ | ||
pattern: /🫧[^🫧]*🫧/, | ||
greedy: true, | ||
alias: 'special', | ||
}, | ||
], | ||
keyword: [ | ||
{ | ||
pattern: /><\(*[*^@]>/, | ||
greedy: true, | ||
}, | ||
{ | ||
pattern: /><\\\/>|<\\\/></, | ||
alias: 'control-flow', | ||
}, | ||
], | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
import siteConfig from '@generated/docusaurus.config'; | ||
import type * as PrismNamespace from 'prismjs'; | ||
import type {Optional} from 'utility-types'; | ||
|
||
export default function prismIncludeLanguages( | ||
PrismObject: typeof PrismNamespace, | ||
): void { | ||
const { | ||
themeConfig: {prism}, | ||
} = siteConfig; | ||
const {additionalLanguages} = prism as {additionalLanguages: string[]}; | ||
|
||
// Prism components work on the Prism instance on the window, while prism- | ||
// react-renderer uses its own Prism instance. We temporarily mount the | ||
// instance onto window, import components to enhance it, then remove it to | ||
// avoid polluting global namespace. | ||
// You can mutate PrismObject: registering plugins, deleting languages... As | ||
// long as you don't re-assign it | ||
globalThis.Prism = PrismObject; | ||
|
||
additionalLanguages.forEach((lang) => { | ||
if (lang === 'php') { | ||
// eslint-disable-next-line global-require | ||
require('prismjs/components/prism-markup-templating.js'); | ||
} | ||
// eslint-disable-next-line global-require, import/no-dynamic-require | ||
require(`prismjs/components/prism-${lang}`); | ||
}); | ||
|
||
require('./prism-fysh'); | ||
|
||
delete (globalThis as Optional<typeof globalThis, 'Prism'>).Prism; | ||
} |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.