Skip to content

Commit

Permalink
Add syntax highlight for css, rust, clojure, scala, docker (#591)
Browse files Browse the repository at this point in the history
  • Loading branch information
unicodeveloper authored Oct 29, 2024
1 parent 10225c3 commit 1c31201
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 3 deletions.
19 changes: 18 additions & 1 deletion src/components/CodeBlock/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,12 @@ import php from "react-syntax-highlighter/dist/cjs/languages/prism/php";
import java from "react-syntax-highlighter/dist/cjs/languages/prism/java";
import elixir from "react-syntax-highlighter/dist/cjs/languages/prism/elixir";
import python from "react-syntax-highlighter/dist/cjs/languages/prism/python";
import rust from "react-syntax-highlighter/dist/cjs/languages/prism/rust";
import clojure from "react-syntax-highlighter/dist/cjs/languages/prism/clojure";
import scala from "react-syntax-highlighter/dist/cjs/languages/prism/scala";
import css from "react-syntax-highlighter/dist/cjs/languages/prism/css";
import docker from "react-syntax-highlighter/dist/cjs/languages/prism/docker";


import "twin.macro";
import { useCopy } from "../../hooks/useCopy";
Expand All @@ -35,6 +41,12 @@ SyntaxHighlighter.registerLanguage("php", php);
SyntaxHighlighter.registerLanguage("java", java);
SyntaxHighlighter.registerLanguage("elixir", elixir);
SyntaxHighlighter.registerLanguage("python", python);
SyntaxHighlighter.registerLanguage("rust", rust);
SyntaxHighlighter.registerLanguage("clojure", clojure);
SyntaxHighlighter.registerLanguage("scala", scala);
SyntaxHighlighter.registerLanguage("css", css);
SyntaxHighlighter.registerLanguage("docker", docker);


export type SupportedLanguage =
| "javascript"
Expand All @@ -48,7 +60,12 @@ export type SupportedLanguage =
| "php"
| "java"
| "elixir"
| "python";
| "python"
| "rust"
| "clojure"
| "scala"
| "css"
| "docker";

export interface Props {
language?: string;
Expand Down
2 changes: 1 addition & 1 deletion src/docs/guides/axum.md
Original file line number Diff line number Diff line change
Expand Up @@ -165,7 +165,7 @@ To deploy an Axum app to Railway directly from GitHub, follow the steps below:
1. Create a `Dockerfile` in the `helloworld` or Axum app's root directory.
2. Add the content below to the `Dockerfile`:
```bash
```docker
FROM lukemathwalker/cargo-chef:latest-rust-1 AS chef
# Create and change to the app directory.
Expand Down
2 changes: 1 addition & 1 deletion src/docs/guides/rocket.md
Original file line number Diff line number Diff line change
Expand Up @@ -156,7 +156,7 @@ To deploy a Rocket app to Railway directly from GitHub, follow the steps below:

1. Create a `Dockerfile` in the `helloworld` or Rocket app's root directory.
2. Add the content below to the `Dockerfile`:
```bash
```docker
FROM lukemathwalker/cargo-chef:latest-rust-1 AS chef
# Create and change to the app directory.
Expand Down

0 comments on commit 1c31201

Please sign in to comment.