litedown 1.0.1 → 1.0.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -8,16 +8,34 @@ A lightweight, streaming-first Markdown renderer.
8
8
  npm install litedown
9
9
  ```
10
10
 
11
- ## Usage
11
+ ### Quick Start
12
+ ```tsx
13
+ import { litedown } from 'litedown';
14
+ import 'litedown/styles.css';
15
+
16
+ function MyChat({ markdown, isStreaming }) {
17
+ return (
18
+ <litedown.Streaming
19
+ content={markdown}
20
+ isStreaming={isStreaming}
21
+ theme="glass"
22
+ />
23
+ );
24
+ }
25
+
26
+ // Or use it directly as a function
27
+ const html = litedown("# Hello World");
28
+ ```
12
29
 
30
+ ### Advanced Usage
13
31
  ```tsx
14
32
  import { render, useStreamdown } from 'litedown';
15
33
 
16
- // Streaming hook
17
- const { content, isLoading } = useStreamdown(markdownText);
34
+ // Streaming hook for custom implementations
35
+ const { html, push, finish } = useStreamdown();
18
36
 
19
- // Direct rendering
20
- const html = render(markdownText);
37
+ // Direct rendering for static content
38
+ const staticHtml = render(markdownText);
21
39
  ```
22
40
 
23
41
 
@@ -25,7 +43,7 @@ const html = render(markdownText);
25
43
 
26
44
  ```bash
27
45
  # Build the library
28
- npm run build
46
+ npm run build:lib
29
47
 
30
48
  # Check dist folder contains:
31
49
  # - index.js (ESM)