For AI agents: the complete site index is available at https://www.juniortree.com/llms.txt, and this page is available as Markdown at https://www.juniortree.com/docs/integrations/code.md.
JuniorTree

Back

Shiki Code

Some methods for better using shiki code

Basic Usage#

For .astro file:

---
import { Code } from 'astro:components'
---

<Code lang='shell' code={`git log --oneline`} />
astro

For .mdx and .md file:

```shell
git log --oneline
```
markdown

Add Title#

start.sh
#!/bin/bash

bun check &
bun dev
shell
```shell title="start.sh"
#!/bin/bash

bun check &
bun dev
```
markdown

Show Diff#

Supports add and del lines.

deploy.sh
#!/bin/bash

bun check
bun lint
bun format
# No need for vercel or other ci/cd
bun run build
git push
shell
<!-- You need to delete `\` during the use -->

```shell title="deploy.sh"
#!/bin/bash

bun check
bun lint
bun format # [\!code ++]
# No need for vercel or other ci/cd
bun run build # [\!code --]
git push
```
markdown

Show Highlight#