diff --git a/code.mdx b/code.mdx index 474cad17..13d7c35e 100644 --- a/code.mdx +++ b/code.mdx @@ -8,6 +8,10 @@ icon: "code" You can add inline code snippets or code blocks. Code blocks support meta options for syntax highlighting, titles, line highlighting, icons, and more. + + This is acallout + + ### Inline code To denote a `word` or `phrase` as code, enclose it in backticks (\`). @@ -22,7 +26,7 @@ Use [fenced code blocks](https://www.markdownguide.org/extended-syntax/#fenced-c Specify the programming language for syntax highlighting and to enable meta options. Add any meta options, like a title or icon, after the language. -```java HelloWorld.java lines icon="java" +```java HelloWorld.java icon=java lines class HelloWorld { public static void main(String[] args) { System.out.println("Hello, World!"); @@ -95,7 +99,7 @@ const hello = "world"; Add an icon to your code block. You can use [FontAwesome](https://fontawesome.com/icons) icons, [Lucide](https://lucide.dev/icons/) icons, or absolute URLs. -```javascript icon="square-js" +```javascript icon=square-js const hello = "world"; ``` @@ -109,7 +113,7 @@ const hello = "world"; Highlight specific lines in your code blocks using `highlight` with the line numbers or ranges you want to highlight. -```javascript Line Highlighting Example highlight= {1-2,5} +```javascript Line Highlighting Example {1,2,5} const greeting = "Hello, World!"; function sayHello() { console.log(greeting); @@ -131,7 +135,7 @@ sayHello(); Focus on specific lines in your code blocks using `focus` with line numbers or ranges. -```javascript Line Focus Example focus= {2,4-5} +```javascript Line Focus Example focus=2,4,5 const greeting = "Hello, World!"; function sayHello() { console.log(greeting); @@ -304,7 +308,7 @@ sayHello(); Add single line comments with `[!code ++]` and `[!code --]` to mark added and removed lines. You can also mark multiple lines with a single comment, such as `[!code ++:3]` or `[!code --:5]`. -```js Diff Example icon="code" lines +```js Diff Example icon=code lines const greeting = "Hello, World!"; // [!code ++] function sayHello() { console.log("Hello, World!"); // [!code --]