0.2.7 • Published 6 years ago

material-icons-translator v0.2.7

Weekly downloads
52
License
GPL-3.0
Repository
github
Last release
6 years ago

material-icons-translator

npm version

This library translates all occurrences of material icons name to the unicode form

this library doesn't work if material is added by css

there are two versions of the library:

  1. Simple version, which uses only a regex. So you cannot translate occurrences inside inner tags. This is the default version
  2. Complex version, which uses a grammar parser. It has a bigger exclusivity power, but it has some issues, as you can see in the issues.

Example

Standalone

const MaterialIconsTranslator = require('material-icons-translator').simple;
const content = '<aaa class="material-icons">delete</aaa>ssss';
const translated = MaterialIconsTranslator(content); //equal to '<aaa class="material-icons">&#xE872;</aaa>ssss'

Gulp

const MaterialIconsTranslatorGulp = require('material-icons-translator/gulp');
const Gulp = require('gulp');
Gulp.task('translate', ()=>{
  return Gulp.src('files/**')
    .pipe(MaterialIconsTranslatorGulp())
    .pipe(Gulp.dest('filesTranslated');
});
0.2.7

6 years ago

0.2.6

7 years ago

0.2.5

7 years ago

0.2.4

7 years ago

0.2.3

7 years ago

0.2.2

7 years ago

0.2.1

7 years ago

0.2.0

7 years ago

0.1.11

7 years ago

0.1.10

7 years ago

0.1.9

8 years ago

0.1.8

8 years ago

0.1.7

8 years ago

0.1.6

8 years ago

0.1.5

8 years ago

0.1.4

8 years ago

0.1.3

8 years ago

0.1.2

8 years ago

0.1.1

8 years ago

0.1.0

8 years ago