3.23.3 • Published 4 months ago

qik-hypermd-fork v3.23.3

Weekly downloads
-
License
MIT
Repository
-
Last release
4 months ago

HyperMD

HyperMD Markdown Editor

Breaks the Wall between writing and preview, in a Markdown Editor.

NPM version Build Status

Online Demo | Examples | Documentation

中文介绍

Quickstart

// npm install --save hypermd codemirror
var HyperMD = require('hypermd')
var myTextarea = document.getElementById('input-area')
var editor = HyperMD.fromTextArea(myTextarea)

Remix on Glitch

Also for RequireJS, Parcel, webpack, plain browser env. Read the Doc

Start Development

# Install packages
npm run dev_init

# Run demo page
npm run dev

# Run test
npm run test

Why use HyperMD?

HyperMD is a set of CodeMirror add-ons / modes / themes / commands / keymap etc.

You may use both original CodeMirror and HyperMD on the same page.

🌈 Write, and preview on the fly

  • Regular Markdown blocks and elements
    • Strong, Emphasis, Strikethrough, Code
    • Links, Images
    • Title / Quote / Code Block / List / Horizontal Rule
  • Markdown Extension
    • Simple Table
    • Footnote ^1
    • TODO List (the box is clickable)
    • YAML Front Matter
    • $\LaTeX$ Formula, inline or block display mode ^4
    • Emoji: :joy: => :joy: (also support custom emoji)
  • And more

💪 Better Markdown-ing Experience

  • Upload Images and files via clipboard, or drag'n'drop
  • Alt+Click to open link / jump to footnote ^1
  • Hover to read footnotes
  • Copy and Paste, translate HTML into Markdown ^5
  • Easy and ready-to-use Key-bindings (aka. KeyMap)

🎁 CodeMirror benefits

  • Syntax Highlight for code blocks, supports 120+ languages^2. Mode can be loaded on-demand.
  • Configurable key-bindings
  • Diff and Merge
  • Themes ^3
  • Almost all of CodeMirror addons!

🔨 Extensible and Customizable

🎹 Tailored KeyMap "HyperMD":

  • Table
    • Enter Create a table with | column | line |
    • Enter Insert new row, or finish a table (if last row is empty)
    • Tab or Shift-Tab to navigate between cells
  • List
    • Tab or Shift-Tab to indent/unindent current list item
  • Formatting a nearby word (or selected text)
    • Ctrl+B bold
    • Ctrl+I emphasis
    • Ctrl+D strikethrough

Special Thanks

💎 Service and Resource

🌟 Sponsors

🙏 Sponsors (sorted by date)

Contributing

HyperMD is a personal Open-Source project by laobubu. Contributions are welcomed. You may:


^1: Ctrl+Click works too, but will jump to the footnote if exists. ^2: Languages as many as CodeMirror supports. ^3: If the theme is not designed for HyperMD, some features might not be present. ^4: Math block use $$ to wrap your TeX expression. ^5: Use Ctrl+Shift+V to paste plain text. ^6: Disabled by default, see doc; #use two hash symbol# if tag name contains spaces.

Adding CUSTOM tokens for the editor

Steps to create a new token for the Editor(HyperMD-Fork) 1. /src/core/line-spans.ts In the const SpanType = '' // add the token name separated by '|'. eg: superscript In "getTokenTypes" function // add the token executor for start and end. This adds span for the tokens(start and end)

  1. /src/addon/hide-token.ts // in the below constant add the token name in tokenTypes separated by '|': eg: superscript export const defaultOption: Options = { enabled: false, line: true, tokenTypes: "em|strong|strikethrough|code|linkText|task|customLink|highlightText".split("|"), }

  2. /src/mode/hypermd.ts // in the below constant add the constant to define. The assignment is options as it is a default value export const enum LinkType { SUPERSCRIPT = true } or export const enum LinkType { SUPERSCRIPT }

    // in the below constant add the class name that has to be added for the element const linkStyle = {

      [LinkType.BARELINK]: "hmd-barelink",
      [LinkType.BARELINK2]: "hmd-barelink2",
      [LinkType.SUPERSCRIPT]: "hmd-superscript"

    }

    // in the below function, add your implementation under if(markdown) condition. verify the existing code for reference newMode.token = function (stream, state) { }

  3. /mode/hypermd.scss // find the line matching below and add your class to it eg: cm-superscript; This is to hide the token span.hmd-hidden-token {

      &.cm-formatting-em,
      &.cm-formatting-strong,
      &.cm-formatting-strikethrough,
      &.cm-formatting-code,
      &.cm-formatting-link,
      &.cm-customlink,
      &.cm-highlightText {
          @extend %hidden-token;
      }

    }

    	// similarly dark theme or any theme should be updated
  4. /theme/hypermd-light.scss // add required style under .cm-s-hypermd-light { // here your styles }

3.20.0

8 months ago

3.22.0

8 months ago

3.20.2

8 months ago

3.20.1

8 months ago

3.22.2

7 months ago

3.22.1

8 months ago

3.22.4

7 months ago

3.22.3

7 months ago

3.22.5

6 months ago

3.21.1

8 months ago

3.21.0

8 months ago

3.23.1

4 months ago

3.23.0

4 months ago

3.21.2

8 months ago

3.23.3

4 months ago

3.23.2

4 months ago

3.19.6

9 months ago

3.19.7

9 months ago

3.19.4

10 months ago

3.19.3

10 months ago

3.19.5

9 months ago

3.17.0

10 months ago

3.19.0

10 months ago

3.17.2

10 months ago

3.17.1

10 months ago

3.19.2

10 months ago

3.19.1

10 months ago

3.16.0

10 months ago

3.18.0

10 months ago

3.11.60

1 year ago

3.15.0

11 months ago

3.14.1

12 months ago

3.14.0

12 months ago

3.14.2

11 months ago

3.11.55

1 year ago

3.11.57

1 year ago

3.11.56

1 year ago

3.11.59

1 year ago

3.11.58

1 year ago

3.12.60

12 months ago

3.11.54

1 year ago

3.11.53

1 year ago

3.11.52

1 year ago

3.11.51

1 year ago

3.11.49

1 year ago

3.11.48

1 year ago

3.11.50

1 year ago

3.11.44

1 year ago

3.11.46

1 year ago

3.11.47

1 year ago

3.11.42

1 year ago

3.11.41

1 year ago

3.11.43

1 year ago

3.11.40

1 year ago

3.11.39

1 year ago

3.11.37

1 year ago

3.11.36

1 year ago

3.11.35

1 year ago

3.11.33

1 year ago

3.11.34

1 year ago

3.11.32

1 year ago

3.11.31

1 year ago

3.11.29

1 year ago

3.11.30

1 year ago

3.11.28

1 year ago

3.11.27

1 year ago

3.11.26

1 year ago

3.11.25

1 year ago

3.11.20

1 year ago

3.11.22

1 year ago

3.11.21

1 year ago

3.11.24

1 year ago

3.11.23

1 year ago

3.11.19

1 year ago

3.11.18

1 year ago

3.11.17

1 year ago

3.11.16

1 year ago

3.11.15

1 year ago

3.11.14

1 year ago

3.11.11

1 year ago

3.11.10

1 year ago

3.11.13

1 year ago

3.11.9

1 year ago

3.11.4

1 year ago

3.11.6

1 year ago

3.11.5

1 year ago

3.11.8

1 year ago

3.11.7

1 year ago

3.11.2

1 year ago

0.3.12

1 year ago

0.3.11

1 year ago