summaryrefslogtreecommitdiffhomepage
path: root/packages/docs/essentials/code.mdx
diff options
context:
space:
mode:
authorDax Raad <[email protected]>2025-12-05 16:41:35 -0500
committerDax Raad <[email protected]>2025-12-05 16:41:35 -0500
commit328188816008fde10165597f432dac4c5d1016cd (patch)
treee3230708f379c7e3451efc46e5d1c1ab66a26e20 /packages/docs/essentials/code.mdx
parentc6d0ae892efcbd18652ff413ec3378099d31bc91 (diff)
downloadopencode-328188816008fde10165597f432dac4c5d1016cd.tar.gz
opencode-328188816008fde10165597f432dac4c5d1016cd.zip
ignore: docs test
Diffstat (limited to 'packages/docs/essentials/code.mdx')
-rw-r--r--packages/docs/essentials/code.mdx35
1 files changed, 35 insertions, 0 deletions
diff --git a/packages/docs/essentials/code.mdx b/packages/docs/essentials/code.mdx
new file mode 100644
index 000000000..ae2abbfec
--- /dev/null
+++ b/packages/docs/essentials/code.mdx
@@ -0,0 +1,35 @@
+---
+title: 'Code blocks'
+description: 'Display inline code and code blocks'
+icon: 'code'
+---
+
+## Inline code
+
+To denote a `word` or `phrase` as code, enclose it in backticks (`).
+
+```
+To denote a `word` or `phrase` as code, enclose it in backticks (`).
+```
+
+## Code blocks
+
+Use [fenced code blocks](https://www.markdownguide.org/extended-syntax/#fenced-code-blocks) by enclosing code in three backticks and follow the leading ticks with the programming language of your snippet to get syntax highlighting. Optionally, you can also write the name of your code after the programming language.
+
+```java HelloWorld.java
+class HelloWorld {
+ public static void main(String[] args) {
+ System.out.println("Hello, World!");
+ }
+}
+```
+
+````md
+```java HelloWorld.java
+class HelloWorld {
+ public static void main(String[] args) {
+ System.out.println("Hello, World!");
+ }
+}
+```
+````