Skip to content

egoist/markdown-it-prettier

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

11 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

markdown-it-prettier

NPM version NPM downloads CircleCI donate

Install

yarn add prettier markdown-it-prettier

Usage

const md = require('markdown-it')()
const prettier = require('markdown-it-prettier')

const options = { singleQuote: true }
md.use(prettier, options)

In:

```js
hello ( "world"
)

class Foo{
log() {return "42"}
}
```

Out:

<pre><code class="language-js">hello('world');

class Foo {
  log() {
    return '42';
  }
}
</code></pre>
```

It could format all kinds of code that Prettier could format.

Options

Prettier options.

Contributing

  1. Fork it!
  2. Create your feature branch: git checkout -b my-new-feature
  3. Commit your changes: git commit -am 'Add some feature'
  4. Push to the branch: git push origin my-new-feature
  5. Submit a pull request :D

Author

markdown-it-prettier © egoist, Released under the MIT License.
Authored and maintained by egoist with help from contributors (list).

egoistian.com · GitHub @egoist · Twitter @_egoistlily

About

A markdown-it plugin to format code blocks in your markdown code.

Topics

Resources

License

Stars

Watchers

Forks

Sponsor this project

 

Packages

No packages published