Skip to content
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

feat: cairo syntax hl #249

Merged
merged 1 commit into from
Oct 23, 2024
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
4 changes: 2 additions & 2 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -200,7 +200,7 @@ c
Then, in the markdown file, you can use the following syntax to include only the code between the delimiting comments:

````markdown
````rust
````cairo
{{#include ../../listings/path/to/listing/src/contract.cairo:anchor_name}}
\```
````
Expand All @@ -215,7 +215,7 @@ b
Using `#rustdoc_include` you can have the same result, but users can expand the code in the book to see the whole file (used for showing tests):

````markdown
````rust
````cairo
{{#rustdoc_include ../../listings/path/to/listing/src/contract.cairo:anchor_name}}
\```
````
Expand Down
8 changes: 7 additions & 1 deletion book.toml
Original file line number Diff line number Diff line change
Expand Up @@ -8,13 +8,19 @@ title = "Starknet by Example"
[build]
extra-watch-dirs = ["listings", "po"]

[preprocessor.gettext]
[preprocessor.cairo]
after = ["links"]

[preprocessor.gettext]
after = ["cairo"]

[preprocessor.last-changed]
command = "mdbook-last-changed"
renderer = ["html"]

[output.html.code.hidelines]
cairo = "# "

[output.html]
git-repository-url = "https://github.com/NethermindEth/StarknetByExample"
edit-url-template = "https://github.com/NethermindEth/StarknetByExample/edit/main/{path}"
Expand Down
Loading