kotii-markdown-render 1.0.0-beta.1.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 +85 -0
- package/dist/index.cjs +667 -0
- package/dist/index.mjs +623 -0
- package/index.js +2 -0
- package/package.json +63 -0
- package/src/components/MarkdownAd/index.jsx +12 -0
- package/src/components/MarkdownDemo/index.jsx +7 -0
- package/src/components/MarkdownElement/index.jsx +24 -0
- package/src/components/MarkdownHeader/index.jsx +110 -0
- package/src/components/MarkdownRender/index.jsx +186 -0
- package/src/components/MarkdownSidebar/index.jsx +27 -0
- package/src/components/MarkdownTOC/index.jsx +98 -0
- package/src/components/MarkdownVideo/index.jsx +15 -0
- package/src/components/StandardComponent/index.jsx +18 -0
- package/src/components/StyledMarkdown/index.jsx +189 -0
- package/src/components/index.js +2 -0
- package/src/index.js +2 -0
package/README.md
ADDED
|
@@ -0,0 +1,85 @@
|
|
|
1
|
+
<p align="center">
|
|
2
|
+
<a href="#" style="
|
|
3
|
+
display: inline-flex;
|
|
4
|
+
flex-direction: column;
|
|
5
|
+
align-items: center;
|
|
6
|
+
text-decoration: none;
|
|
7
|
+
color: inherit;
|
|
8
|
+
">
|
|
9
|
+
<img src="https://raw.githubusercontent.com/ntsakosurprise/kotii/refs/heads/develop/kotii.svg" alt="kotii logo">
|
|
10
|
+
<strong>Kotii-React-Render</strong>
|
|
11
|
+
</a>
|
|
12
|
+
</p>
|
|
13
|
+
|
|
14
|
+
### The React Renderer for Kotii's Markdown Pipeline
|
|
15
|
+
|
|
16
|
+
**kotii-react-render** is the **React renderer** used by Kotii after Markdown is parsed, transformed, and converted into a hybrid structure of:
|
|
17
|
+
|
|
18
|
+
- raw HTML chunks
|
|
19
|
+
- embedded component declarations
|
|
20
|
+
- localized content entries
|
|
21
|
+
- metadata and table of contents
|
|
22
|
+
|
|
23
|
+
This renderer turns processed markdown output from `kotii-markdown-render` into a fully interactive React view, supporting:
|
|
24
|
+
|
|
25
|
+
- š§© **Custom embedded components via Markdown**
|
|
26
|
+
- š **Language-based content selection**
|
|
27
|
+
- š„ **Embedded video blocks**
|
|
28
|
+
- š¢ **Ad blocks**
|
|
29
|
+
- š§± **Standard React components in markdown**
|
|
30
|
+
- ā” **Server and client-safe rendering**
|
|
31
|
+
|
|
32
|
+
---
|
|
33
|
+
|
|
34
|
+
# š§ How It Works
|
|
35
|
+
|
|
36
|
+
Kotiiās markdown engine outputs a hybrid array:
|
|
37
|
+
|
|
38
|
+
```ts
|
|
39
|
+
html: Array<string | MarkdownComponentNode>;
|
|
40
|
+
```
|
|
41
|
+
|
|
42
|
+
Where:
|
|
43
|
+
|
|
44
|
+
- `string` ā raw HTML
|
|
45
|
+
- `MarkdownComponentNode` ā `{ component: "componentID" }` or `{ video: "id" }` etc.
|
|
46
|
+
|
|
47
|
+
`MarkdownRender` maps over this array and decides:
|
|
48
|
+
|
|
49
|
+
1. If itās **raw HTML** ā render as `<MarkdownElement>`
|
|
50
|
+
2. If itās a **component node** ā inject the correct React component
|
|
51
|
+
3. If **multilingual** ā choose the correct language content
|
|
52
|
+
|
|
53
|
+
# Questions & Support
|
|
54
|
+
|
|
55
|
+
For questions and support please useĀ kotii-routerjs's Suppport page on [Github repo](https://github.com/ntsakosurprise/kotii-router/development/SUPPORT.md).
|
|
56
|
+
|
|
57
|
+
# Issues
|
|
58
|
+
|
|
59
|
+
Please make sure to read theĀ [Issue](https://github.com/ntsakosurprise/kotii-router/development/ISSUES.md) Reporting ChecklistĀ before opening an issue. Issues not conforming to the guidelines may be closed immediately.
|
|
60
|
+
|
|
61
|
+
# Changelog
|
|
62
|
+
|
|
63
|
+
Detailed changes for each release are documented in our [Changelog](https://github.com/ntsakosurprise/kotii-router/development//CHANGELOG.md).
|
|
64
|
+
|
|
65
|
+
# Release Notes
|
|
66
|
+
|
|
67
|
+
A summary of release changes can be found in our [Release Notes](https://github.com/ntsakosurprise/kotii-router/development//RELEASE_NOTES.md).
|
|
68
|
+
|
|
69
|
+
# Stay In Touch
|
|
70
|
+
|
|
71
|
+
[Twitter @ntsakosurprise](https://twitter.com/ntsakosurprise).
|
|
72
|
+
|
|
73
|
+
# Contribution
|
|
74
|
+
|
|
75
|
+
Please make sure to read theĀ [Contributing Guide](https://github.com/ntsakosurprise/kotii-router/development/CONTRIBUTING.md)Ā before making a pull request. If you have an kotii-router plugin, add it with a pull request.
|
|
76
|
+
|
|
77
|
+
# Licence
|
|
78
|
+
|
|
79
|
+
[MIT](https://.github.com/) - see the [LICENSE](https://github.com/ntsakosurprise/kotii-router/development/LICENSE.md) file for details.
|
|
80
|
+
|
|
81
|
+
Ā© Kotii Ecosystem 2025-present. Ntsako (Surprise) Mashele
|
|
82
|
+
|
|
83
|
+
```
|
|
84
|
+
|
|
85
|
+
```
|