This commit is contained in:
octospacc 2022-09-02 00:48:54 +02:00
parent c9d369475c
commit 5e1087707c
8 changed files with 27 additions and 11051 deletions

3
.gitignore vendored Normal file
View File

@ -0,0 +1,3 @@
twemoji/
twemoji-astonishing.css
twemoji-astonishing.min.css

View File

@ -1,9 +1,10 @@
#!/usr/bin/env python3
import os
import unicodedata
from time import ctime
from urllib.request import urlopen
Name = "twemoji-amazing"
Name = "twemoji-astonishing"
EmojiVer = "15.0"
# https://stackoverflow.com/a/518232
@ -11,8 +12,6 @@ def StripAccents(s):
return ''.join(c for c in unicodedata.normalize('NFD', s)
if unicodedata.category(c) != 'Mn')
#https://unpkg.com/emoji.json@13.1.0/emoji.json
def ReplaceList(Text, Match, Replace):
for m in Match:
Text = Text.replace(m, Replace)
@ -58,11 +57,14 @@ def Main():
for Line in Data.splitlines():
if CheckEmojiLine(Line):
Emojis += [GetEmojiMeta(Line)]
EmojiCount = str(len(Emojis))
print(f"[I] Writing CSS")
CSS = ""
with open("Preamble.css", "r") as f:
CSS += f.read()
CSS += f.read() + "\n"
with open("Comment.css", "r") as f:
Comment = f.read().replace("{BuildTime}", ctime()).replace("{EmojiCount}", EmojiCount)
for Emoji in Emojis:
CSS += f"""\
.twa-{Emoji["Name"]}, .twa-{Emoji["Char"]} {{
@ -70,9 +72,9 @@ def Main():
}}
"""
with open(f"{Name}.css", "w") as f:
f.write(CSS)
f.write(CSS.replace("/*{CommentBlock}*/", Comment))
with open(f"{Name}.min.css", "w") as f:
f.write(MinifyCSS(CSS))
f.write(MinifyCSS(CSS).replace("/*{CommentBlock}*/", "\n"+Comment))
if __name__ == "__main__":
Main()

10
Comment.css Normal file
View File

@ -0,0 +1,10 @@
/*
Generated by twemoji-astonishing, available at https://gitlab.com/octtspacc/twemoji-astonishing;
Graphics licensed under CC BY 4.0: https://github.com/twitter/twemoji.
Built on {BuildTime};
Generated {EmojiCount} emoji CSS classes.
Preamble from https://github.com/SebastianAigner/twemoji-amazing,
licensed under MIT: https://mit-license.org.
*/

4
Comment.min.css vendored Normal file
View File

@ -0,0 +1,4 @@
/*
License: MIT and CC BY 4.0.
Details and Sources: https://gitlab.com/octtspacc/twemoji-astonishing.
*/

View File

@ -1,13 +1,5 @@
@charset "UTF-8";
/*
Generated by twemoji-astonishing, available at https://gitlab.com/octtspacc/twemoji-astonishing;
Graphics are licensed under CC-BY 4.0: https://github.com/twitter/twemoji.
Generated a total of {EmojiCount} emoji CSS classes.
Preamble from https://github.com/SebastianAigner/twemoji-amazing,
licensed under MIT: https://mit-license.org.
*/
/*{CommentBlock}*/
.twa {
display: inline-block;
@ -64,5 +56,3 @@
vertical-align: -0.5em;
background-size: 5em 5em;
}
/* End preamble; begin emoji classes. */

View File

@ -5,4 +5,4 @@ License for our scripts: [MIT](https://mit-license.org).
Uses CSS snippets from [twemoji-amazing](https://github.com/SebastianAigner/twemoji-amazing), licensed under [MIT](https://mit-license.org).
The project exists solely on top of [Twemoji](https://twemoji.twitter.com).
The graphics are licensed under [CC-BY 4.0](https://creativecommons.org/licenses/by/4.0). Please adhere to the [Twemoji attribution requirements](https://github.com/twitter/twemoji#attribution-requirements) when using these emojis.
The graphics are licensed under [CC BY 4.0](https://creativecommons.org/licenses/by/4.0). Please adhere to the [Twemoji attribution requirements](https://github.com/twitter/twemoji#attribution-requirements) when using these emojis.

File diff suppressed because it is too large Load Diff

File diff suppressed because one or more lines are too long