New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
emojis as a rst transform #73
Conversation
|
||
|
||
def emoji_role(name, rawtext, text, lineno, inliner, options={}, content=[]): | ||
text = text.lower() | ||
LOGGER.warn('The role :emoji:`{0}` is deprecated. Use |{0}| instead'.format(text)) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
why deprecate it?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
because There should be one-- and preferably only one --obvious way to do it. (from the Zen)
default_priority = 210 | ||
|
||
# list from http://www.tortue.me/ | ||
emojis = set([ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is there a way to get this list in a file and/or have a way to update it? New emojis happen every once in a while.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Something like
import re
import requests
re.findall(r'"name">(.*)</span', requests.get('http://www.emoji-cheat-sheet.com/').content.decode('utf8'))
or watch this project
https://github.com/arvida/emoji-cheat-sheet.com
(but not sure if torue.me is up to date with that one)
|
||
# list from http://www.tortue.me/ | ||
emojis = set([ | ||
'bowtie', # NOQA |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just curious... why NOQA that one?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
strictly, it's over-indented
On Fri, Apr 3, 2015 at 3:14 PM, Roberto Alsina notifications@github.com
wrote:
In v6/emoji/emoji.py
#73 (comment):node = nodes.image( uri='http://www.tortue.me/emoji/{0}.png'.format(text), alt=text, classes=['emoji'], ) return [node], []
+class Emojis(Transform):
- """
- Replace some substitutions if they aren't defined in the document.
- """
run before the default Substitutions
- default_priority = 210
list from http://www.tortue.me/
- emojis = set([
'bowtie', # NOQA
Just curious... why NOQA that one?
—
Reply to this email directly or view it on GitHub
https://github.com/getnikola/plugins/pull/73/files#r27745195.
mgaitan.github.io
textosypretextos.com.ar http://textosyprextextos.com.ar
getnikola/nikola#1647 (required for this) has been merged with some changes: |
This patch allow a much simpler way to uses emojis. Instead a verbose role, it's use an standard substitution
|emoji_slug|
if that isn't defined in the document and match one of the available emojis