npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

rich-markdown-editor-enhanced

v11.21.6

Published

A rich text editor with Markdown shortcuts

Downloads

15

Readme

rich-markdown-editor

Forked from outline/rich-markdown-editor.

Enhance the outline/rich-markdown-editor by adding new features such as text color, LaTeX, merged table cells, and HTML. You can try a live demo here.

Usage

Install

npm i rich-markdown-editor-enhanced

Import

import Editor from 'rich-markdown-editor-enhanced';

<Editor
  defaultValue="Hello world!"
/>

New Features

Text Color and Background Color

Support text color and text background color.

  • text color
    text <<rgb(3, 135, 102) color>> support.
  • text background color
    text <<<rgba(3, 135, 102, 0.2) background color>>> support.

Latex

Support latex.

When $a \ne 0$, there are two solutions to \(ax^2 + bx + c = 0\) and they are
$$x = {-b \pm \sqrt{b^2-4ac} \over 2a}.$$

HTML

Support html block and html inline.

## HTML Block

<div>
  <div>123</div>
  <div style="color:skyblue;">456</div>
</div>

## HTML Inline

This span is <span style="background:skyblue">an <span style="border:1px solid red">inline-level</span> element</span>; its background
has been <span style="background:skyblue">colored</span> to <span style="color: tomato">display</span> both the beginning and
<em>end <span style="border: 1px solid #ccc;"> of **the** element's</span> influence</strong>.

Merged Table cells

Support merged table cells.

# Tables with merged cells

| Editor      | Rank | React | Collaborative |
|-------------|------|-------|--------------:|
| Prosemirror | Long cell   ||           Yes |
| Slate       | B    |  Yes  |            No |
| ^^          | C    |   No  |           Yes |

Disable Folding

Support disabling the heading folding.

import Editor from 'rich-markdown-editor-enhanced';

<Editor 
  disableExtensions=['folding']
/>

IME (extension)

The onChange will not be triggered while the input method is composing.

import Editor from 'rich-markdown-editor-enhanced';
import IME from 'rich-markdown-editor-enhanced/dist/extensions/ime';

<Editor
  defaultValue="Hello world!"
  onChange={(getValue, getJson) => {
    //...
  }},
  extensions={[
    new IME(),
  ]}
/>

onLoad (extension)

The onLoad will be triggered when all the images, formulas, etc. in the editor are loaded.

import Editor from 'rich-markdown-editor-enhanced';
import OnLoad from 'rich-markdown-editor-enhanced/dist/extensions/on-load';

<Editor
  defaultValue="Hello world!"
  extensions={[
    new OnLoad({
      onLoad: () => {
        //...
      }
    }),
  ]}
/>
;

attachment (extension)

This extension is just an example showing how to customize nodes.

How to use:

import Editor from 'rich-markdown-editor-enhanced';
import Attach from 'rich-markdown-editor-enhanced/dist/extensions/attachment/attachment-node';
import BlockAttach from 'rich-markdown-editor-enhanced/dist/extensions/block-attachment/block-attachment-node';

<Editor
  defaultValue="Hello world!"
  extensions={[
    new Attach(),
    new BlockAttach(),
  ]}
/>
;

The syntax of the attachment is as follows:

A block level attachment is show as below:

{{block: 9379ed9e-89f1-4196-8280-0881891d8ce8}}

An inline level attachment is show as below:

For details, see attach: [[attach: 9379ed9e-89f1-4196-8280-0881891d8ce8]].

Reference (extension)

Support reference.

How to use:

import Editor from 'rich-markdown-editor-enhanced';
import literatureReference from 'rich-markdown-editor-enhanced/dist/extensions/literature-reference/reference-node';
import literatureReferenceItem from 'rich-markdown-editor-enhanced/dist/extensions/literature-reference/reference-item-node';
import Ref from 'rich-markdown-editor-enhanced/dist/extensions/literature-reference/ref-node';

<Editor
  defaultValue="Hello world!"
  extensions={[
    new literatureReference(),
    new literatureReferenceItem(),
    new Ref(),
  ]}
/>
;

The syntax of reference is as follows:

#### Content

The quick brown fox jumps over the lazy dog.<ref name="LazyDog"/>
Amazingly few discotheques provide jukeboxes.<ref name="Jukeboxes"/>
How razorback-jumping frogs can level six piqued gymnasts.<ref name="JumpingFrogs"/>

#### References

<references>
<ref name="Jukeboxes">This is the jukeboxes reference.</ref>
<ref name="LazyDog">This is the lazy dog reference.</ref>
<ref name="JumpingFrogs">This is the jumping frogs reference.</ref>
</references>