0.1.0 • Published 1 year ago

@aoikarasu/remark-aoi v0.1.0

Weekly downloads
-
License
MIT
Repository
github
Last release
1 year ago

@aoikarasu/remark-aoi

remark plugin to support AOI arbitrarily handpicked markdown extensions (underline).

Build Coverage Downloads Size

Contents

Installation

npm install @aoikarasu/remark-aoi

Usage

Basic example

// …

const file = await unified()
  .use(remarkParse)
  .use(remarkAoi)
  .process('+one+ and ++two++')

console.log(String(file))

Yields:

<p><u>>one</u> and <u>two</u></p>

React usage example

Note: remark-gfm is not required for @aoikarasu/remark-aoi, but the latter is a beautiful complement to the former.

import React from 'react'
import ReactMarkdown from 'react-markdown'
import remarkGfm from 'remark-gfm'
import remarkAoi from '@aoikarasu/remark-aoi'

const MarkdownRenderer = ({ content }) => (
  <ReactMarkdown remarkPlugins={[remarkAoi, remarkGfm]}>
    {content}
  </ReactMarkdown>
)

Syntax

Use + characters to mark text for underlining:

This is +underlined text+.

This text is also ++underlined++.

AOI

Aoi (青い) means blue in japanese. In Japanese, 青 is used to describe blue things, such as 青い空 (blue sky)、青い海 (blue ocean). Aoi (青い) can also be translated to “fresh” or “newly grown”, such as vegetation which can have a blueish green color at times. It can also be referred to as an adjective to describe someone who is “inexperienced” or “fresh to the Industry.” However, keep in mind あおい isn’t loosely interchangeable with みどり. ^1

License

Remark-Aoi: MIT © Aoi Karasu, original code: MIT © Titus Wormer.

0.1.0

1 year ago