Code Monkey home page Code Monkey logo

Comments (15)

aalmiray avatar aalmiray commented on July 19, 2024

checks date. Nope, it's not April 1st. So I guess this is really happening. 👍

Proposed syntax:

meme::<meme_id>[top="memes in asciidoc", bottom="o rly?", lang="en"]

The catch will be to properly identify the meme_id used by memegenerator, as we don't want to build a list of aliases, do we? (how can we keep up with new memes popping up?)

from asciidoctor-extensions-lab.

jbaruch avatar jbaruch commented on July 19, 2024

I think url of image will be more flexible than meme_id. Can be usable outside of scope of memegenerator and won't have the watermark.

from asciidoctor-extensions-lab.

aalmiray avatar aalmiray commented on July 19, 2024

it depends on the meme generator service to be used by the meme macro. Notice the lang option? it may not be supported by others. Also memegenerator.net accepts uploading to img.ur and authenticated users. I guess it makes sense to come up with a list of options this extension must support.

from asciidoctor-extensions-lab.

mojavelinux avatar mojavelinux commented on July 19, 2024

😉

@aalmiray I think you definitely have the right idea. The meme_id could be an id or a URL, and the extension can be smart about what to do. We could also default to English if language isn't specified.

Remember, we can use positional attributes to make it shorter...and quotes are only required if there's a comma in the content.

meme::Y_U_NO[Write memes?]

If we get the meme_generator gem working again, it queries for a list of meme characters, so you can always pull it from the commandline. Actually, the list still works, the generator just fails.

from asciidoctor-extensions-lab.

jbaruch avatar jbaruch commented on July 19, 2024

Wait a second, why you need a service at all? All you need is image as a bg to write on top of it in caps impact bold font. Can't we do it without a service?

from asciidoctor-extensions-lab.

aalmiray avatar aalmiray commented on July 19, 2024

@jbaruch: Ugh, no. I don't want to deal with an image manipulation library that requires a local gem to work.

@mojavelinux: a downside of using a service is recreating the same image with every build, unless some kind of caching/verification is put in place. Agreed on making English the default lang; I was just stating some of the options that may be used ;-)

from asciidoctor-extensions-lab.

mojavelinux avatar mojavelinux commented on July 19, 2024

Absolutely we can. mini_magick (works on Ruby and JRuby). In fact, I just implemented something similar for doing the covers for NFJS, the Magazine. See, real work enables play!

https://github.com/opendevise/editions/blob/master/lib/editions/cover_annotator.rb

from asciidoctor-extensions-lab.

aalmiray avatar aalmiray commented on July 19, 2024

@jbaruch: on the plus side you can use any image you'd like, not just those available in the memegenerator service. I guess a local generator also solves the problem of duplicate images being uploaded.

The other downside I see is grabbing the images in the first place. I guess we can't win them all :P

from asciidoctor-extensions-lab.

mojavelinux avatar mojavelinux commented on July 19, 2024

Good news. The caching stuff is already implemented as part of Asciidoctor Diagram. That's why I think we could actually build on Asciidoctor Diagram APIs to make this extension...at least handle all the outer parts of managing the image and cache.

See https://github.com/asciidoctor/asciidoctor-diagram/blob/master/lib/asciidoctor-diagram/util/diagram.rb#L96

from asciidoctor-extensions-lab.

mojavelinux avatar mojavelinux commented on July 19, 2024

I'd start with using the service, then add the local build as the code matures. hahaha, meme code maturing...isn't that an oxymoron? Or just a moron?

from asciidoctor-extensions-lab.

aalmiray avatar aalmiray commented on July 19, 2024

methinks we need a new meme for this case 😸

from asciidoctor-extensions-lab.

pepijnve avatar pepijnve commented on July 19, 2024

It's a shame ruby doesn't have a graphics api in the std lib. If depending on Java is ok, this kind of code is pretty trivial to write with Graphics2d. The only downside is that you're going to have to provide a URL to the base image; beyond that the syntax can be the same as what was proposed above.

The memegenerator.net service doesn't seem to be very reliable. I was browsing it a bit and I get lots of timeout errors.

from asciidoctor-extensions-lab.

mojavelinux avatar mojavelinux commented on July 19, 2024

This is now implemented in Asciidoctor Diagram. Shall we close this issue?

See https://github.com/asciidoctor/asciidoctor-diagram#the-meme-extension

meme::yunoguy.jpg[Doc writers,Y U NO \\ AsciiDoc]

from asciidoctor-extensions-lab.

pepijnve avatar pepijnve commented on July 19, 2024

The diagram implementaties does the image processing locally though. I had a look at using existing generator services but I couldn't figure out how to make those work without either having to do a search query (and possibly using the wrong image) or specifying the base image via its numeric id. Both seemed rather impractical.

from asciidoctor-extensions-lab.

mojavelinux avatar mojavelinux commented on July 19, 2024

specifying the base image via its numeric id

That's how the YouTube and Vimeo support work, so it's certainly not a foreign concept in the ecosystem.

from asciidoctor-extensions-lab.

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.