remark-vtranslit

1.1.0 • Public • Published

remark-vtranslit

remark-vtranslit is a remarkjs plugin for vtranslit.

Setup

> npm i remark-vtranslit

Usage

Code

const rehypeStringify = require('rehype-stringify');
const remarkParse = require('remark-parse');
const remarkRehype = require('remark-rehype');
const unified = require('unified');
const remarkVtranslit = require('remark-vtranslit');
 
const { vTranslitSchemeItrn } = require('vtranslit-scheme-itrn');
const { vTranslitSchemeDeva } = require('vtranslit-scheme-deva');
 
const markdownString = '# //namaskAra// 🙏 to Everyone!!!';
 
unified()
    .use(remarkParse)
    .use(remarkVtranslit, [
        vTranslitSchemeItrn,
        vTranslitSchemeDeva
    ])
    .use(remarkRehype)
    .use(rehypeStringify)
    .process(markdownString, (err, file) => {
        
        console.log(err || String(file));
        
    });

Output:

<h1><span class="vtranslit vtranslit-scheme-deva">नमस्कार</span> 🙏 to Everyone!!!</h1>

Escaping '//'

A double-slash ('//') can be escaped by wrting '///'. See Sample for usage.

License

MIT (c) Prasanna Venkatesh T S

Readme

Keywords

Package Sidebar

Install

npm i remark-vtranslit

Weekly Downloads

2

Version

1.1.0

License

MIT

Unpacked Size

6.05 kB

Total Files

6

Last publish

Collaborators

  • vipranarayan14