Comments (17)
forces speech bubbles within the elements of the animals object
can you clarify? not sure what you mean
from cowsay.
You define an animal as
---
%s
---
\
\
animal
Which means the speech bubble will look the same no matter what the input text is. For instance
---
extremely long input that this bubble is clearly not designed for
---
\
\
animal
While if instead animals were defined as
%s
\
\
animal
You could replace the entire speech bubble with one that looks appropriate to the input size.
_________________________________________________________________________
< extremely long input in a bubble created based on input character count >
-------------------------------------------------------------------------
\
\
animal
from cowsay.
Okay.
My cli cowsay has vertical bars instead of carrots, not important really, but just to show you
lorem -s 5 | cowsay
_________________________________________
/ Lorem ipsum dolor sit amet, \
| consectetuer adipiscing elit! Aenean |
| commodo ligula eget dolor? Aenean |
| massa; Cum sociis natoque penatibus et |
| magnis dis parturient montes, nascetur |
| ridiculus mus? Donec quam felis, |
| ultricies nec, pellentesque eu, pretium |
\ quis, sem! /
-----------------------------------------
\ ^__^
\ (oo)\_______
(__)\ )\/\
||----w |
|| ||
I think making this the default would be good. it'd be good to have the bubble envelop the entire string
wrt letting the user specify, can you give a use case? and might it be difficult for the user to know how to give the bubble? i guess you could present options for the bubble that are a set that we know work well.
from cowsay.
any thoughts on this @oganm ? do you want to submit a PR?
opinions @aedobbyn ? do you want this change or no?
from cowsay.
Interesting idea! I think I like it.
@sckott's cli cowsay I think looks good because it's more compact than the full width of the terminal.
As far as implementing something like that, for the top and bottom of the bubble I guess you'd just make a line measured by something like
min(options("width")$width, some_max_width)
to ensure that some_max_width
isn't greater than the user's console width, where either we or the user determine some_max_width
.
Then add |
s for all lines except the first and last, which get /
and \
.
As far as splitting the text up into lines I'm not totally sure but I don't think you wouldn't want to split up the text exactly evenly because that would spread words across multiple lines. So you'd probably want to go with splitting on the last space character without going over min(options("width")$width, some_max_width)
. Does that sound about like what you had in mind @oganm?
from cowsay.
Not sure how much it should be based on the terminal size as it might get too unwieldy. Something adjustable with a smaller default would probably look better. The command cowsay seems to limit it to 44 characters by default
from cowsay.
also sorry about a lack of a PR. didn't have time to look into it
from cowsay.
Yeah sorry I didn't explain well. The idea is that the maximum width would be some_max_width
or 44. We'd have to shrink the speech bubble to less than 44 if the user's console is smaller than that, though. If their console is smaller, then the speech bubble width would just be the user's console width. Does that make sense?
from cowsay.
makes sense @aedobbyn
from cowsay.
Cool cool. If you want to put together a PR @oganm, go for it. Another idea would be to kick it to participants at an upcoming unconf I'm planning on going to since this would be a cool thing for people to talk through implementing. (The idea with this unconf is to let participants contribute to existing packages.) It's your idea, though, so very much up to you!
from cowsay.
If I'm not done by that time feel free to hand it to the unconf. Will try to take a look before that
from cowsay.
Works for me, thanks @oganm
from cowsay.
Hey @oganm and @sckott -- planning on using this issue as a jumping-off point at the upcoming unconf I mentioned, if that's okay with you both. Happy to keep you guys in the loop next weekend as people work on it, if you want!
https://github.com/chirunconf/chirunconf19/issues
from cowsay.
sounds good @aedobbyn
from cowsay.
yep. it's fine 👍
from cowsay.
Awesome, thanks guys!
from cowsay.
@aedobbyn It would be nice to make this change. Would you want to do it, and have time to?
from cowsay.
Related Issues (20)
- why is animals object not exported? HOT 5
- Weird RJSONIO-jsonlite error upon import HOT 4
- jsonlite to suggests
- Grammatically wrong, the Yoda example text is
- retrojunkie.com is offline HOT 1
- Distinct project name, like "Rcowsay"? HOT 1
- parrot?
- 'catfact' error HOT 3
- add worstcat
- Contributing: add guidelines for whats in/out of scope HOT 2
- No message when colors are NULL? HOT 6
- Standardize the spacing above animals' speech bubbles? HOT 4
- Prints everything to stderr instead of stdout HOT 5
- vignette build warning on cran HOT 3
- [feature request] appimage HOT 6
- Fix file request from CRAN
- Simplifying color argument HOT 4
- multicolor not on cran HOT 3
- Add multicolor back if it gets back up on CRAN HOT 1
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 cowsay.