Comments (14)
Kind of love it personally. 👍 Some will conflict with real emoji so I wonder if it'd be better to use a different syntax. :@cameronmcefee: or something?
from html-pipeline.
Pretty cool secret feature. :)
On Fri, Jun 14, 2013 at 5:12 PM, Ryan Tomayko [email protected]:
Kind of love it personally. [image: 👍] Some will conflict with real
emoji so I wonder if it'd be better to use a different syntax. :
@cameronmcefee https://github.com/cameronmcefee: or something?—
Reply to this email directly or view it on GitHubhttps://github.com//issues/56#issuecomment-19487983
.
from html-pipeline.
:@cameronmcefee: or something?
I wonder if that would play nicely with current @mentions
from html-pipeline.
I'd pick some unused syntax like jch
from html-pipeline.
since it's going to be an image and a link, what if we just used an already expected syntax?
![Cameron McEfee](@cameronmcefee)
from html-pipeline.
But that doesn't usually form a link does it? I thought it was just embed the image.
from html-pipeline.
They come in as a link to the source. Since we'd be modifying the behavior a bit to link it to a profile that may not be ideal
from html-pipeline.
Hello All,
May I help by implementing this filter?
As I see it, the filter is responsible for parsing the document, locating ~cameronmcefee~
(or similar) strings, and replacing those with an avatar linked to a profile (using context base_url
). It's very similar to the current MentionFilter
.
Also, the filter can depend upon a service, and the service is responsible for converting a profile string into an avatar. This way, an application can implement cameronmcefee
to in any manner.
I hacked up a prototype to review.
Thanks for considering my idea, and any input is appreciated!
from html-pipeline.
I'd like :@cameronmcefee:
from html-pipeline.
@simeonwillbanks happy new years! Just revisiting old issues lying around. Are you still interested in turning your prototype into a pull request?
As far as feedback, I'm not a fan of the indirection of passing in a service. Yes, it is more flexible, but at this level, the code does nothing and leaves all the work to be done by the service. I'd rather just have common gravatar features passed in.
from html-pipeline.
Also, ~
may not be a good delimiter because ~~
are already used for strikethroughs by github-markdown. edit: maybe the delimiter can be a passed in option that has a sane default.
from html-pipeline.
@jch happy new years to you! Yes. 😄
I suggested a service for two reasons:
- Flexibility (Gravatar, home grown solution, etc)
- Likelihood of login to avatar being non-deterministic
With Gravatar, login to avatar isn't deterministic. 😦 Gravatar requires an email hash for the avatar URL.
However, you make a solid point. Let's review a Gravatar URL, and see what a Filter
could build. I grabbed mine from this comment.
It can be simplified. Notably, we can replace my GitHub user ID hash with my login.
The new Filter
could receive Gravatar params and have sensible defaults like &r=x&s=25
.
The Default Image is a bit trickier. Maybe the Filter
defines a constant which aids a search and replace?
login = "simeonwillbanks"
class Filter
TOKEN = "__login_token__"
end
# default_image_url sent to Filter and references Filter::TOKEN
default_image_url = "https://identicons.github.com/#{Filter::TOKEN}.png"
default_image_url.sub Filter::TOKEN, login
#=> "https://identicons.github.com/simeonwillbanks.png"
The email hash requires a simpler service than the prototype service.
# Filter receives service
# Service defines login_to_email
email = service.login_to_email "simeonwillbanks"
# => "[email protected]"
email_hash = Digest::MD5.hexdigest email
#=> "a624cb08e20db3ac4adb6380928a7b11"
basic_gravatar_url = "https://www.gravatar.com/avatar/#{email_hash}"
#=> "https://www.gravatar.com/avatar/a624cb08e20db3ac4adb6380928a7b11"
Thoughts?
Also, 👍 for passed in delimiter with sane default.
Thanks!
from html-pipeline.
Flexibility (Gravatar, home grown solution, etc)
That's a good point. If that's the case, I'd suggest naming your filter something more descriptive. Maybe just AvatarFilter
for the generic interface that takes a service, and GravatarService
or GravatarFilter
for the concrete implementation.
I like that this filter doesn't add any external code dependencies. Normally, I wouldn't want to depend on a 3rd party external service either, but Gravatar's been around for a long time and feels like the common choice.
from html-pipeline.
@jch Thanks!
An interface with a concrete implementation is a good idea.
Agreed. I'll start a branch, and commit early and often. We can hammer out the specifics.
from html-pipeline.
Related Issues (20)
- 2.14.0 is disconnected HOT 4
- Allow `loading` attribute on images HOT 5
- Since bump 2.14.2 builds are failing HOT 3
- Allow vertical-align HOT 1
- Indicate a version for activesupport that has support/receives security patches (>= 6?) HOT 2
- v3: Question regarding requiring a ConvertFilter if there are NodeFilters HOT 1
- v3 gemoji, gemojione seem required - is there a way to not require at puma startup? HOT 2
- Suggestion: add more tags to the sanitization filter HOT 3
- So what DOES GitHub use now? HOT 1
- ActionView::Template::Error with version 3.0.0 HOT 8
- Bug in specification of node filters in v3.0.0 HOT 1
- convert_filter only executed when node_filters are present HOT 3
- Can't seem to get a <script> to run when added to the allowlist? HOT 2
- Error when passing instance of `TextFilter` class to `text_filters` option HOT 3
- Context & result of filters except for text_filters aren't overwritten on call time HOT 3
- Sanitizing inline style attributes HOT 2
- Question about original and new SanitizationFilter HOT 2
- Why are node_filters applied twice? HOT 3
- Update to 3.3.4? HOT 2
- v3.2.1 is badly broken, I think because of PR #408 HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from html-pipeline.