Skip to content

Commit 90dfaeb

Browse files
docs: add prerequisites, native format note, and improve installation guide (#13)
1 parent 0a9de29 commit 90dfaeb

1 file changed

Lines changed: 11 additions & 2 deletions

File tree

README.md

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,12 @@ Syntax highlighting for [EmDash CMS](https://emdashcms.com) using [Highlight.js]
1616
- **CSS caching** — Theme CSS read once and cached in memory
1717
- **Server-side highlighting** — No client JS cost for syntax highlighting
1818

19+
## Prerequisites
20+
21+
- EmDash CMS `^0.12.0`
22+
- Your base layout must include `<EmDashHead />` and `<EmDashBodyEnd />` — the plugin injects theme CSS and copy button scripts via these hooks.
23+
- This plugin uses the **native format** and must be placed in `plugins: []` (not `sandboxed: []`).
24+
1925
## Installation
2026

2127
```bash
@@ -28,17 +34,20 @@ Register the plugin in `astro.config.mjs`:
2834

2935
```ts
3036
import { highlightjsPlugin } from "emdash-plugin-highlightjs";
37+
import emdash from "emdash/astro";
38+
import { defineConfig } from "astro/config";
3139

3240
export default defineConfig({
3341
integrations: [
3442
emdash({
35-
plugins: [highlightjsPlugin()],
43+
plugins: [highlightjsPlugin()], // native format — only works in plugins: []
44+
// database and storage remain unchanged
3645
}),
3746
],
3847
});
3948
```
4049

41-
CSS and copy button are injected automatically on all public pages. `Code.astro` renders automatically for `code` blocks in Portable Text content.
50+
Theme CSS and the copy button are injected automatically on all public pages. The `Code.astro` component renders `code` blocks in Portable Text content — make sure `code` is a registered block type in your Portable Text schema configuration.
4251

4352
## How It Works
4453

0 commit comments

Comments
 (0)