Compare commits

...
3 Commits
Author SHA1 Message Date
Brandy Carney 368a069e52 chore(): rename driftyco to ionic-team 2019-01-14 11:40:41 -05:00
Daniel Sogl 5f3fed9a90 refactor(): rename driftyco 2017-06-01 14:50:58 +02:00
Drew Rygh 60b66de3e2 Revert "add ionic-site ionicons docs generator script"
This reverts commit a75338ac3e.
2016-01-14 14:56:15 -06:00
3 changed files with 3 additions and 10028 deletions
-64
View File
@@ -30,7 +30,6 @@ def main():
generate_cheatsheet(data)
generate_mode_cheatsheet(data)
generate_icon_comparison(data)
generate_site_index_file()
def generate_font_files():
@@ -427,68 +426,5 @@ def get_tag_data():
return data
def generate_site_index_file():
BASE_TMPL = """
<div id="%s" style="display:none;">
<h2 class="title">%s</h2>
<ul class="modal-icons">%s</ul>
"""
ICON_TMPL = """
<li>
<i class="%s"></i>
<code>%s</code>
</li>
"""
USAGE_TMPL = """
<h4 class="modal-subtitle">Usage:</h4>
{%% highlight html %%}
<!--Basic: auto-select the icon based on the platform -->
<ion-icon name="%s"></ion-icon>
<!-- Advanced: explicity set the icon for each platform -->
%s
{%% endhighlight %%}
</div>
"""
def build_usage_block(icons):
output = ""
for i in icons:
output += ICON_TMPL % ('ion-'+i['name'], i['name'])
return output
def build_advanced_icon(icons):
output = ""
ADV_ICON_TMPL = '<ion-icon ios="%s" md="%s"></ion-icon>'
non_outline_icons = [i for i in icons if '-outline' not in i['name']]
if (len(non_outline_icons) >= 2):
return ADV_ICON_TMPL % (non_outline_icons[0]['name'],
non_outline_icons[1]['name'])
if (len(non_outline_icons) == 1):
return ADV_ICON_TMPL % (non_outline_icons[0]['name'], non_outline_icons[0]['name'])
f = codecs.open(os.path.join(DATA_PATH, 'ionicons.json'), 'r', 'utf-8')
data = json.loads(f.read())
f.close()
all_icons = data.items()
OUTPUT = ""
for icon_set in all_icons:
set_name = icon_set[0]
icons = icon_set[1]['icons']
section_part_1 = BASE_TMPL % (set_name, set_name,
build_usage_block(icons))
section_part_2 = USAGE_TMPL % (set_name, build_advanced_icon(icons))
OUTPUT += (section_part_1 + section_part_2)
html_path = os.path.join(BUILDER_PATH, 'ionic-site', 'ionicons-data.html')
f2 = codecs.open(html_path, 'w', 'utf-8')
f2.write(OUTPUT)
f2.close()
if __name__ == "__main__":
main()
File diff suppressed because it is too large Load Diff
+3 -3
View File
@@ -17,13 +17,13 @@
],
"repository": {
"type": "git",
"url": "https://github.com/driftyco/ionicons.git"
"url": "https://github.com/ionic-team/ionicons.git"
},
"bugs": {
"url" : "https://github.com/driftyco/ionicons/issues"
"url" : "https://github.com/ionic-team/ionicons/issues"
},
"license": "MIT",
"engines" : {
"node" : ">=0.10.3"
}
}
}