Markdown to Hatena Syntax converter
JavaScript
Switch branches/tags
Nothing to show
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Failed to load latest commit information.
bin
src
test
.babelrc
.eslintrc
.gitignore
.travis.yml
README.md
package.json
yarn.lock

README.md

md2hatena

Build Status NPM Version License Coverage Status

Markdown to Hatena Syntax (はてな記法) converter.

example

md2hatena suports all markdown syntax defined in mdast!

Install

npm i -g md2hatena

Usage

md2hatena can be used in 4 ways:

As a CLI command

$ md2hatena foo.md > foo.hatena

As a Atom command in language-hatena package

Language Hatena: Convert Markdown To Hatena Syntax command is available in language-hatena package.

As a library

import fs from 'fs';
import { md2hatena } from 'md2hatena';

const md = fs.readFileSync('foo.md', 'utf8');
md2hatena(md).then((hatena) => {
  console.log(hatena);
})

As a remark plugin

import remark from 'remark';
import { stringify } from 'md2hatena';

remark().use(stringify).process(md, (vfile) => {
  console.log(vfile.contents);
});

LICENSE

MIT