diff --git a/Gruntfile.js b/Gruntfile.js
index 0a0b4e0..52a9cdc 100644
--- a/Gruntfile.js
+++ b/Gruntfile.js
@@ -15,6 +15,8 @@ module.exports = function(grunt) {
return string.replace(/[-\\^$*+?.()|[\]{}]/g, '\\$&');
};
+ var generateRatchiconsData = require('./grunt/ratchicons-data-generator.js');
+
// Project configuration.
grunt.initConfig({
pkg: grunt.file.readJSON('package.json'),
@@ -255,12 +257,14 @@ module.exports = function(grunt) {
// Default task(s).
grunt.registerTask('dist-css', ['sass', 'csscomb', 'cssmin']);
grunt.registerTask('dist-js', ['concat', 'uglify']);
- grunt.registerTask('dist', ['clean', 'dist-css', 'dist-js', 'copy']);
+ grunt.registerTask('dist', ['clean', 'dist-css', 'dist-js', 'copy', 'build-ratchicons-data']);
grunt.registerTask('validate-html', ['jekyll', 'validation']);
grunt.registerTask('build', ['dist']);
grunt.registerTask('default', ['dist']);
grunt.registerTask('test', ['dist', 'jshint', 'jscs', 'validate-html']);
+ grunt.registerTask('build-ratchicons-data', generateRatchiconsData);
+
// Version numbering task.
// grunt change-version-number --oldver=A.B.C --newver=X.Y.Z
// This can be overzealous, so its changes should always be manually reviewed!
diff --git a/docs/_data/ratchicons.yml b/docs/_data/ratchicons.yml
new file mode 100644
index 0000000..a44977d
--- /dev/null
+++ b/docs/_data/ratchicons.yml
@@ -0,0 +1,44 @@
+# This file is generated via Grunt task. **Do not edit directly.**
+# See the 'build-ratchicons-data' task in Gruntfile.js.
+
+- icon-and-up
+- icon-back
+- icon-bars
+- icon-caret
+- icon-check
+- icon-close
+- icon-code
+- icon-compose
+- icon-down-nav
+- icon-down
+- icon-download
+- icon-edit
+- icon-forward
+- icon-gear
+- icon-home
+- icon-info
+- icon-left-nav
+- icon-left
+- icon-list
+- icon-more-vertical
+- icon-more
+- icon-pages
+- icon-pause
+- icon-person
+- icon-play
+- icon-plus
+- icon-refresh
+- icon-right-nav
+- icon-right
+- icon-search
+- icon-share
+- icon-sound
+- icon-sound2
+- icon-sound3
+- icon-sound4
+- icon-star-filled
+- icon-star
+- icon-stop
+- icon-trash
+- icon-up-nav
+- icon-up
diff --git a/docs/components.html b/docs/components.html
index 535243c..9cb491f 100644
--- a/docs/components.html
+++ b/docs/components.html
@@ -1269,91 +1269,17 @@ window.addEventListener('push', myFunction);
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+ {% for iconClassName in site.data.ratchicons %}
+
+ {% endfor %}
{% highlight html %}
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+{% for iconClassName in site.data.ratchicons %}
+
+{% endfor %}
{% endhighlight %}
diff --git a/grunt/ratchicons-data-generator.js b/grunt/ratchicons-data-generator.js
new file mode 100644
index 0000000..e60514f
--- /dev/null
+++ b/grunt/ratchicons-data-generator.js
@@ -0,0 +1,34 @@
+/*!
+ * Ratchet Grunt task for Ratchicons data generation
+ * http://goratchet.com
+ * Original script from Bootstrap (http://getbootstrap.com).
+ * Bootstrap is copyright 2014 Twitter, Inc. and licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE).
+ */
+'use strict';
+var fs = require('fs');
+
+module.exports = function generateRatchiconsData() {
+ // Pass encoding, utf8, so `readFileSync` will return a string instead of a
+ // buffer
+ var ratchiconsFile = fs.readFileSync('sass/ratchicons.scss', 'utf8');
+ var ratchiconsLines = ratchiconsFile.split('\n');
+
+ // Use any line that starts with ".icon-" and capture the class name
+ var iconClassName = /^\.(icon-[^\s]+)/;
+ var ratchiconsData = '# This file is generated via Grunt task. **Do not edit directly.**\n' +
+ '# See the \'build-ratchicons-data\' task in Gruntfile.js.\n\n';
+ for (var i = 0, len = ratchiconsLines.length; i < len; i++) {
+ var match = ratchiconsLines[i].match(iconClassName);
+
+ if (match !== null) {
+ ratchiconsData += '- ' + match[1] + '\n';
+ }
+ }
+
+ // Create the `_data` directory if it doesn't already exist
+ if (!fs.existsSync('docs/_data')) {
+ fs.mkdirSync('docs/_data');
+ }
+
+ fs.writeFileSync('docs/_data/ratchicons.yml', ratchiconsData);
+};
diff --git a/sass/ratchicons.scss b/sass/ratchicons.scss
index 3741954..c87d893 100644
--- a/sass/ratchicons.scss
+++ b/sass/ratchicons.scss
@@ -22,44 +22,44 @@
-webkit-font-smoothing: antialiased;
}
-.icon-and-up:before { content: '\e809'; }
-.icon-back:before { content: '\e80a'; }
-.icon-bars:before { content: '\e80e'; }
-.icon-caret:before { content: '\e80f'; }
-.icon-check:before { content: '\e810'; }
-.icon-close:before { content: '\e811'; }
-.icon-code:before { content: '\e812'; }
-.icon-compose:before { content: '\e813'; }
-.icon-down-nav:before { content: '\e814'; }
-.icon-down:before { content: '\e820'; }
-.icon-download:before { content: '\e815'; }
-.icon-edit:before { content: '\e829'; }
-.icon-forward:before { content: '\e82a'; }
-.icon-gear:before { content: '\e821'; }
-.icon-home:before { content: '\e82b'; }
-.icon-info:before { content: '\e82c'; }
-.icon-left-nav:before { content: '\e82d'; }
-.icon-left:before { content: '\e822'; }
-.icon-list:before { content: '\e823'; }
-.icon-more-vertical:before { content: '\e82e'; }
-.icon-more:before { content: '\e82f'; }
-.icon-pages:before { content: '\e824'; }
-.icon-pause:before { content: '\e830'; }
-.icon-person:before { content: '\e832'; }
-.icon-play:before { content: '\e816'; }
-.icon-plus:before { content: '\e817'; }
-.icon-refresh:before { content: '\e825'; }
-.icon-right-nav:before { content: '\e818'; }
-.icon-right:before { content: '\e826'; }
-.icon-search:before { content: '\e819'; }
-.icon-share:before { content: '\e81a'; }
-.icon-sound:before { content: '\e827'; }
-.icon-sound2:before { content: '\e828'; }
-.icon-sound3:before { content: '\e80b'; }
-.icon-sound4:before { content: '\e80c'; }
-.icon-star-filled:before { content: '\e81b'; }
-.icon-star:before { content: '\e81c'; }
-.icon-stop:before { content: '\e81d'; }
-.icon-trash:before { content: '\e81e'; }
-.icon-up-nav:before { content: '\e81f'; }
-.icon-up:before { content: '\e80d'; }
+.icon-and-up { &:before { content: '\e809'; } }
+.icon-back { &:before { content: '\e80a'; } }
+.icon-bars { &:before { content: '\e80e'; } }
+.icon-caret { &:before { content: '\e80f'; } }
+.icon-check { &:before { content: '\e810'; } }
+.icon-close { &:before { content: '\e811'; } }
+.icon-code { &:before { content: '\e812'; } }
+.icon-compose { &:before { content: '\e813'; } }
+.icon-down-nav { &:before { content: '\e814'; } }
+.icon-down { &:before { content: '\e820'; } }
+.icon-download { &:before { content: '\e815'; } }
+.icon-edit { &:before { content: '\e829'; } }
+.icon-forward { &:before { content: '\e82a'; } }
+.icon-gear { &:before { content: '\e821'; } }
+.icon-home { &:before { content: '\e82b'; } }
+.icon-info { &:before { content: '\e82c'; } }
+.icon-left-nav { &:before { content: '\e82d'; } }
+.icon-left { &:before { content: '\e822'; } }
+.icon-list { &:before { content: '\e823'; } }
+.icon-more-vertical { &:before { content: '\e82e'; } }
+.icon-more { &:before { content: '\e82f'; } }
+.icon-pages { &:before { content: '\e824'; } }
+.icon-pause { &:before { content: '\e830'; } }
+.icon-person { &:before { content: '\e832'; } }
+.icon-play { &:before { content: '\e816'; } }
+.icon-plus { &:before { content: '\e817'; } }
+.icon-refresh { &:before { content: '\e825'; } }
+.icon-right-nav { &:before { content: '\e818'; } }
+.icon-right { &:before { content: '\e826'; } }
+.icon-search { &:before { content: '\e819'; } }
+.icon-share { &:before { content: '\e81a'; } }
+.icon-sound { &:before { content: '\e827'; } }
+.icon-sound2 { &:before { content: '\e828'; } }
+.icon-sound3 { &:before { content: '\e80b'; } }
+.icon-sound4 { &:before { content: '\e80c'; } }
+.icon-star-filled { &:before { content: '\e81b'; } }
+.icon-star { &:before { content: '\e81c'; } }
+.icon-stop { &:before { content: '\e81d'; } }
+.icon-trash { &:before { content: '\e81e'; } }
+.icon-up-nav { &:before { content: '\e81f'; } }
+.icon-up { &:before { content: '\e80d'; } }