Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/kiritaniayaka/markdown-it-ruby-parser
A simple ruby parser
https://github.com/kiritaniayaka/markdown-it-ruby-parser
Last synced: about 1 month ago
JSON representation
A simple ruby parser
- Host: GitHub
- URL: https://github.com/kiritaniayaka/markdown-it-ruby-parser
- Owner: KiritaniAyaka
- Created: 2022-08-27T11:44:25.000Z (over 2 years ago)
- Default Branch: main
- Last Pushed: 2022-10-05T14:43:37.000Z (over 2 years ago)
- Last Synced: 2024-11-14T19:20:08.594Z (2 months ago)
- Language: TypeScript
- Size: 70.3 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# markdown-it-ruby-parser
[![npm Version Badge](https://img.shields.io/npm/v/markdown-it-ruby-parser.svg)](https://www.npmjs.com/package/markdown-it-ruby-parser)
![GitHub CI Status Badge](https://github.com/KiritaniAyaka/markdown-it-ruby-parser/workflows/CI/badge.svg)Ruby tag plugin for `markdown-it`
# Usage
## Install
```shell
npm install markdown-it-ruby-parser
# or
yarn add markdown-it-ruby-parser
# or
pnpm add markdown-it-ruby-parser
```## Syntax
### Input
```markdown
[砂]^(すな)の[惑星]^(わくせい)
```### Output
```html
砂すなの惑星わくせい
```## Render
```javascript
const md = require('markdown-it')()
const rubyParser = require('markdown-it-ruby-parser')// using this plugin
md.use(rubyParser)md.render('What you want to render')
```## Config
Config definition:
```typescript
interface RubyParserOptions {
bracket?: BracketStyle
rb?: boolean
rp?: boolean
}type BracketStyle = '(' | '{'
```### BracketStyle
You can use `(` or `{` style:
`[砂]^(すな)の[惑星]^(わくせい)` or `[砂]^{すな}の[惑星]^{わくせい}`
Default: `(`
### rb
Enable `rb` tag
This configuration decide whether the content of rendering has `rb` tag.
Default: `true`
### rp
Enable `rp` tag
This configuration decide whether the content of rendering has `rp` tag.
Default: `true`
---
The configurations above has covered in test case, you can view in `/test/MainTest.test.ts`.