Markdown It Prettier banner
egoist egoist

Markdown It Prettier

Documentation community

Description

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

Installation

This entry records only its repository, not the path inside it, so there is no exact command to give. Open the source below and copy the folder into ~/.claude/skills/, or the file into ~/.claude/agents/.

README

markdown-it-prettier

[![NPM version](https://img.shields.io/npm/v/markdown-it-prettier.svg?style=flat)](https://npmjs.com/package/markdown-it-prettier) [![NPM downloads](https://img.shields.io/npm/dm/markdown-it-prettier.svg?style=flat)](https://npmjs.com/package/markdown-it-prettier) [![CircleCI](https://circleci.com/gh/egoist/markdown-it-prettier/tree/master.svg?style=shield)](https://circleci.com/gh/egoist/markdown-it-prettier/tree/master) [![donate](https://img.shields.io/badge/$-donate-ff69b4.svg?maxAge=2592000&style=flat)](https://github.com/egoist/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:

hello('world');

class Foo {
  log() {
    return '42';
  }
}
```

It could format all kinds of code that [Prettier](https://github.com/prettier/prettier#prettier) could format.

Options

[Prettier options](https://github.com/prettier/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](https://github.com/egoist), Released under the [MIT](./LICENSE) License.
Authored and maintained by egoist with help from contributors ([list](https://github.com/egoist/markdown-it-prettier/contributors)).

[egoistian.com](https://egoistian.com) · GitHub [@egoist](https://github.com/egoist) · Twitter [@_egoistlily](https://twitter.com/_egoistlily)