@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.
Files changed (22) hide show
  1. package/LICENSE +3 -0
  2. package/README.md +164 -19
  3. package/assets/styles/_code-group.scss +4 -0
  4. package/assets/styles/_code-highlight.scss +4 -0
  5. package/assets/styles/_table.scss +51 -0
  6. package/assets/styles/styles.scss +1 -0
  7. package/fesm2022/foblex-m-render.mjs +112 -182
  8. package/fesm2022/foblex-m-render.mjs.map +1 -1
  9. package/lib/documentation-page/components/markdown-container/f-markdown/highlight/highlight.service.d.ts +5 -6
  10. package/lib/documentation-page/components/markdown-container/f-markdown/highlight/index.d.ts +0 -2
  11. package/lib/documentation-page/components/markdown-container/f-markdown/highlight/mark-code-focused-blocks.post-processor.d.ts +0 -2
  12. package/lib/documentation-page/components/markdown-container/f-markdown/markdown/index.d.ts +1 -1
  13. package/lib/documentation-page/components/markdown-container/f-markdown/markdown/parse-angular-example-with-code-links.d.ts +2 -8
  14. package/lib/documentation-page/components/markdown-container/f-markdown/markdown/parse-grouped-code-items.d.ts +0 -1
  15. package/lib/documentation-page/components/markdown-container/f-markdown/markdown/parse-preview-group.d.ts +0 -2
  16. package/lib/documentation-page/components/markdown-container/f-markdown/markdown/parse-single-code-item.d.ts +0 -1
  17. package/lib/documentation-page/components/markdown-container/f-markdown/markdown/utils.d.ts +10 -0
  18. package/package.json +1 -1
  19. package/lib/documentation-page/components/markdown-container/f-markdown/highlight/change-code-focused-syntax.pre-processor.d.ts +0 -7
  20. package/lib/documentation-page/components/markdown-container/f-markdown/highlight/modify-punctuation-highlight.post-processor.d.ts +0 -6
  21. package/lib/documentation-page/components/markdown-container/f-markdown/markdown/utils/get-content.d.ts +0 -2
  22. 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
- ## Welcome to MRender
1
+ # MRender: Markdown Renderer for Angular
2
2
 
3
- **MRender** is a versatile library designed for creating modern web applications in SPA or SSR formats. It goes beyond just rendering Markdown files by extending their functionality with support for Angular components and code snippets. The library includes built-in themes, making it an excellent choice for building documentation and other content-centric projects. With MRender, you can easily generate both static HTML and interactive web applications, providing flexibility and convenience for developers.
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
- ### Examples
5
+ ---
6
6
 
7
- Explore practical use cases to see **MRender** in action:
7
+ ## ๐Ÿš€ Features
8
8
 
9
- - [Foblex Flow Documentation](https://github.com/Foblex/f-flow) - A comprehensive example of using MRender to create a documentation website.
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
- ### Features
17
+ ---
12
18
 
13
- 1. **Markdown Rendering:** Effortlessly render Markdown files into dynamic web content.
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
- ### Getting Started and Documentation
21
+ ```bash
22
+ npm install @foblex/m-render
23
+ ```
20
24
 
21
- For a comprehensive guide on how to install, configure, and use MRender in your Angular project, visit our [Documentation](https://m-render.foblex.com/docs/get-started).
25
+ ---
22
26
 
23
- ### Installation
27
+ ## ๐Ÿงฉ Usage
24
28
 
25
- To add **MRender** to your project, use the following npm command:
29
+ ### Homepage Configuration
26
30
 
27
- ```bash
28
- npm install @foblex/m-render
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
- ### License
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
- This library is available for use under the [MIT License](./LICENSE).
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.
@@ -1,4 +1,8 @@
1
1
  .m-render {
2
+ h1 + f-code-group, h2 + f-code-group, h3 + f-code-group, h4 + f-code-group, h5 + f-code-group, h6 + f-code-group {
3
+ margin-top: 12px;
4
+ }
5
+
2
6
  .f-code-group {
3
7
  display: block;
4
8
  border-radius: var(--code-group-border-radius);
@@ -136,3 +136,7 @@
136
136
  font-style: italic;
137
137
  }
138
138
  }
139
+
140
+ .inline-focus {
141
+ display: inline;
142
+ }
@@ -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
+ }
@@ -9,6 +9,7 @@
9
9
  @import "./_code-view";
10
10
  @import "./_code-highlight";
11
11
  @import './_doc-text';
12
+ @import "./_table";
12
13
 
13
14
  html {
14
15
  height: 100%;