Giter Site home page Giter Site logo

gpfm.js's Introduction

gpfm.js

An GPFM(Extended MFM for Groundpolis) parser implementation with PEG.js. Forked from mfm.js.

Installation

npm i Groundpolis/gpfm.js

Usage

Please see docs for the detail.

TypeScript:

import * as mfm from 'mfm-js';

const inputText =
`<center>
Hello $[tada everynyan! 🎉]

I'm @ai, A bot of misskey!

https://github.com/syuilo/ai
</center>`;

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

// Generate a MFM tree from the MFM plain text.
const plainMfmTree = mfm.parsePlain('I like the hot soup :soup:​');

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

Develop

1. Clone

git clone https://github.com/Groundpolis/gpfm.js.git

2. Install packages

cd gpfm.js
npm i

3. Build

npm run build

Use the interactive CLI parser

full parser:

npm run parse

plain parser:

npm run parse-plain

License

This software is released under the MIT License.

gpfm.js's People

Contributors

marihachi avatar syuilo avatar ebiselutica avatar johann150 avatar mei23 avatar dependabot[bot] avatar

Stargazers

 avatar

Watchers

James Cloos avatar  avatar

gpfm.js's Issues

npmに公開する

gpfm.jsでは取り急ぎGitHubリポジトリを直接npmパッケージの配布元としているが、その関係上ビルド済みファイルを置いておく羽目になっている

本家ではnpmに公開しているので、同様に公開する

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.