unified

Project:vipranarayan14/remark-vtranslit

Package:remark-vtranslit@1.1.0

  1. Dependencies:1·Dependents:1
  2. A remarkjs plugin for vtranslit.
  1. remark 170

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