Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
Bootstrap
bootstrap
Commits
86dfcd1a
Commit
86dfcd1a
authored
11 years ago
by
Zlatan Vasović
Committed by
Chris Rebert
11 years ago
Browse files
Options
Download
Email Patches
Plain Diff
Add build-glyphicons-data log
Closes #12987
parent
dcffbbab
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
Gruntfile.js
+1
-1
Gruntfile.js
grunt/bs-glyphicons-data-generator.js
+9
-2
grunt/bs-glyphicons-data-generator.js
with
10 additions
and
3 deletions
+10
-3
Gruntfile.js
+
1
-
1
View file @
86dfcd1a
...
@@ -453,7 +453,7 @@ module.exports = function (grunt) {
...
@@ -453,7 +453,7 @@ module.exports = function (grunt) {
// This can be overzealous, so its changes should always be manually reviewed!
// This can be overzealous, so its changes should always be manually reviewed!
grunt
.
registerTask
(
'
change-version-number
'
,
'
sed
'
);
grunt
.
registerTask
(
'
change-version-number
'
,
'
sed
'
);
grunt
.
registerTask
(
'
build-glyphicons-data
'
,
generateGlyphiconsData
);
grunt
.
registerTask
(
'
build-glyphicons-data
'
,
function
()
{
generateGlyphiconsData
.
call
(
this
,
grunt
);
}
);
// task for building customizer
// task for building customizer
grunt
.
registerTask
(
'
build-customizer
'
,
[
'
build-customizer-html
'
,
'
build-raw-files
'
]);
grunt
.
registerTask
(
'
build-customizer
'
,
[
'
build-customizer-html
'
,
'
build-raw-files
'
]);
...
...
This diff is collapsed.
Click to expand it.
grunt/bs-glyphicons-data-generator.js
+
9
-
2
View file @
86dfcd1a
...
@@ -7,7 +7,7 @@
...
@@ -7,7 +7,7 @@
'
use strict
'
;
'
use strict
'
;
var
fs
=
require
(
'
fs
'
);
var
fs
=
require
(
'
fs
'
);
module
.
exports
=
function
generateGlyphiconsData
()
{
module
.
exports
=
function
generateGlyphiconsData
(
grunt
)
{
// Pass encoding, utf8, so `readFileSync` will return a string instead of a
// Pass encoding, utf8, so `readFileSync` will return a string instead of a
// buffer
// buffer
var
glyphiconsFile
=
fs
.
readFileSync
(
'
less/glyphicons.less
'
,
'
utf8
'
);
var
glyphiconsFile
=
fs
.
readFileSync
(
'
less/glyphicons.less
'
,
'
utf8
'
);
...
@@ -17,6 +17,7 @@ module.exports = function generateGlyphiconsData() {
...
@@ -17,6 +17,7 @@ module.exports = function generateGlyphiconsData() {
var
iconClassName
=
/^
\.(
glyphicon-
[^\s]
+
)
/
;
var
iconClassName
=
/^
\.(
glyphicon-
[^\s]
+
)
/
;
var
glyphiconsData
=
'
# This file is generated via Grunt task. **Do not edit directly.**
\n
'
+
var
glyphiconsData
=
'
# This file is generated via Grunt task. **Do not edit directly.**
\n
'
+
'
# See the
\'
build-glyphicons-data
\'
task in Gruntfile.js.
\n\n
'
;
'
# See the
\'
build-glyphicons-data
\'
task in Gruntfile.js.
\n\n
'
;
var
glyphiconsYml
=
'
docs/_data/glyphicons.yml
'
;
for
(
var
i
=
0
,
len
=
glyphiconsLines
.
length
;
i
<
len
;
i
++
)
{
for
(
var
i
=
0
,
len
=
glyphiconsLines
.
length
;
i
<
len
;
i
++
)
{
var
match
=
glyphiconsLines
[
i
].
match
(
iconClassName
);
var
match
=
glyphiconsLines
[
i
].
match
(
iconClassName
);
...
@@ -30,5 +31,11 @@ module.exports = function generateGlyphiconsData() {
...
@@ -30,5 +31,11 @@ module.exports = function generateGlyphiconsData() {
fs
.
mkdirSync
(
'
docs/_data
'
);
fs
.
mkdirSync
(
'
docs/_data
'
);
}
}
fs
.
writeFileSync
(
'
docs/_data/glyphicons.yml
'
,
glyphiconsData
);
try
{
fs
.
writeFileSync
(
glyphiconsYml
,
glyphiconsData
);
}
catch
(
err
)
{
grunt
.
fail
.
warn
(
err
);
}
grunt
.
log
.
writeln
(
'
File
'
+
glyphiconsYml
.
cyan
+
'
created.
'
);
};
};
This diff is collapsed.
Click to expand it.
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment