Skip to content

Commit 417f73f

Browse files
authored
Add support for Python syntax highlighting in code component (#333)
1 parent 0bc5c8c commit 417f73f

File tree

4 files changed

+7
-3
lines changed

4 files changed

+7
-3
lines changed

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@vectara/vectara-ui",
3-
"version": "13.10.0",
3+
"version": "13.11.0",
44
"homepage": "./",
55
"description": "Vectara's design system, codified as a React and Sass component library",
66
"author": "Vectara",

src/docs/pages/code/Languages.tsx

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,10 @@ export const sayValue = ({ value }: Config) => {
3838

3939
js: `export const sayValue = ({ value }) => {
4040
console.log(value);
41-
};`
41+
};`,
42+
43+
py: `def isThreshold(value: int, threshold: int) -> bool:
44+
return value > threshold`
4245
} as const;
4346

4447
type Language = keyof typeof languageToSampleMap;

src/lib/components/code/Code.tsx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ import "prismjs/components/prism-typescript";
1010
import "prismjs/components/prism-bash";
1111
import "prismjs/components/prism-jsx";
1212
import "prismjs/components/prism-tsx";
13+
import "prismjs/components/prism-python";
1314
import { VuiIconButton } from "../button/IconButton";
1415
import { VuiIcon } from "../icon/Icon";
1516
import { CodeLanguage } from "./types";

src/lib/components/code/types.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
export type CodeLanguage = "json" | "js" | "ts" | "jsx" | "tsx" | "bash" | "none";
1+
export type CodeLanguage = "json" | "js" | "ts" | "jsx" | "tsx" | "bash" | "py" | "none";

0 commit comments

Comments
 (0)