Code
Code with a toolbar — code-enhance
Line numbers, a filename bar, line highlighting, and a copy button.
Source
```ts title="hello.ts"
export function hello(name: string): string {
return `Hello, ${name}`;
}
```
Rendered
export function hello(name: string): string {
return `Hello, ${name}`;
}
Code tabs — code-tabs
Adjacent code fences with tab="..." become a single tab group.
Source
```ts tab="React"
const greeting = "Hello from React";
```
```js tab="Vanilla"
console.log("Hello from JavaScript");
```
Rendered
const greeting = "Hello from React";console.log("Hello from JavaScript");Code annotations — code-annotations
Use a diff fence with the target language to render additions and removals.
Source
```diff js
const kept = true;
+ const added = "new line";
- const removed = false;
```
Rendered
const kept = true;
const added = "new line";
const removed = false;
Source files — source-files
Publish selected text files as pages, embed the full file, or embed a line range.
Source
[[source-file-example.ts]]
![[source-file-example.ts]]
![[source-file-example.ts#L3-L5]]
Rendered
export const greeting = "Hello from a source file";
export function greet(name: string): string {
return `${greeting}, ${name}!`;
}
export function greet(name: string): string {
return `${greeting}, ${name}!`;
}
Powered by Riebeckite