Skip to content

Commit

Permalink
favicon.svg and tech in status.json, plus random other stuff that had…
Browse files Browse the repository at this point in the history
…n't been committed
  • Loading branch information
fileformat committed Dec 15, 2018
1 parent 7a0849d commit ca33a40
Show file tree
Hide file tree
Showing 9 changed files with 87 additions and 17 deletions.
9 changes: 9 additions & 0 deletions README.md
Expand Up @@ -4,6 +4,7 @@ Emoji Resources for FileFormat.Info
Images
------
* [EmojiOne](https://www.emojione.com/) - ([GitHub](https://github.com/emojione/emojione/tree/2.2.7/assets) - assets in 2.2.7 branch)
* [EmojiTwo](https://emojitwo.github.io/) - fork of open version of EmojiOne
* [Twemoji](https://github.com/twitter/twemoji/tree/gh-pages/2/svg) from Twitter
* [Gemoji](https://github.com/github/gemoji) from Github
* [Noto](https://github.com/googlei18n/noto-emoji) from Google
Expand Down Expand Up @@ -37,3 +38,11 @@ Unicode Emoji Data
* [Comparison table](http://unicode.org/emoji/charts/full-emoji-list.html) - with images
* [Charts](http://unicode.org/emoji/charts/index.html)

To Do
-----
- [ ] /sample/xxx.svg - canonical example (for use on FFI) + .json with metadata
- [ ] radio buttons for background image/color/none
- [ ] counts on all pages
- [ ] paging when > ?500? images
- [ ] links to FFI (when FFI has new url scheme working)
- [ ] /data subdirectory
4 changes: 2 additions & 2 deletions bin/update-db.py
Expand Up @@ -16,7 +16,7 @@
import urllib.parse
import urllib.request

default_output = os.path.abspath("../docs")
default_output = os.path.abspath("../docs/data")
default_src = "http://unicode.org/Public/emoji/5.0/"

datafiles = {
Expand Down Expand Up @@ -230,7 +230,7 @@ def to_hex(i):
else:
sys.stdout.write("INFO: all non-fully-qualified emoji are mapped\n")

filename = "data.json"
filename = "emoji.json"
sys.stdout.write("INFO: saving to file '%s'\n" % filename)
f = open(os.path.join(args.output, filename), mode='w', encoding='utf-8')
f.write(json.dumps(emojis, ensure_ascii=False, sort_keys=False, indent=4, separators=(',', ': ')))
Expand Down
45 changes: 40 additions & 5 deletions bin/update-dir.py
Expand Up @@ -14,7 +14,7 @@
import tempfile
import time

default_data = "../docs/data.json"
default_data = "../docs/data/emoji.json"

parser = argparse.ArgumentParser()
parser.add_argument("-q", "--quiet", help="hide status messages", default=True, dest='verbose', action="store_false")
Expand All @@ -37,36 +37,70 @@
with open(args.emojidata) as edfp:
emojidata = json.load(edfp, object_pairs_hook=collections.OrderedDict)

count = 0
f = open(os.path.join(srcdir, "base.html"), mode='w', encoding='utf-8')
f.write("---\n")
f.write("title: Base Emoji in %s\n" % args.name)
f.write("tab: base\n")
f.write("---\n")
f.write("{% include tabs.html %}\n")
f.write("<p>")
for key in emojidata:
if "_200d" in key:
continue
if emojidata[key]["status"] != "fully-qualified":
continue
if key in files:
text = emojidata[key]["text"] if "text" in emojidata[key] else key
f.write("<a href=\"https://www.fileformat.info/info/emoji/\"><img src=\"%s.svg\" alt=\"%s\" /></a>\n" % (key, text))

f.write("<a href=\"https://www.fileformat.info/info/emoji/\"><img src=\"%s.svg\" alt=\"%s\" title=\"%s\" /></a>\n" % (key, text, key))
count = count + 1
f.write("</p>")
f.write("<p>Total base emojis: %d</p>" % count)
f.close()

count = 0
f = open(os.path.join(srcdir, "variant.html"), mode='w', encoding='utf-8')
f.write("---\n")
f.write("title: Emoji Variants in %s\n" % args.name)
f.write("tab: variant\n")
f.write("---\n")
f.write("{% include tabs.html %}\n")
f.write("<p>")
for key in emojidata:
if "_200d" not in key:
continue
if emojidata[key]["status"] == "component-only":
continue
if key in files:
text = emojidata[key]["text"] if "text" in emojidata[key] else key
f.write("<a href=\"https://www.fileformat.info/info/emoji/\"><img src=\"%s.svg\" alt=\"%s\" /></a>\n" % (key, text))
f.write("<a href=\"https://www.fileformat.info/info/emoji/\"><img src=\"%s.svg\" alt=\"%s\" title=\"%s\"/></a>\n" % (key, text, key))
count = count + 1
f.write("</p>")
f.write("<p>Total emoji variants: %d</p>" % count)
f.close()

count = 0
f = open(os.path.join(srcdir, "component.html"), mode='w', encoding='utf-8')
f.write("---\n")
f.write("title: Emoji components in %s\n" % args.name)
f.write("tab: component\n")
f.write("---\n")
f.write("{% include tabs.html %}\n")
f.write("<p style=\"background-image:url('/images/background_grid.png');\">")
for key in emojidata:
if "_200d" in key:
continue
if emojidata[key]["status"] != "component-only":
continue
if key in files:
text = emojidata[key]["text"] if "text" in emojidata[key] else key
f.write("<a href=\"https://www.fileformat.info/info/emoji/\"><img src=\"%s.svg\" alt=\"%s\" title=\"%s\" /></a>\n" % (key, text, key))
count = count + 1
f.write("</p>")
f.write("<p>Total emoji components: %d</p>" % count)
f.close()

count = 0
f = open(os.path.join(srcdir, "custom.html"), mode='w', encoding='utf-8')
f.write("---\n")
f.write("title: Non-standard Emoji in %s\n" % args.name)
Expand All @@ -76,7 +110,8 @@
for fn in files:
if fn not in emojidata:
f.write("<p>%s: <img src=\"%s.svg\" alt=\"%s\" /></p>\n" % (fn, fn, fn))

count = count + 1
f.write("<p>Total custom emojis: %d</p>" % count)
f.close()

count = 0
Expand Down
2 changes: 1 addition & 1 deletion bin/update-noto.py
Expand Up @@ -17,7 +17,7 @@
default_branch = "master"
default_output = os.path.join(os.getcwd(), "noto")
default_subdirectory = "svg"
default_mapping = "../docs/normalize.json"
default_mapping = "../docs/data/normalize.json"

parser = argparse.ArgumentParser()
parser.add_argument("-q", "--quiet", help="hide status messages", default=True, dest='verbose', action="store_false")
Expand Down
2 changes: 1 addition & 1 deletion docs/_config.yml
Expand Up @@ -7,7 +7,7 @@ permalink: /blog/:year/:month/:day/:title/index.html
production_url: https://emoji.fileformat.info
title: FileFormat.Info Emoji SVGs
markdown: kramdown
gems:
plugins:
- jekyll-redirect-from
defaults:
-
Expand Down
7 changes: 4 additions & 3 deletions docs/_includes/navbar.html
@@ -1,13 +1,14 @@
{% assign curnav = page.url | remove_first:"/" | split:"/" | first %}
<nav class="navbar navbar-toggleable-md navbar-inverse bg-inverse mb-4 hidden-print">
<div class="container">
<button class="navbar-toggler navbar-toggler-right" type="button" data-toggle="collapse" data-target="#navbarCollapse" aria-controls="navbarCollapse" aria-expanded="false" aria-label="Toggle navigation">
<span class="navbar-toggler-icon"></span>
<span class="navbar-toggler-icon"></span>
</button>
<a class="navbar-brand" href="https://www.fileformat.info/info/emoji/">FileFormat.Info</a>
<div class="collapse navbar-collapse" id="navbarCollapse">
<ul class="navbar-nav mr-auto float-right">
<li class="nav-item{% if page.url == '/' %} active{% endif %}"><a class="nav-link" href="/index.html">Emoji{% if page.url == '/' %} <span class="sr-only">(current)</span>{% endif %}</a></li>
<li class="nav-item{% if page.url == '/noto/' %} active{% endif %}"><a class="nav-link" href="/noto/index.html">Noto{% if page.url == '/noto/' %} <span class="sr-only">(current)</span>{% endif %}</a></li>
<li class="nav-item{% if page.url == '/index.html' or page.url == '/' %} active{% endif %}"><a class="nav-link" href="/index.html">Emoji{% if page.url == '/' %} <span class="sr-only">(current)</span>{% endif %}</a></li>
<li class="nav-item{% if curnav == 'noto' %} active{% endif %}"><a class="nav-link" href="/noto/index.html">Noto{% if page.url == '/noto/' %} <span class="sr-only">(current)</span>{% endif %}</a></li>
</ul>
</div>
</div>
Expand Down
12 changes: 8 additions & 4 deletions docs/_includes/tabs.html
@@ -1,17 +1,21 @@
{% assign curtab = page.url | remove:".html" | split:"/" | last %}
<ul class="nav nav-tabs">
<li class="nav-item">
<a class="nav-link{% if page.tab == 'about'%} active{%endif%}" href="index.html">About</a>
</li>
<li class="nav-item">
<a class="nav-link{% if page.tab == 'base' %} active{%endif%}" href="base.html">Base</a>
<a class="nav-link{% if curtab == 'base' %} active{%endif%}" href="base.html">Base</a>
</li>
<li class="nav-item">
<a class="nav-link{% if page.tab == 'variant' %} active{%endif%}" href="variant.html">Variants</a>
<a class="nav-link{% if curtab == 'variant' %} active{%endif%}" href="variant.html">Variants</a>
</li>
<li class="nav-item">
<a class="nav-link{% if page.tab == 'custom' %} active{%endif%}" href="custom.html">Custom</a>
<a class="nav-link{% if curtab == 'component' %} active{%endif%}" href="component.html">Components</a>
</li>
<li class="nav-item">
<a class="nav-link{% if page.tab == 'missing' %} active{%endif%}" href="missing.html">Missing</a>
<a class="nav-link{% if curtab == 'custom' %} active{%endif%}" href="custom.html">Custom</a>
</li>
<li class="nav-item">
<a class="nav-link{% if curtab == 'missing' %} active{%endif%}" href="missing.html">Missing</a>
</li>
</ul>
21 changes: 21 additions & 0 deletions docs/favicon.svg
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 1 addition & 1 deletion docs/status.json
Expand Up @@ -2,4 +2,4 @@
noindex: true
layout: none
---
{ "success":true, "message":"OK", "commit":"{{site.github.build_revision | default: site.data.build_revision | default: 'null' | slice: 0, 7 }}", "lastmod":"{{site.time|date_to_xmlschema}}" }
{ "success":true, "message":"OK", "commit":"{{site.github.build_revision | default: site.data.build_revision | default: 'null' | slice: 0, 7 }}", "lastmod":"{{site.time|date_to_xmlschema}}", "tech": "Jekyll {{site.github.versions.jekyll | default: site.data.jekyll_version | default: '(unknown)'}}" }

0 comments on commit ca33a40

Please sign in to comment.