Git Product home page Git Product logo

markdown.js's Introduction

Markdown.js

GitHub Workflow Status GitHub file gzip size in bytes

NPM

a simple markdown parser for JavaScript. ⭐ demo

Syntax

  • Span Elements
auto link: <http://example.com/>
[This link](http://example.net/) has no title attribute.
![Alt text](/path/to/img.jpg)
*italicize*
`inline code`
**bold**
~~strikethrough~~
  • Headers
# h1 {#heading-id}
## h2
### h3
  • Lists
1. Step 1
    * requirements
```sh
pip3 install --user
```
    * build
        1. make link
> blockquote, hh
        2. make build
    * delete
2. Step 2
    1. first

- [x] task1
- [ ] task2
  • Blockquotes
> blockquote
next line

>[success] blockquote
>> next block
>> * list 1
>> * list 2
>>   ```
code in list
```
>
> next line
  • Code
```go
package main

func main() {
    println('mdzz')
}
```
  • Table
 left align | right align | center 
 :------| ------: | :------: 
 AND | 0 | 1 
 0 | 0 | 0 
 1 | 0 | 1 
  • HTML
<svg width="99" height="99">
  <circle cx="50" cy="50" r="40" stroke="black" stroke-width="2" fill="#d89cf6"/>
</svg>

Install

npm install moonprism-markdown --save

Usage

import markdown from 'moonprism-markdown'
let html = markdown('# hello world')

or download markdown.min.js, and import file in your page.

<script type="text/javascript" src="./markdown.min.js"></script>
<script type="text/javascript">
    var html = markdown('# hello world')
</script>

Config

markdown('# hello world', {
    debug: true,
    imageCDN: 'https://cdn.xx/',
    linkTargetBlank: true
})

markdown.js's People

Contributors

moonprism avatar kicoer avatar

Stargazers

Hakan Bilgin avatar Anjel Rana avatar Sadegh Barati avatar Aseer KT avatar Chuck Rincón avatar KK_GKD avatar Innei avatar Andy avatar Yu avatar

Watchers

James Cloos avatar  avatar

Forkers

kicoer orta

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.