Skip to content

Commit

Permalink
Chore: small correction before release.
Browse files Browse the repository at this point in the history
  • Loading branch information
evilebottnawi committed Jan 24, 2017
1 parent d3d55dc commit ca25c4d
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 2 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,10 @@ All notable changes to this project will be documented in this file.

This project adheres to [Semantic Versioning](http://semver.org/).

# Head

- Added: `glyphTransformFn` option for transform glyph metadata before transferred in style template.

# 7.0.2 - 2016-12-22

- Fixed: exit code can be not number.
Expand Down
5 changes: 3 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -107,9 +107,10 @@ Default value getting from `fontName` options, but you can specify any value.

### `glyphTransformFn`
Type: `function`
Default: `null`

If you need some transform it titles of CSS classes for your icons, you can use option glyphTransformFn with glyphs
metadata object
If you need transform glyph metadata (e.g. titles of CSS classes) before transferred in style template
for your icons, you can use this option with glyphs metadata object.

Example:
```
Expand Down
2 changes: 2 additions & 0 deletions src/standalone.js
Original file line number Diff line number Diff line change
Expand Up @@ -227,6 +227,7 @@ export default function ({
const options = merge({}, {
ascent,
centerHorizontally,
// Renamed with `style` prefix in next major release
cssTemplateClassName,
cssTemplateFontName,
cssTemplateFontPath,
Expand Down Expand Up @@ -319,6 +320,7 @@ export default function ({
const nunjucksOptions = merge(
{},
{
// Maybe best solution is return metadata object of glyph.
glyphs: glyphsData.map((glyphData) => {
if (typeof options.glyphTransformFn === 'function') {
options.glyphTransformFn(glyphData.metadata);
Expand Down

0 comments on commit ca25c4d

Please sign in to comment.