mirror of
https://gitlab.com/soapbox-pub/mkstack.git
synced 2026-12-05 16:33:36 +00:00
Add note-content skill for rich text rendering of Nostr notes
Moves src/components/NoteContent.tsx and its test file into a new note-content skill at .agents/skills/note-content/. The component linkifies URLs, hashtags, and Nostr URIs (npub/nprofile/note/nevent) inside plaintext event content, and was previously imported only by the comments and DM stacks that have already been extracted/removed. Also removes the 'Rendering Rich Text Content' section from AGENTS.md since NoteContent is no longer part of the default template surface. The new SKILL.md documents the expected /:nip19 and /t/:hashtag routes and the existing template hooks it relies on (useAuthor, genUserName).
This commit is contained in:
4 files changed
+98
-20
No files matched your search
@@ -846,26 +846,6 @@ const encrypted = await user.signer.nip44.encrypt(user.pubkey, "hello world");
|
||||
const decrypted = await user.signer.nip44.decrypt(user.pubkey, encrypted) // "hello world"
|
||||
```
|
||||
|
||||
### Rendering Rich Text Content
|
||||
|
||||
Nostr text notes (kind 1, 11, and 1111) have a plaintext `content` field that may contain URLs, hashtags, and Nostr URIs. These events should render their content using the `NoteContent` component:
|
||||
|
||||
```tsx
|
||||
import { NoteContent } from "@/components/NoteContent";
|
||||
|
||||
export function Post(/* ...props */) {
|
||||
// ...
|
||||
|
||||
return (
|
||||
<CardContent className="pb-2">
|
||||
<div className="whitespace-pre-wrap break-words">
|
||||
<NoteContent event={post} className="text-sm" />
|
||||
</div>
|
||||
</CardContent>
|
||||
);
|
||||
}
|
||||
```
|
||||
|
||||
## App Configuration
|
||||
|
||||
The project includes an `AppProvider` that manages global application state including theme and NIP-65 relay configuration. The default configuration includes:
|
||||
|
||||
Reference in new issue
Block a user