1.0.25 • Published 7 months ago

ngx-bytemd v1.0.25

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

ByteMD wrapper for Angular

npm npm npm downloads GitHub stars

This is a ByteMD wrapper library for Angular.

:warning: This library is still in alpha stages, some things may not work correctly.
If you find any bugs, please open a PR.

Installation

You can install the library with npm.

Angular 15+

    # Install ngx-bytemd and dependencies
    npm i ngx-bytemd svelte @bytemd/plugin-frontmatter @bytemd/plugin-gfm @bytemd/plugin-highlight @bytemd/plugin-medium-zoom @bytemd/plugin-mermaid  --save

Getting started

Use NgxByteMD in your project:

import { Component } from '@angular/core';
import { ByteMDComponent } from 'ngx-bytemd';

@Component({
    selector: 'app-test-component',
    template: `<ngx-bytemd></ngx-bytemd>`
    imports: [
        ByteMDComponent
    ],
    standalone: true
})
export class TestComponent {
    markdownText = `
---
# frontmatter: https://jekyllrb.com/docs/front-matter/
layout: post
title: Blogging Like a Hacker
---

## Markdown Basic Syntax

I just love **bold text**. Italicized text is the _cat's meow_. At the command prompt, type `nano`.

My favorite markdown editor is [ByteMD](https://github.com/bytedance/bytemd).

1. First item
2. Second item
3. Third item

> Dorothy followed her through many of the beautiful rooms in her castle.

\`\`\`js
import gfm from '@bytemd/plugin-gfm'
import { Editor, Viewer } from 'bytemd'

const plugins = [
  gfm(),
  // Add more plugins here
]

const editor = new Editor({
  target: document.body, // DOM to render
  props: {
    value: '',
    plugins,
  },
})

editor.on('change', (e) => {
  editor.$set({ value: e.detail.value })
})
\`\`\`

## GFM Extended Syntax

Automatic URL Linking: https://github.com/bytedance/bytemd

~~The world is flat.~~ We now know that the world is round.

- [x] Write the press release
- [ ] Update the website
- [ ] Contact the media

| Syntax    | Description |
| --------- | ----------- |
| Header    | Title       |
| Paragraph | Text        |

## Footnotes

Here's a simple footnote,[^1] and here's a longer one.[^bignote]

[^1]: This is the first footnote.
[^bignote]: Here's one with multiple paragraphs and code.

    Indent paragraphs to include them in the footnote.

    \`{ my code }\`

    Add as many paragraphs as you like.

## Gemoji

Thumbs up: :+1:, thumbs down: :-1:.

Families: :family_man_man_boy_boy:

Long flags: :wales:, :scotland:, :england:.

## Mermaid Diagrams

\`\`\`mermaid
graph TD;
  A-->B;
  A-->C;
  B-->D;
  C-->D;
\`\`\`
    `
}
1.0.21

8 months ago

1.0.20

8 months ago

1.0.25

7 months ago

1.0.24

7 months ago

1.0.23

8 months ago

1.0.19

8 months ago

1.0.18

8 months ago

1.0.16

8 months ago

1.0.9

8 months ago

1.0.11

8 months ago

1.0.10

8 months ago

1.0.15

8 months ago

1.0.14

8 months ago

1.0.13

8 months ago

1.0.12

8 months ago

1.0.8

8 months ago

1.0.7

8 months ago

1.0.5

8 months ago

1.0.3

8 months ago

1.0.2

8 months ago