2.7.2 โ€ข Published 5 months ago

@foblex/m-render v2.7.2

Weekly downloads
-
License
MIT
Repository
github
Last release
5 months ago

MRender: Markdown Renderer for Angular

MRender is an Angular library for rendering Markdown-based documentation with SSR support, built-in Angular components, customizable UI, and extended syntax.


๐Ÿš€ Features

  • Render .md files in Angular apps
  • Extended syntax: ng-component, code-group, preview-group, alert blocks (tip, info, danger, etc.)
  • Fully SSR-compatible
  • Embed Angular components inside markdown
  • Provider-based configuration for homepage and documentation
  • Lazy loading of examples
  • Built-in Table of Contents, SEO and meta support

๐Ÿ“ฆ Installation

npm install @foblex/m-render

๐Ÿงฉ Usage

Homepage Configuration

import {
  provideBackground, provideComponents,
  provideHero, provideHomeButtons, provideHomeFeatures,
  provideHomeFooter, provideImage, provideLogo, provideTitle
} from '@foblex/m-render';

export const HOME_CONFIGURATION = {
  providers: [
    provideLogo('./logo.svg'),
    provideTitle('Foblex Flow'),
    provideHero({
      headline: 'Foblex Flow',
      tagline1: 'Built with Angular',
      tagline2: 'Flow-Chart Library',
      subDescription: 'Supports Angular 12+, SSR, and Composition API.',
    }),
    provideBackground(HomePageBackgroundComponent),
    provideImage(HomePageImageComponent),
    provideHomeButtons([...]),
    provideHomeFeatures([...]),
    provideHomeFooter({ text: 'MIT License | Copyright ยฉ 2022 - Present' }),
  ],
};

Documentation Configuration

import {
  provideDirectory, provideNavigation, provideComponents,
  provideTocData, provideHeader, provideFooterNavigation,
  provideDocumentationMeta
} from '@foblex/m-render';

export const DOCUMENTATION_CONFIGURATION = {
  providers: [
    provideDirectory('./markdown/guides/'),
    provideNavigation(...),
    provideComponents([...]),
    provideTocData({ title: 'In this article', range: { start: 2, end: 6 } }),
    provideHeader(...),
    provideFooterNavigation(...),
    provideDocumentationMeta({ ... }),
  ],
};

Route Setup

import { provideDocumentation, provideHomePage } from '@foblex/m-render';

export const routes: Routes = [
  {
    path: '',
    loadChildren: () => import('@foblex/m-render').then((m) =>
      m.HOME_ROUTES.map((route) => ({
        ...route,
        providers: [provideHomePage(HOME_CONFIGURATION)],
      }))
    ),
  },
  {
    path: 'docs',
    loadChildren: () => import('@foblex/m-render').then((m) =>
      m.DOCUMENTATION_ROUTES.map((route) => ({
        ...route,
        providers: [provideDocumentation(DOCUMENTATION_CONFIGURATION)],
      }))
    ),
  },
];

โœจ Markdown Extensions

ng-component

Render Angular components with optional height and linked source code:

::: ng-component <component-selector></component-selector> [height]="YOUR EXAMPLE HEIGHT"
[component.ts] <<< /assets/component.ts
[component.html] <<< /assets/component.html
:::

code-group

Group multiple code snippets into tabs:

::: code-group
```ts [Component]
console.log('Component code');
```

```html [Template]
<div>Hello</div>
```
:::

preview-group

Display preview groups with filters:

::: preview-group
[Nodes]
[Connectors]
[Connections]
:::

Alerts

Use tip, danger, info, etc.:

::: tip Title
This is a tip block
:::

๐Ÿง‘โ€๐Ÿ’ป Contributing

Open for contributions, feedback and PRs.

GitHub: https://github.com/Foblex/m-render


๐Ÿงพ License

MIT


Inspiration

The design and layout of MRender were heavily inspired by VitePress, an open-source static site generator for Vue by Evan You.
MRender is a complete reimplementation in Angular, but its UI and structure intentionally follow VitePress for familiarity and clarity.

2.7.2

5 months ago

2.7.0

5 months ago

2.6.9

5 months ago

2.6.8

5 months ago

2.6.7

5 months ago

2.6.6

5 months ago

2.6.5

5 months ago

2.6.4

5 months ago

2.6.3

5 months ago

2.6.2

5 months ago

2.6.1

6 months ago

2.6.0

6 months ago

2.5.9

6 months ago

2.5.8

6 months ago

2.5.7

6 months ago

2.5.6

6 months ago

2.5.5

9 months ago

2.5.4

10 months ago

2.5.3

10 months ago

2.5.2

10 months ago

2.5.1

10 months ago