@foblex/m-render 2.6.4 โ 2.6.5
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/LICENSE +3 -0
- package/README.md +164 -19
- package/assets/styles/_code-group.scss +4 -0
- package/assets/styles/_code-highlight.scss +4 -0
- package/assets/styles/_table.scss +51 -0
- package/assets/styles/styles.scss +1 -0
- package/fesm2022/foblex-m-render.mjs +112 -182
- package/fesm2022/foblex-m-render.mjs.map +1 -1
- package/lib/documentation-page/components/markdown-container/f-markdown/highlight/highlight.service.d.ts +5 -6
- package/lib/documentation-page/components/markdown-container/f-markdown/highlight/index.d.ts +0 -2
- package/lib/documentation-page/components/markdown-container/f-markdown/highlight/mark-code-focused-blocks.post-processor.d.ts +0 -2
- package/lib/documentation-page/components/markdown-container/f-markdown/markdown/index.d.ts +1 -1
- package/lib/documentation-page/components/markdown-container/f-markdown/markdown/parse-angular-example-with-code-links.d.ts +2 -8
- package/lib/documentation-page/components/markdown-container/f-markdown/markdown/parse-grouped-code-items.d.ts +0 -1
- package/lib/documentation-page/components/markdown-container/f-markdown/markdown/parse-preview-group.d.ts +0 -2
- package/lib/documentation-page/components/markdown-container/f-markdown/markdown/parse-single-code-item.d.ts +0 -1
- package/lib/documentation-page/components/markdown-container/f-markdown/markdown/utils.d.ts +10 -0
- package/package.json +1 -1
- package/lib/documentation-page/components/markdown-container/f-markdown/highlight/change-code-focused-syntax.pre-processor.d.ts +0 -7
- package/lib/documentation-page/components/markdown-container/f-markdown/highlight/modify-punctuation-highlight.post-processor.d.ts +0 -6
- package/lib/documentation-page/components/markdown-container/f-markdown/markdown/utils/get-content.d.ts +0 -2
- package/lib/documentation-page/components/markdown-container/f-markdown/markdown/utils/index.d.ts +0 -1
package/LICENSE
CHANGED
@@ -19,3 +19,6 @@ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
19
|
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
20
20
|
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
21
21
|
SOFTWARE.
|
22
|
+
|
23
|
+
Parts of the design and layout of this project were inspired by VitePress (MIT License).
|
24
|
+
Copyright (c) 2019-present, Yuxi (Evan) You
|
package/README.md
CHANGED
@@ -1,33 +1,178 @@
|
|
1
|
-
|
1
|
+
# MRender: Markdown Renderer for Angular
|
2
2
|
|
3
|
-
**MRender** is
|
3
|
+
**MRender** is an Angular library for rendering Markdown-based documentation with SSR support, built-in Angular components, customizable UI, and extended syntax.
|
4
4
|
|
5
|
-
|
5
|
+
---
|
6
6
|
|
7
|
-
|
7
|
+
## ๐ Features
|
8
8
|
|
9
|
-
|
9
|
+
* Render `.md` files in Angular apps
|
10
|
+
* Extended syntax: `ng-component`, `code-group`, `preview-group`, alert blocks (`tip`, `info`, `danger`, etc.)
|
11
|
+
* Fully SSR-compatible
|
12
|
+
* Embed Angular components inside markdown
|
13
|
+
* Provider-based configuration for homepage and documentation
|
14
|
+
* Lazy loading of examples
|
15
|
+
* Built-in Table of Contents, SEO and meta support
|
10
16
|
|
11
|
-
|
17
|
+
---
|
12
18
|
|
13
|
-
|
14
|
-
2. **Custom Syntax Extensions:** Use enhanced Markdown syntax for advanced features and interactivity.
|
15
|
-
3. **Angular Component Integration:** Extend Markdown with embedded Angular components and code examples.
|
16
|
-
4. **SPA and SSR Support:** Generate applications in both Single Page Application (SPA) and Server-Side Rendering (SSR) formats.
|
17
|
-
5. **Built-in Themes:** Choose from pre-designed themes for consistent and appealing documentation.
|
19
|
+
## ๐ฆ Installation
|
18
20
|
|
19
|
-
|
21
|
+
```bash
|
22
|
+
npm install @foblex/m-render
|
23
|
+
```
|
20
24
|
|
21
|
-
|
25
|
+
---
|
22
26
|
|
23
|
-
|
27
|
+
## ๐งฉ Usage
|
24
28
|
|
25
|
-
|
29
|
+
### Homepage Configuration
|
26
30
|
|
27
|
-
```
|
28
|
-
|
31
|
+
```ts
|
32
|
+
import {
|
33
|
+
provideBackground, provideComponents,
|
34
|
+
provideHero, provideHomeButtons, provideHomeFeatures,
|
35
|
+
provideHomeFooter, provideImage, provideLogo, provideTitle
|
36
|
+
} from '@foblex/m-render';
|
37
|
+
|
38
|
+
export const HOME_CONFIGURATION = {
|
39
|
+
providers: [
|
40
|
+
provideLogo('./logo.svg'),
|
41
|
+
provideTitle('Foblex Flow'),
|
42
|
+
provideHero({
|
43
|
+
headline: 'Foblex Flow',
|
44
|
+
tagline1: 'Built with Angular',
|
45
|
+
tagline2: 'Flow-Chart Library',
|
46
|
+
subDescription: 'Supports Angular 12+, SSR, and Composition API.',
|
47
|
+
}),
|
48
|
+
provideBackground(HomePageBackgroundComponent),
|
49
|
+
provideImage(HomePageImageComponent),
|
50
|
+
provideHomeButtons([...]),
|
51
|
+
provideHomeFeatures([...]),
|
52
|
+
provideHomeFooter({ text: 'MIT License | Copyright ยฉ 2022 - Present' }),
|
53
|
+
],
|
54
|
+
};
|
55
|
+
```
|
56
|
+
|
57
|
+
### Documentation Configuration
|
58
|
+
|
59
|
+
```ts
|
60
|
+
import {
|
61
|
+
provideDirectory, provideNavigation, provideComponents,
|
62
|
+
provideTocData, provideHeader, provideFooterNavigation,
|
63
|
+
provideDocumentationMeta
|
64
|
+
} from '@foblex/m-render';
|
65
|
+
|
66
|
+
export const DOCUMENTATION_CONFIGURATION = {
|
67
|
+
providers: [
|
68
|
+
provideDirectory('./markdown/guides/'),
|
69
|
+
provideNavigation(...),
|
70
|
+
provideComponents([...]),
|
71
|
+
provideTocData({ title: 'In this article', range: { start: 2, end: 6 } }),
|
72
|
+
provideHeader(...),
|
73
|
+
provideFooterNavigation(...),
|
74
|
+
provideDocumentationMeta({ ... }),
|
75
|
+
],
|
76
|
+
};
|
77
|
+
```
|
78
|
+
|
79
|
+
### Route Setup
|
80
|
+
|
81
|
+
```ts
|
82
|
+
import { provideDocumentation, provideHomePage } from '@foblex/m-render';
|
83
|
+
|
84
|
+
export const routes: Routes = [
|
85
|
+
{
|
86
|
+
path: '',
|
87
|
+
loadChildren: () => import('@foblex/m-render').then((m) =>
|
88
|
+
m.HOME_ROUTES.map((route) => ({
|
89
|
+
...route,
|
90
|
+
providers: [provideHomePage(HOME_CONFIGURATION)],
|
91
|
+
}))
|
92
|
+
),
|
93
|
+
},
|
94
|
+
{
|
95
|
+
path: 'docs',
|
96
|
+
loadChildren: () => import('@foblex/m-render').then((m) =>
|
97
|
+
m.DOCUMENTATION_ROUTES.map((route) => ({
|
98
|
+
...route,
|
99
|
+
providers: [provideDocumentation(DOCUMENTATION_CONFIGURATION)],
|
100
|
+
}))
|
101
|
+
),
|
102
|
+
},
|
103
|
+
];
|
104
|
+
```
|
105
|
+
|
106
|
+
---
|
107
|
+
|
108
|
+
## โจ Markdown Extensions
|
109
|
+
|
110
|
+
### `ng-component`
|
111
|
+
|
112
|
+
Render Angular components with optional height and linked source code:
|
113
|
+
|
114
|
+
```markdown
|
115
|
+
::: ng-component <component-selector></component-selector> [height]="YOUR EXAMPLE HEIGHT"
|
116
|
+
[component.ts] <<< /assets/component.ts
|
117
|
+
[component.html] <<< /assets/component.html
|
118
|
+
:::
|
119
|
+
```
|
120
|
+
|
121
|
+
### `code-group`
|
122
|
+
|
123
|
+
Group multiple code snippets into tabs:
|
124
|
+
|
125
|
+
````markdown
|
126
|
+
::: code-group
|
127
|
+
```ts [Component]
|
128
|
+
console.log('Component code');
|
29
129
|
```
|
30
130
|
|
31
|
-
|
131
|
+
```html [Template]
|
132
|
+
<div>Hello</div>
|
133
|
+
```
|
134
|
+
:::
|
135
|
+
````
|
136
|
+
|
137
|
+
### `preview-group`
|
138
|
+
|
139
|
+
Display preview groups with filters:
|
140
|
+
|
141
|
+
```markdown
|
142
|
+
::: preview-group
|
143
|
+
[Nodes]
|
144
|
+
[Connectors]
|
145
|
+
[Connections]
|
146
|
+
:::
|
147
|
+
```
|
148
|
+
|
149
|
+
### Alerts
|
150
|
+
|
151
|
+
Use `tip`, `danger`, `info`, etc.:
|
152
|
+
|
153
|
+
```markdown
|
154
|
+
::: tip Title
|
155
|
+
This is a tip block
|
156
|
+
:::
|
157
|
+
```
|
158
|
+
|
159
|
+
---
|
160
|
+
|
161
|
+
## ๐งโ๐ป Contributing
|
162
|
+
|
163
|
+
Open for contributions, feedback and PRs.
|
164
|
+
|
165
|
+
GitHub: [https://github.com/Foblex/m-render](https://github.com/Foblex/m-render)
|
166
|
+
|
167
|
+
---
|
168
|
+
|
169
|
+
## ๐งพ License
|
170
|
+
|
171
|
+
[MIT](./LICENSE)
|
172
|
+
|
173
|
+
---
|
174
|
+
|
175
|
+
## Inspiration
|
32
176
|
|
33
|
-
|
177
|
+
The design and layout of MRender were heavily inspired by [VitePress](https://vitepress.dev), an open-source static site generator for Vue by Evan You.
|
178
|
+
MRender is a complete reimplementation in Angular, but its UI and structure intentionally follow VitePress for familiarity and clarity.
|
@@ -0,0 +1,51 @@
|
|
1
|
+
.m-render {
|
2
|
+
|
3
|
+
table {
|
4
|
+
width: 100%;
|
5
|
+
border-collapse: collapse;
|
6
|
+
font-size: 14px;
|
7
|
+
line-height: 1.6;
|
8
|
+
margin: 16px 0;
|
9
|
+
|
10
|
+
thead {
|
11
|
+
background-color: var(--alt-background);
|
12
|
+
color: var(--primary-text);
|
13
|
+
}
|
14
|
+
|
15
|
+
th,
|
16
|
+
td {
|
17
|
+
padding: 12px 16px;
|
18
|
+
text-align: left;
|
19
|
+
border-bottom: 1px solid var(--divider-color);
|
20
|
+
color: var(--primary-text);
|
21
|
+
}
|
22
|
+
|
23
|
+
th {
|
24
|
+
font-weight: 600;
|
25
|
+
}
|
26
|
+
|
27
|
+
tr {
|
28
|
+
background-color: var(--background-color);
|
29
|
+
|
30
|
+
&:hover {
|
31
|
+
background-color: var(--soft-background);
|
32
|
+
}
|
33
|
+
}
|
34
|
+
|
35
|
+
code {
|
36
|
+
font-family: var(--font-family-mono);
|
37
|
+
font-size: 0.875em;
|
38
|
+
background-color: var(--not-pre-code-background);
|
39
|
+
color: var(--not-pre-code-color);
|
40
|
+
padding: 0.2em 0.4em;
|
41
|
+
border-radius: var(--border-radius);
|
42
|
+
}
|
43
|
+
}
|
44
|
+
|
45
|
+
table:not([class]) {
|
46
|
+
display: table;
|
47
|
+
width: 100%;
|
48
|
+
overflow-x: auto;
|
49
|
+
max-width: 100%;
|
50
|
+
}
|
51
|
+
}
|