md2hatena
v0.3.1
Published
Markdown to Hatena Syntax converter
Downloads
48
Readme
md2hatena
Markdown to Hatena Syntax (はてな記法) converter.
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
- As a Atom command in language-hatena package
- As a library
- As a remark plugin
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