Giter Club home page Giter Club logo

Comments (14)

rtomayko avatar rtomayko commented on August 28, 2024

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.

jbarnette avatar jbarnette commented on August 28, 2024

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 avatar cameronmcefee commented on August 28, 2024

:@cameronmcefee: or something?

I wonder if that would play nicely with current @mentions

from html-pipeline.

jch avatar jch commented on August 28, 2024

I'd pick some unused syntax like jch

from html-pipeline.

cameronmcefee avatar cameronmcefee commented on August 28, 2024

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.

skalnik avatar skalnik commented on August 28, 2024

But that doesn't usually form a link does it? I thought it was just embed the image.

from html-pipeline.

cameronmcefee avatar cameronmcefee commented on August 28, 2024

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.

simeonwillbanks avatar simeonwillbanks commented on August 28, 2024

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 cameronmcefee in any manner.

I hacked up a prototype to review.

Thanks for considering my idea, and any input is appreciated!

from html-pipeline.

yury avatar yury commented on August 28, 2024

I'd like :@cameronmcefee:

from html-pipeline.

jch avatar jch commented on August 28, 2024

@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.

jch avatar jch commented on August 28, 2024

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.

simeonwillbanks avatar simeonwillbanks commented on August 28, 2024

@jch happy new years to you! Yes. 😄

I suggested a service for two reasons:

  1. Flexibility (Gravatar, home grown solution, etc)
  2. 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.

https://0.gravatar.com/avatar/a624cb08e20db3ac4adb6380928a7b11?d=https%3A%2F%2Fidenticons.github.com%2Fde0265f943d367c375979d1fed48bf65.png&r=x&s=140

It can be simplified. Notably, we can replace my GitHub user ID hash with my login.

https://www.gravatar.com/avatar/a624cb08e20db3ac4adb6380928a7b11?d=https%3A%2F%2Fidenticons.github.com%2Fsimeonwillbanks.png&r=x&s=140

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.

jch avatar jch commented on August 28, 2024

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.

simeonwillbanks avatar simeonwillbanks commented on August 28, 2024

@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)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.