1.1.67 • Published 16 days ago

ngx-stackedit v1.1.67

Weekly downloads
-
License
Apache2.0
Repository
github
Last release
16 days ago

ngx-stackedit

npm npm npm downloads GitHub stars

StackEdit aspires to surpass all other markdown editors, becoming the most formidable and feature-rich markdown editor in the market. With a focus on power and versatility, we designed it to empower your markdown editing experience like never before

With the goal of burying all other markdown editors six feet under, we sometimes have to take risky measures. One of those measures is acting like we're better than the other markdown editors. Because we are.

Features:

  • Rich Text Editing: Enjoy a seamless editing experience with real-time Markdown rendering, making it easier than ever to see your content come to life as you type.

  • Syntax Highlighting: Write and edit code in style with syntax highlighting for various programming languages, ensuring your code looks as good as it works.

  • Color Customization: Express your creativity by customizing the editor's color scheme to match your unique preferences or brand aesthetics.

  • Mermaid Charts: Effortlessly integrate Mermaid charts into your documents for visually appealing data visualization.

  • Scroll Syncing: Experience a fluid writing and reading experience with scroll syncing, keeping your place in your document no matter where you are.

Markdown Preview Diagram View Fetch View Code View


Demo: https://dotglitch.dev/#/StackEdit

Quickstart

Install
    npm i -S ngx-stackedit
Import
import { Component } from '@angular/core';
import { StackEditorComponent } from 'ngx-stackedit';

@Component({
    selector: 'app-example',
    template: `
<ngx-stackedit
    [(value)]="defaultValue"
    mode="viewonly"
    (onImageUpload)="onImageUpload($event)"
/>
    `,
    imports: [
        StackEditorComponent
    ],
    standalone: true
})
export class ExampleBasicComponent {

    defaultValue = `
Lorem **ipsum** _dolor_ sit amet, consectetur adipiscing elit, sed do _eiusmod tempor incididunt_ \
ut labore et dolore magna ~~aliqua~~. Ut enim ad minim veniam, quis nostrud exercitation \
ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in \
_reprehenderit_ in <span style="color: #ff0000">voluptate</span> velit esse cillum \
dolore eu fugiat nulla pariatur. Excepteur sint ~~occaecat cupidatat~~ non proident, \
sunt in culpa qui **officia deserunt mollit** anim id est laborum.
    `;

    // Sample for handling an image upload event
    onImageUpload(evt: { data: FileList, stackEditor: StackEditorComponent }) {
        const formData = new FormData();

        Object.keys(evt.data).forEach(k => {
            const file: {
                lastModified: number,
                lastModifiedDate: Date,
                name: string,
                size: number,
                type: string;
            } = evt.data[k];

            const parts = file.name.split('.');
            const name = parts.slice(0, -1).join('.') + '-' + ulid() + '.' + parts.slice(-1)[0];
            formData.append(name, file as any);
        });
        formData.append("data", JSON.stringify({
            path,
            autoRename: true
        }));

        const url = `/api/files/upload`;

        const { files } = await this.fetch.post<{ files: {url: string, name: string}[] }>(url, formData);

        evt.stackEditor.finalizeImageUpload({
            label: files[0].name,
            link: files[0].url
        });
    }
}

Developing

npm install

# Start dev server on localhost:8080
npm run dev
# OR: Start standalone app dev server
npm run tauri:dev

Building

# npm package build in ./dist
npm run build
# Build a static site (uses indexedDB for storage)
npm run build:static
# or build the tauri app (requires rust Tauri setup)
npm run tauri:build

# build for production and view the bundle analyzer report
npm run build:analyze

License

This project is licensed under mixed MIT and Apache 2.0 Licenses. See the LICENSE file for details.

1.1.67

16 days ago

1.1.66

16 days ago

1.1.65

17 days ago

1.1.64

17 days ago

1.1.62

23 days ago

1.1.61

27 days ago

1.1.59

29 days ago

1.1.60

29 days ago

1.1.58

30 days ago

1.1.57

2 months ago

1.1.56

3 months ago

1.1.55

4 months ago

1.1.54

4 months ago

1.1.53

4 months ago

1.1.49

4 months ago

1.1.48

4 months ago

1.0.19

7 months ago

1.0.18

7 months ago

1.1.29

6 months ago

1.0.17

7 months ago

1.0.16

7 months ago

1.1.30

6 months ago

1.1.34

6 months ago

1.0.22

7 months ago

1.1.33

6 months ago

1.0.21

7 months ago

1.1.32

6 months ago

1.0.20

7 months ago

1.1.31

6 months ago

1.1.38

6 months ago

1.0.26

6 months ago

1.1.37

6 months ago

1.0.25

6 months ago

1.1.36

6 months ago

1.0.24

6 months ago

1.1.35

6 months ago

1.0.23

6 months ago

1.0.29

6 months ago

1.0.28

6 months ago

1.1.39

6 months ago

1.0.27

6 months ago

1.1.41

6 months ago

1.1.40

6 months ago

1.0.33

6 months ago

1.0.32

6 months ago

1.1.43

6 months ago

1.0.31

6 months ago

1.1.42

6 months ago

1.0.30

6 months ago

1.0.37

6 months ago

1.0.36

6 months ago

1.0.35

6 months ago

1.0.34

6 months ago

1.1.1

6 months ago

1.0.39

6 months ago

1.0.38

6 months ago

1.1.9

6 months ago

1.1.8

6 months ago

1.1.7

6 months ago

1.1.6

6 months ago

1.1.4

6 months ago

1.1.3

6 months ago

1.1.2

6 months ago

1.0.40

6 months ago

1.1.12

6 months ago

1.0.44

6 months ago

1.1.11

6 months ago

1.0.43

6 months ago

1.1.10

6 months ago

1.0.42

6 months ago

1.0.41

6 months ago

1.1.16

6 months ago

1.0.48

6 months ago

1.1.15

6 months ago

1.0.47

6 months ago

1.1.14

6 months ago

1.0.46

6 months ago

1.1.13

6 months ago

1.0.45

6 months ago

1.1.19

6 months ago

1.1.18

6 months ago

1.1.17

6 months ago

1.0.49

6 months ago

1.0.51

6 months ago

1.0.50

6 months ago

1.0.55

6 months ago

1.0.54

6 months ago

1.1.21

6 months ago

1.0.53

6 months ago

1.1.20

6 months ago

1.0.52

6 months ago

1.0.15

7 months ago

1.0.14

8 months ago

1.0.13

8 months ago

1.0.12

8 months ago

1.0.11

8 months ago

1.0.10

8 months ago

1.0.9

8 months ago

1.0.8

8 months ago

1.0.7

8 months ago

1.0.6

8 months ago

1.0.5

8 months ago

1.0.4

8 months ago

1.0.3

8 months ago