@schmitech/markdown-renderer 0.1.5 → 0.2.0
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 +8 -2
- package/dist/MarkdownStyles.css +1 -1
- package/dist/index.d.ts +2 -0
- package/dist/markdown-renderer.es.js +6311 -6303
- package/dist/markdown-renderer.es.js.map +1 -1
- package/dist/markdown-renderer.umd.js +61 -61
- package/dist/markdown-renderer.umd.js.map +1 -1
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -22,8 +22,10 @@ npm install @schmitech/markdown-renderer
|
|
|
22
22
|
### React setup
|
|
23
23
|
|
|
24
24
|
In React applications (Vite, CRA, Next.js, etc.) simply import the component. The
|
|
25
|
-
library
|
|
26
|
-
|
|
25
|
+
library injects its base `.markdown-content` styles automatically when it first
|
|
26
|
+
loads. If your setup performs server-side rendering or you need manual control,
|
|
27
|
+
you can call the exported `ensureStylesInjected()` helper explicitly. Consumers
|
|
28
|
+
who prefer to handle CSS separately can still import
|
|
27
29
|
`import '@schmitech/markdown-renderer/styles';`.
|
|
28
30
|
|
|
29
31
|
### Basic Usage
|
|
@@ -102,6 +104,10 @@ Or reference the built CSS directly from your own stylesheets:
|
|
|
102
104
|
@import '@schmitech/markdown-renderer/dist/MarkdownStyles.css';
|
|
103
105
|
```
|
|
104
106
|
|
|
107
|
+
If you are rendering on the server (Next.js, Remix, etc.) you may want to call
|
|
108
|
+
`ensureStylesInjected()` in a `useEffect` on the client to guarantee the base
|
|
109
|
+
stylesheet is present.
|
|
110
|
+
|
|
105
111
|
To customize the look, add your own selectors that target the generated
|
|
106
112
|
`markdown-content` wrapper:
|
|
107
113
|
|