Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/api.yml
Original file line number Diff line number Diff line change
Expand Up @@ -34,4 +34,4 @@ jobs:

- name: Show report
if: always()
run: cat temp/mfc-js.api.md
run: cat temp/mfm-js.api.md
2 changes: 1 addition & 1 deletion CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ PRを作る際は、`pnpm run api`コマンドを実行してAPIレポートを
### Codecov
このプロジェクトではカバレッジの計測に[Codecov](https://about.codecov.io/)を導入しています。カバレッジは、コードがどれくらいテストでカバーされているかを表すものです。

カバレッジ計測はCIで自動的に行われ、特に操作は必要ありません。カバレッジは[ここ](https://codecov.io/gh/kokonect-link/mfc.js)から見ることができます。
カバレッジ計測はCIで自動的に行われ、特に操作は必要ありません。カバレッジは[ここ](https://codecov.io/gh/cheripia-dev/mfm.js)から見ることができます。

また、各PRに対してもそのブランチのカバレッジが自動的に計算され、マージ先のカバレッジとの差分を含んだレポートがCodecovのbotによりコメントされます。これにより、そのPRをマージすることでどれくらいカバレッジが増加するのか/減少するのかを確認することができます。

Expand Down
27 changes: 14 additions & 13 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,23 +1,24 @@
# mfc.js
An MFC parser implementation with TypeScript.
[Try it out!](https://runkit.com/npm/mfc-js)
# mfm.js
An MFM parser implementation with TypeScript.

[![Test](https://github.com/kokonect-link/mfc.js/actions/workflows/test.yml/badge.svg)](https://github.com/kokonect-link/mfc.js/actions/workflows/test.yml)
[![codecov](https://codecov.io/gh/kokonect-link/mfc.js/branch/develop/graph/badge.svg?token=irAWFiHK8T)](https://codecov.io/gh/kokonect-link/mfc.js)
[![Test](https://github.com/cheripia-dev/mfm.js/actions/workflows/test.yml/badge.svg)](https://github.com/cheripia-dev/mfm.js/actions/workflows/test.yml)

[![NPM](https://nodei.co/npm/mfc-js.png?downloads=true&downloadRank=true&stars=true)](https://www.npmjs.com/package/mfc-js)
This is the Cheripia fork of [misskey-dev/mfm.js](https://github.com/misskey-dev/mfm.js).
The package name is `mfm-js`, but installing `mfm-js` from npm does not install this fork.

## Installation
```
npm i mfc-js
Install this fork from GitHub, replacing `<commit-sha>` with the full commit SHA to pin:

```sh
npm install 'mfm-js@git+https://github.com/cheripia-dev/mfm.js.git#<commit-sha>'
```

## Usage
Please see [docs](./docs/index.md) for the detail.

TypeScript:
```ts
import * as mfc from 'mfc-js';
import * as mfm from 'mfm-js';

const inputText =
`<center>
Expand All @@ -28,21 +29,21 @@ I'm @ai, A bot of cherrypick!
https://github.com/syuilo/ai
</center>`;

// Generate a MFC tree from the full MFC text.
// Generate an MFM tree from the full MFM text.
const mfmTree = mfm.parse(inputText);

// Generate a MFC tree from the simple MFC text.
// Generate an MFM tree from the simple MFM text.
const simpleMfmTree = mfm.parseSimple('I like the hot soup :soup:​');

// Reverse to a MFC text from the MFC tree.
// Reverse to an MFM text from the MFM tree.
const text = mfm.toString(mfmTree);

```

## Develop
### 1. Clone
```
git clone https://github.com/kokonect-link/mfc.js.git
git clone https://github.com/cheripia-dev/mfm.js.git
```

### 2. Install packages
Expand Down
284 changes: 0 additions & 284 deletions etc/mfc-js.api.md

This file was deleted.

2 changes: 1 addition & 1 deletion etc/cfm-js.api.md → etc/mfm-js.api.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
## API Report File for "mfc-js"
## API Report File for "mfm-js"

> Do not edit this file. It is a report generated by [API Extractor](https://api-extractor.com/).

Expand Down
6 changes: 3 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "mfc-js",
"version": "0.3.0",
"baseMfmJsVersion": "0.28.0",
"name": "mfm-js",
"version": "0.3.1",
"baseUpstreamVersion": "0.28.0",
"description": "An MFM parser implementation with TypeScript",
"type": "module",
"packageManager": "pnpm@12.14.0",
Expand Down
Loading