Added donut.ascii.svg
Description
Added a new SVG donut with an ASCII design.
This is an alternate implementation to Joe Skeen's original SVG donut; it has been added because it has a different donut design (ASCII).
However, it is not donut-shaped! If anyone has an idea for easily formatting these 4000 lines, please let me know! (@IOKG04 , @joeskeen, @ThatXliner)
Checklist
- [x] I have read and followed the instructions in the README
- [x] I read and followed the basic rules and recommendations
- [x] I have put the language I am adding in the name of this PR
- [x] I have created a file named
donutin thedonutsfolder with the proper file extension - [x] I have added a new key/value pair to
info.jsonwith the proper metadata (Includingdescriptionfor Alternate-Implementation Donuts)
Once I'm back home (in like 8 hours or so) I could make it donut shaped if you are okay with that.
Alternatively I could first program (or try to at least) an automatic donutification program (you can then use).
Already made a very primitive version for donut.jsfuck, though for actual programming languages it of course has to be a little more complex (so it doesn't split keywords for example).
(By automatic donutification program I mean something where you just give it a one line implementation and it outputs a donut, that should work if the programming language follows some assumptions)
Feel free to do it! I will be making a video about this donut today (without the formatting), so if you want to, you can make a follow-up video about the automatic donut formatting program :)
“Auto donut-formatting” is the exact same problem as code formatting.
Essentially you want to create your own formatter. You can parse the code and re-spit out the tokens with added white space. I would look into tree-sitter as a potential language-agnostic parser.
You can also look at Python’s black formatter for inspiration
why do i only see this now after i already made my own parser...
Anyway, i think imma stay with mine, since it it language independent (which is good for languages that arent supported by tree-sitter) and cause I dont want to code this tool in a programming language I dont know.
Still thanks for telling me though :)
I got the svg kinda working and into a kinda donut shape, but cant identify why it still has the error it has rn (cause I dont know scg syntax and mostly guessed my way here)
Anyone got an idea what could be wrong here?: https://drive.google.com/file/d/1hr6joJIqpGXI2xUXR05GD6t-bfgcuvLT/view?usp=sharing
(also I used the older version with the   instead of , cause otherwise it worked even less)
Two things, first the fact that content isn't allowed in trailing sections (which I would assume you noticed), and two, I think using spaces in the tspan causes it to indent... with preserve-whitespace, it automatically parses spaces, without need of the escape sequence. (Noticed that a bit late lol)
I guess the only option left is to split the tspan tags at certain points to make it donut-shaped unless you have some other idea?
One unrelated comment - once this gets merged, you need to add the ASCII SVG to the README for this project (so it's easier to show off what the code should be doing)
I guess the only option left is to split the tspan tags at certain points to make it donut-shaped unless you have some other idea?
That's what I would probably do.
@EvanZhouDev I took where you left off and took a stab at donut-ifying the SVG, and I'm very very close... but it currently outputs something that looks like a cryptid. :laughing:
See my gist
Edit: I switched out animation: ... linear with animation: ... step-end and now it looks like a donut... for about one second then disappears until the animation resets. I tried updating the gist, but it's being dumb.
https://github.com/EvanZhouDev/TheDonutProject/assets/12286274/8da9f8ee-1b6c-4685-8881-850b1e62f95d
I finally got it working! (I've updated my gist)
A total of 1.2 million characters, 824 lines of SVG, and it works!
Here's the closest thing to a screenshot of the code I can get:
I didn't want to push to your branch in case you had a better solution already
Also included in my gist is the NodeJS file I used to generate both the SVG and put it into donut shape. I'm not gonna lie, this has shaken my faith in having an auto-donut formatter where you give it code and it pops out donut-shaped code. Especially with languages like SVG, HTML, etc, where you have both XML stuff and CSS stuff and plaintext stuff you have to be extremely context-aware to know where you can put line breaks and extra spaces. Since every language will have different safe characters to split on and may have different valid split points in different parts of the code, it could be a lost cause to make it work for any language. But... if you do get one working, try it out on all the existing donuts (after collapsing all consecutive whitespaces) and see if it works. It may work for one language, but not many.
@joeskeen This looks great, but is there any reason you know it is kinda flickering up and down? It's a bit jarring 😅