Skip to content

Instantly share code, notes, and snippets.

@mhayes
Last active December 24, 2015 02:49
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save mhayes/6732892 to your computer and use it in GitHub Desktop.
Save mhayes/6732892 to your computer and use it in GitHub Desktop.
Font Icon Sample Page Generator
# 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