Update docs
This commit is contained in:
@@ -11,6 +11,7 @@ Defines all supported content types:
|
||||
- `Cashu` - Cashu token strings
|
||||
- `Code` - Code blocks and inline code
|
||||
- `Ellipsis` - Truncation indicators
|
||||
- `Email` - Email addresses
|
||||
- `Emoji` - Custom emoji references
|
||||
- `Event` - Event references (note/nevent)
|
||||
- `Invoice` - Lightning invoices
|
||||
@@ -57,13 +58,12 @@ reduceLinks(content: Parsed[]) => Parsed[]
|
||||
## Type Guards
|
||||
|
||||
Utility functions to check parsed element types:
|
||||
- `isAddress(parsed)`, `isCashu(parsed)`, `isCode(parsed)`, etc.
|
||||
- `isAddress(parsed)`, `isCashu(parsed)`, `isCode(parsed)`, `isEmail(parsed)`, etc.
|
||||
- `isImage(parsed)` - special check for image links
|
||||
|
||||
## Utilities
|
||||
|
||||
- `urlIsMedia(url)` - Checks if URL points to media file
|
||||
- `fromNostrURI(s)` - Removes nostr: protocol prefix
|
||||
|
||||
## Example Usage
|
||||
|
||||
|
||||
@@ -25,8 +25,8 @@ type RenderOptions = {
|
||||
|
||||
## Built-in Renderers
|
||||
|
||||
- `makeTextRenderer` - renders an array of `Parsed` elements as text
|
||||
- `makeHtmlRenderer` - renders an array of `Parsed` elements as HTML
|
||||
- `makeTextRenderer` - creates a `Renderer` configured for plain-text output
|
||||
- `makeHtmlRenderer` - creates a `Renderer` configured for HTML output
|
||||
|
||||
## Main Functions
|
||||
|
||||
@@ -54,7 +54,7 @@ const html = renderAsHtml(parsed, {
|
||||
}).toString()
|
||||
|
||||
// Result:
|
||||
// Check out this cool #nostr client!<br>
|
||||
// Visit <a href="https://njump.me/nprofile1...">npub1jlrs53p...</a> for more info<br>
|
||||
// Check out this cool #nostr client!
|
||||
// Visit <a href="https://njump.me/nprofile1...">npub1jlrs53p...</a> for more info
|
||||
// <a href="https://github.com/coracle-social/welshman" class="custom-link">github.com/coracle-social/welshman</a>
|
||||
```
|
||||
|
||||
Reference in New Issue
Block a user