Comments (15)
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.
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.
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.
😉
@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.
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.
@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.
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.
@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.
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.
from asciidoctor-extensions-lab.
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.
methinks we need a new meme for this case 😸
from asciidoctor-extensions-lab.
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.
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.
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.
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)
- Is there a configuration open for using divs instead of tables for admonitions? HOT 1
- mathoid-treeprocessor and new versions of mathoid HOT 4
- npm install mathoid error: Package libffi was not found in the pkg-config search path. HOT 2
- Convert all inline example to use create_inline otherwise it gives "INFO: expected substitution value for custom inline macro to be of type Inline" HOT 5
- Integrate asciidoc-coalescer.rb as extension/converter so as to make it available in the CLI HOT 1
- sectnum offset tree processor always returns 1 or 2 HOT 1
- Make all these extensions installable with gem install HOT 4
- generate pdf with chart block HOT 4
- adding row name to chart HOT 3
- Add a metadata object for year HOT 1
- Add metadata object for tag message HOT 2
- man-inline-macro doesn't generate the correct output in the manpage backend HOT 5
- Section offset plugin fails when creating PDF HOT 4
- Using the Preprocessor ignores ifdef directives HOT 1
- add link to the current script location as comment into the script HOT 6
- Idea: Create file tree containing all included files HOT 2
- Graduate the asciidoc-coalescer.rb script to a separate project HOT 4
- showcomments-preprocessor seems broken with latest asciidoctor HOT 2
- Create summaries from distributed definitions HOT 1
- Help With Callouts: Any Examples? HOT 5
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 asciidoctor-extensions-lab.