Git Product home page Git Product logo

esa-markdown-format's Introduction

@suin/esa-markdown-format

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

特徴

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

どのような整形がなされるかの例は自動整形のデモをご覧ください。

インストール

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

使い方

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

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の内容:

# ヘッダ

- リスト
- リスト

| カラム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/

esa-markdown-format's People

Stargazers

 avatar

Watchers

 avatar  avatar  avatar

esa-markdown-format's Issues

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.