Skip to content

Add Cairo syntax highlighting #347

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 18 additions & 0 deletions next.config.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,24 @@
const { BUNDLED_LANGUAGES, getHighlighter } = require("shiki");

const withNextra = require("nextra")({
theme: "nextra-theme-docs",
themeConfig: "./theme.config.tsx",
mdxOptions: {
rehypePrettyCodeOptions: {
getHighlighter: (options) =>
getHighlighter({
...options,
langs: [
...BUNDLED_LANGUAGES,
{
id: "cairo",
scopeName: "source.cairo",
path: "../../public/syntax/cairo.json",
},
],
}),
},
},
});

// Use this array as a shorter way to specify redirect URLs so we can write down a lot of them.
Expand Down
2 changes: 1 addition & 1 deletion pages/price-feeds/use-real-time-data/starknet.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ Pyth also provides a javascript SDK to interact with the Pyth contract on Starkn

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

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

Expand Down
Loading
Loading