Skip to content

Commit e30f3a0

Browse files
author
Adam Bradley
committed
allow customizable ionicons
1 parent 328d963 commit e30f3a0

File tree

3 files changed

+8
-12
lines changed

3 files changed

+8
-12
lines changed

builder/cheatsheet/template.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -136,7 +136,7 @@
136136
padding: 20px 0;
137137
}
138138
</style>
139-
<link href="css/{{font_filename}}.css" rel="stylesheet" type="text/css" />
139+
<link href="css/ionicons.css" rel="stylesheet" type="text/css" />
140140
</head>
141141

142142
<body class="characters-off">

builder/generate.py

Lines changed: 3 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -79,9 +79,9 @@ def generate_scss(data):
7979
def generate_css_from_scss(data):
8080
print "Generate CSS From SCSS"
8181

82-
scss_file_path = os.path.join(SCSS_FOLDER_PATH, '%s.scss' % (data['name'].lower()))
83-
css_file_path = os.path.join(CSS_FOLDER_PATH, '%s.css' % (data['name'].lower()))
84-
css_min_file_path = os.path.join(CSS_FOLDER_PATH, '%s.min.css' % (data['name'].lower()))
82+
scss_file_path = os.path.join(SCSS_FOLDER_PATH, 'ionicons.scss')
83+
css_file_path = os.path.join(CSS_FOLDER_PATH, 'ionicons.css')
84+
css_min_file_path = os.path.join(CSS_FOLDER_PATH, 'ionicons.min.css')
8585

8686
cmd = "sass %s %s" % (scss_file_path, css_file_path)
8787
call(cmd, shell=True)
@@ -94,7 +94,6 @@ def generate_css_from_scss(data):
9494
def generate_cheatsheet(data):
9595
print "Generate Cheatsheet"
9696

97-
css_file_path = os.path.join(CSS_FOLDER_PATH, '%s.css' % (data['name'].lower()))
9897
cheatsheet_file_path = os.path.join(ROOT_PATH, 'cheatsheet.html')
9998
template_path = os.path.join(BUILDER_PATH, 'cheatsheet', 'template.html')
10099
icon_row_path = os.path.join(BUILDER_PATH, 'cheatsheet', 'icon-row.html')
@@ -103,10 +102,6 @@ def generate_cheatsheet(data):
103102
template_html = f.read()
104103
f.close()
105104

106-
f = open(css_file_path, 'r')
107-
ionicons_css = f.read()
108-
f.close()
109-
110105
f = open(icon_row_path, 'r')
111106
icon_row_template = f.read()
112107
f.close()
@@ -128,10 +123,8 @@ def generate_cheatsheet(data):
128123
content.append(item_row)
129124

130125
template_html = template_html.replace("{{font_name}}", data["name"])
131-
template_html = template_html.replace("{{font_filename}}", data["name"].lower())
132126
template_html = template_html.replace("{{font_version}}", data["version"])
133127
template_html = template_html.replace("{{icon_count}}", str(len(data["icons"])) )
134-
template_html = template_html.replace("{{ionicons_css}}", ionicons_css )
135128
template_html = template_html.replace("{{content}}", '\n'.join(content) )
136129

137130
f = open(cheatsheet_file_path, 'w')

builder/scripts/generate_font.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,9 @@
3333
build_data['icons'] = []
3434

3535
font_name = manifest_data['name']
36+
m.update(font_name + ';')
37+
m.update(manifest_data['version'] + ';')
38+
m.update(manifest_data['prefix'] + ';')
3639

3740
for dirname, dirnames, filenames in os.walk(INPUT_SVG_DIR):
3841
for filename in filenames:
@@ -115,7 +118,7 @@
115118
if AUTO_WIDTH:
116119
f.autoWidth(0, 0, 512)
117120

118-
fontfile = '%s/%s' % (OUTPUT_FONT_DIR, font_name.lower())
121+
fontfile = '%s/ionicons' % (OUTPUT_FONT_DIR)
119122

120123
build_hash = m.hexdigest()
121124

0 commit comments

Comments
 (0)