# @suin/esa-markdown-format

> esa.ioのMarkdownを自動整形する関数です

Latest version **1.2.0** (published 2021-03-31) · MIT license · 0 weekly downloads

## Install

```sh
npm install @suin/esa-markdown-format
pnpm add @suin/esa-markdown-format
yarn add @suin/esa-markdown-format
bun add @suin/esa-markdown-format
```

## Health

**Score 25/100 (F)** — status: abandoned.

Positive: has types; no vulnerabilities; high quality score.

Warnings: low downloads; no esm support.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.2.0 |
| Published | 2021-03-31 |
| First published | 2021-03-29 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | bundled |
| Module format | CommonJS |
| Dependencies | 9 |
| Unpacked size | 20.6 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 1 |
| Author | suin |
| Maintainers | suin |
| Keywords | esa |

## Links

- npm: https://www.npmjs.com/package/@suin/esa-markdown-format
- Repository: https://github.com/suin/esa-markdown-format
- Homepage: https://github.com/suin/esa-markdown-format#readme
- Issues: https://github.com/suin/esa-markdown-format/issues
- npm.io page: https://npm.io/package/@suin/esa-markdown-format

## Dependencies (9)

- [remark](https://npm.io/package/remark.md) ^13.0.0
- [prettier](https://npm.io/package/prettier.md) ^2.2.1
- [remark-gfm](https://npm.io/package/remark-gfm.md) ^1.0.0
- [repeat-string](https://npm.io/package/repeat-string.md) ^1.6.1
- [unist-util-map](https://npm.io/package/unist-util-map.md) ^2.0.1
- [unist-util-visit](https://npm.io/package/unist-util-visit.md) ^2.0.3
- [mdast-util-to-markdown](https://npm.io/package/mdast-util-to-markdown.md) ^0.6.5
- [prettier-plugin-md-nocjsp](https://npm.io/package/prettier-plugin-md-nocjsp.md) ^1.0.2
- [remark-lint-code-block-style](https://npm.io/package/remark-lint-code-block-style.md) ^2.0.1

## Recent versions

- 1.2.0 (latest) — 2021-03-31
- 1.1.0 — 2021-03-31
- 1.0.0 — 2021-03-29

## README

# @suin/esa-markdown-format

esa.ioのMarkdownを自動整形する関数です。

## 特徴

- PrettierによるMarkdownの自動整形
- PrettierによるMarkdown内コードブロックの自動整形
- esa内部リンクを絶対URLから相対URLにする

どのような整形がなされるかの例は[自動整形のデモ](./demo)をご覧ください。

## インストール

```bash
yarn add @suin/esa-markdown-format
# or
npm install @suin/esa-markdown-format
```

## 使い方

`format`関数にフォーマットしたいMarkdownとチーム名を渡すと、フォーマットされたMarkdownが返ります:

```ts
import format from "@suin/esa-markdown-format";

const input = `
ヘッダ
=====

* リスト
* リスト

|カラム1|カラム2|カラム3|
|---|---|---|
|a|b|c|

~~~js
const uglyCode=function(){return 'omg'}
~~~

    const indented = "code";

[絶対URL](https://example.esa.io/posts/1)`;

const output = format(input, { team: "example" });
```

`output`の内容:

````markdown
# ヘッダ

- リスト
- リスト

| カラム1 | カラム2 | カラム3 |
| ------- | ------- | ------- |
| a       | b       | c       |

```js
const uglyCode = function () {
  return "omg";
};
```

```
const indented = "code";
```

[絶対URL](/posts/1)
````

## API リファレンス

https://suin.github.io/esa-markdown-format/

---
_Source: https://npm.io/package/@suin/esa-markdown-format · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
