rmnr
DocsTourSlicesBest PracticeAgentsInstall

Command Palette

Search for a command to run...

New

Slice · AI prompt

Markdown — page container with CRUD tabs + diagrams

Markdown (.md) container: Read / Write / Review tabs, mermaid diagrams, recharts charts. Same grammar as the notion editor.

Resource detail View source
Copy this prompt into Claude / Codex / Cursor
markdown.prompt.mdmarkdown
# Install `markdown` — Markdown — page container with CRUD tabs + diagrams

> Markdown (.md) container: Read / Write / Review tabs, mermaid diagrams, recharts charts. Same grammar as the notion editor.

📚 Knowledge base : https://resource.rahmanef.com/llms.txt
📦 Slice detail   : https://resource.rahmanef.com/slices/markdown
🧠 JSON catalog   : https://resource.rahmanef.com/api/knowledge?slice=markdown
🔗 Source         : https://github.com/rahmanef63/resource-site/tree/main/frontend/slices/markdown

## 1. Install

```bash
npx rahman-resources add markdown
# alias: npx rr add markdown
```

The CLI copies `frontend/slices/markdown/` into your project + augments `.env.example` + installs npm deps automatically. Run it from your project root.

## 2. What it ships

- npm: `katex`, `mermaid`, `recharts`, `lucide-react`
- shadcn primitives: `button`, `tabs`, `textarea`

## 3. Wire it up

Run `npx rr add markdown`. Read-only: `<MarkdownReader content={md}/>`. Full surface: `<MarkdownPage content={md} tabs={['read','write','review']} onContentChange={save} comments={list} onAddComment={add} onResolveComment={resolve}/>` (omit callbacks for internal-state demo mode). Diagrams: fence ```mermaid; charts: fence ```chart with { type: bar|line|area|pie, data: [...] }. To bridge from the notion editor call `blocksToMarkdown(page.blocks)` from `@notion/shared/lib/markdown`; reverse with `markdownToBlocks(md)`.

## Rules of engagement

- shadcn-only UI primitives. No raw `<button>` / `<dialog>` / native date or file inputs.
- 200-line hard cap per source file (extract neighbours when over).
- All Convex queries hit an index (`.withIndex(...)`); never bare `.collect()`.
- Public mutations/queries declare `args:` validators + authz.
- Full ruleset: https://resource.rahmanef.com/best-practice

The agent will fetch /llms.txt for the full ruleset and use /api/knowledge for the JSON catalog.