Coder Social home page Coder Social logo

harryhan1989 / markdownime Goto Github PK

View Code? Open in Web Editor NEW

This project forked from laobubu/markdownime

0.0 1.0 0.0 604 KB

A fresh way to write well-formatted text, by typing markdownized stuff on web.

Home Page: https://laobubu.net/MarkdownIME/

License: Other

JavaScript 17.74% Shell 1.23% TypeScript 78.27% HTML 2.75%

markdownime's Introduction

MarkdownIME

MarkdownIME is a fresh and fast way to make text formatted, and a minimal & powerful web rich-text editor.

  • MINIMAL: No 3rd-party dependency. No buttons or stylesheets. Only require one div[contentEditable] and one script tags.
  • POWERFUL: With Markdown markups and shortkeys, you can typeset your document on-the-fly.

Try out the demo. Works like a charm on desktop and mobile!

Build Status npm npm bundle size (minified) npm bundle size (minified + gzip)

Quickstart / Guide

Make a simpliest editor:

  1. Include MarkdownIME
    • Via NPM: const MarkdownIME = require("markdown-ime")
    • or, via Script Tag: <script src="https://build.laobubu.net/MarkdownIME/MarkdownIME.js"></script>
  2. Insert an HTML tag: <div contentEditable id="editor"><p>Hello World</p></div>
  3. Activate MarkdownIME in one JavaScript: MarkdownIME.Enhance(MarkdownIME.Scan(window));

Using other editor like TinyMCE / Quill? Please follow the examples.

More info can be found in examples and manual

Features

Notice

With MarkdownIME, user inputs Markdown, you get HTML Nodes instantly -- all Markdown markups are discarded.

If you want the intact Markdown rather than rendered HTML, maybe HyperMD -- a WYSIWYG Markdown Editor is what you need!

Supported Editor

  • Vanilla contenteditable elements - a div[contentEditable] makes everything.
  • Other rich-text editor based on contentEditable

Supported Shorkeys

Full list can be found here.

Key Feature Key Feature
Ctrl + I Toggle Italic Ctrl + B Toggle Bold
Ctrl + U Toggle Underline
Ctrl + Shift + = superscript Ctrl + = subscript
Ctrl + L justifyLeft Ctrl + E justifyCenter
Ctrl + R justifyRight
Key Feature
` Mark selected text as inline-code

Shortkeys in Tables

Key Feature Key Feature
Insert Insert a column after Shift + Insert Insert a column before
Tab Go next cell, or insert a row Shift + Tab Go previous cell
Up Go cell above current Down Go cell under current
Key Feature
Enter If current row is empty, finish the table. Otherwise, insert a row below.

Note that some shortkeys might be unavaliable in some browsers; MarkdownIME shortkeys are disabled in TinyMCE by default.

Supported Markdown Markups

Block Elements

  • Headers (beginning with # )
  • Horizontal ( --- )
  • (Nested) Lists
  • (Nested) Blockquote
  • Code Block

Span Elements

  • Links
  • Emphasis
  • In-line Code
  • Strikethrough
  • Images
  • Emojis ( eg. :) or :smile: )

Tables

  • Create a table with | table | column | headers | and Enter key
  • Use shortkeys to navigate and master the table (see above)

markdownime's People

Contributors

laobubu avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.