Last active
December 24, 2015 02:49
-
-
Save mhayes/6732892 to your computer and use it in GitHub Desktop.
Font Icon Sample Page Generator
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Generate font icon page for reference | |
FONT = /^\.(sportisaicon[^:]+):before {/ | |
paths = [ | |
"fonts/custom_font_1.css", | |
"fonts/custom_font_2.css" | |
] | |
paths.each do |pth| | |
list_html = "<h2 class='subheader'>#{pth}</h2>" | |
list_html += "<ul class='large-block-grid-4'>" | |
File.open(pth) do |f| | |
f.each_line do |line| | |
m = FONT.match(line) | |
if m | |
markup = "<i class=\"#{m[1]}\">#{m[1]}</i>" | |
copy_markup = "<i class=\"#{m[1]}\"></i>" | |
list_html += "<li>#{markup}<div><input type='text' value='#{copy_markup}' /></div></li>" | |
end | |
end | |
end | |
list_html += "</ul>" | |
puts list_html | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment