diff --git a/.versions b/.versions index b3f6c64..5dc98d8 100644 --- a/.versions +++ b/.versions @@ -1,4 +1,4 @@ -andrefgneves:iconfont@0.1.6 +andrefgneves:iconfont@0.1.7 application-configuration@1.0.4 base64@1.0.2 binary-heap@1.0.2 @@ -11,7 +11,7 @@ follower-livedata@1.0.3 geojson-utils@1.0.2 id-map@1.0.2 json@1.0.2 -local-test:andrefgneves:iconfont@0.1.6 +local-test:andrefgneves:iconfont@0.1.7 logging@1.0.6 meteor@1.1.4 minimongo@1.0.6 diff --git a/README.md b/README.md index 9789728..b8aaf4f 100644 --- a/README.md +++ b/README.md @@ -43,12 +43,6 @@ Type: `array` Default: `[ 'svg', 'ttf', 'eot', 'woff' ]` The types of fonts to generate. -#### stylesheetTemplatePath - -Type: `string` Default: `packages/iconfont/plugin/stylesheet.tpl` - -The path to the stylesheet template. This file must have a [Lodash's template](http://lodash.com/docs#template) compatible syntax. - #### fontHeight Type: `number` Default: `512` @@ -59,7 +53,7 @@ The height of the outputed fonts. Type: `string` Default: `client` -Path where the generated stylesheet should be outputed. +Path where the generated stylesheet should be outputed to. #### stylesheetFilename @@ -77,7 +71,7 @@ The path to a Lodash template Type: `object` Default: null -An object that defined which files to generate and with what templates. If specified, `stylesheetFilename` and `stylesheetTemplate` are ignored. +An object that defined which files to generate and with what templates. If specified, `stylesheetFilename` and `stylesheetTemplate` are ignored. Example for a possible usecase where you want the icons `content` value to be specified in a SASS map, and to access those variables in the icons selectors: @@ -88,7 +82,7 @@ Example for a possible usecase where you want the icons `content` value to be sp } ``` -This would create `_icon-classes.scss` and `_icon-variables.scss` at `stylesheetDestBasePath` with the contents of the respective compiled template. +This would create `_icon-classes.scss` and `_icon-variables.scss` at `stylesheetDestBasePath` with the contents of the respective compiled template. `_icon-variables.scss` @@ -142,4 +136,4 @@ Normalize icons by scaling them to the `fontHeight` value. ## License -The MIT License, see the included License.txt file. \ No newline at end of file +The MIT License, see the included License.txt file. diff --git a/package.js b/package.js index 9517119..e6b7d1f 100644 --- a/package.js +++ b/package.js @@ -1,6 +1,6 @@ Package.describe({ summary: 'Generate an icon font from SVG files', - version: '0.1.6', + version: '0.1.7', git: 'https://github.com/andrefgneves/meteor-iconfont.git', name: 'andrefgneves:iconfont' }); @@ -8,7 +8,7 @@ Package.describe({ Package.registerBuildPlugin({ name: 'andrefgneves:iconfont', - use: ['coffeescript@1.0.5'], + use: ['coffeescript'], sources: [ 'plugin/iconfont.coffee' diff --git a/plugin/iconfont.coffee b/plugin/iconfont.coffee index 5fa135f..a5a8a30 100644 --- a/plugin/iconfont.coffee +++ b/plugin/iconfont.coffee @@ -26,7 +26,7 @@ handler = (compileStep) -> normalize: true classPrefix: 'icon-' stylesheetFilename: null - stylesheetTemplate: '.meteor/local/isopacks/andrefgneves_iconfont/os/packages/andrefgneves:iconfont/plugin/stylesheet.tpl' + stylesheetTemplate: '.meteor/local/isopacks/andrefgneves_iconfont/os/packages/andrefgneves_iconfont/plugin/stylesheet.tpl' types: [ 'svg' 'ttf' @@ -232,7 +232,13 @@ generateStylesheets = (compileStep, options) -> stylesheets = options.stylesheets for fileName, filePath of stylesheets - template = fs.readFileSync path.join(process.cwd(), filePath), 'utf8' + templatePath = path.join process.cwd(), filePath + + if not fs.existsSync templatePath + console.log "\n[iconfont] template file not found at #{templatePath}" + continue + + template = fs.readFileSync templatePath, 'utf8' data = _.template template, glyphCodepointMap: glyphCodepointMap @@ -288,5 +294,8 @@ loadJSONFile = (filePath) -> {} +# Make meteor listen for changes on json files +Plugin.registerSourceHandler 'json', archMatching: 'web', -> + Plugin.registerSourceHandler 'iconfont.json', archMatching: 'web', handler Plugin.registerSourceHandler 'svg', archMatching: 'web', handler diff --git a/smart.json b/smart.json index fb1728b..ae3a941 100644 --- a/smart.json +++ b/smart.json @@ -3,6 +3,6 @@ "description": "Generate an icon font from SVG files", "homepage": "https://github.com/andrefgneves/meteor-iconfont", "author": "Andre Neves (https://twitter.com/seven)", - "version": "0.1.6", + "version": "0.1.7", "git": "https://github.com/andrefgneves/meteor-iconfont.git" }