Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
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
You can’t perform that action at this time.