Skip to content

Commit a767b14

Browse files
authored
Add Cairo syntax highlighting (#347)
1 parent 470ff31 commit a767b14

File tree

3 files changed

+1172
-1
lines changed

3 files changed

+1172
-1
lines changed

next.config.js

+18
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,24 @@
1+
const { BUNDLED_LANGUAGES, getHighlighter } = require("shiki");
2+
13
const withNextra = require("nextra")({
24
theme: "nextra-theme-docs",
35
themeConfig: "./theme.config.tsx",
6+
mdxOptions: {
7+
rehypePrettyCodeOptions: {
8+
getHighlighter: (options) =>
9+
getHighlighter({
10+
...options,
11+
langs: [
12+
...BUNDLED_LANGUAGES,
13+
{
14+
id: "cairo",
15+
scopeName: "source.cairo",
16+
path: "../../public/syntax/cairo.json",
17+
},
18+
],
19+
}),
20+
},
21+
},
422
});
523

624
// Use this array as a shorter way to specify redirect URLs so we can write down a lot of them.

pages/price-feeds/use-real-time-data/starknet.mdx

+1-1
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ Pyth also provides a javascript SDK to interact with the Pyth contract on Starkn
3636

3737
The code snippet below provides an example module fetching the STRK/USD price from Pyth price feeds:
3838

39-
```rust {2,17,47,55,64,71-73} copy
39+
```cairo {2,17,47,55,64,71-73} copy
4040
use starknet::ContractAddress;
4141
use pyth::ByteBuffer;
4242

0 commit comments

Comments
 (0)