For longer CSS files I use ASCII text to mark and visually separate the breakpoints. An advantage of this is the ability to see the breakpoints in the minimap. Something like this: https://css-tricks.com/wp-content/uploads/2015/09/mini-map.j... There's even a Sublime Text plugin to generate this text.
At that point it would be better to just split it into several files though.
ASCII art for semantic code commenting
51–60 of 82 posts
Re: ASCII art for semantic code commenting
#52For what it's worth, I keep a file in my home folder containing some box drawing characters. It's not super fast to draw by copy-paste but the result usually looks quite nice. ─ │ ┌ ┬ ┐ ┄ ┆ ├ ┼ ┤ ╲ ╱ ┈ ┊ └ ┴ ┘ ━ ┃ ┏ ┳ ┓ ┏ ┯ ┓ ┏ ┳ ┓ ┏ ┯ ┓ ┅ ┇ ┣ ╋ ┫ ┣ ┿ ┫ ┠ ╂ ┨ ┠ ┼ ┨ ┉ ┋ ┗ ┻ ┛ ┗ ┷ ┛ ┗ ┻ ┛ ┗ ┷ ┛
Re: ASCII art for semantic code commenting
#53Like, Visual Studio Code supports something like this:
https://marketplace.visualstudio.com/items?itemName=joaompin...
Re: ASCII art for semantic code commenting
#54For what it's worth, I keep a file in my home folder containing some box drawing characters. It's not super fast to draw by copy-paste but the result usually looks quite nice. ─ │ ┌ ┬ ┐ ┄ ┆ ├ ┼ ┤ ╲ ╱ ┈ ┊ └ ┴ ┘ ━ ┃ ┏ ┳ ┓ ┏ ┯ ┓ ┏ ┳ ┓ ┏ ┯ ┓ ┅ ┇ ┣ ╋ ┫ ┣ ┿ ┫ ┠ ╂ ┨ ┠ ┼ ┨ ┉ ┋ ┗ ┻ ┛ ┗ ┷ ┛ ┗ ┻ ┛ ┗ ┷ ┛
Do you have an example context in which you'd use these? I've never thought to do this and am curious about the possibilities and use cases.
Re: ASCII art for semantic code commenting
#55This is a neat tool, but unfortunately, text art like this generates is extremely unfriendly to folks that use screen readers. If you do use this for comment documentation, consider making sure that there is also a written description above/below it with equivalent descriptive content.
Re: ASCII art for semantic code commenting
#56If you use nvim, there is a similar tool called venn.nvim: https://github.com/jbyuki/venn.nvim
Re: ASCII art for semantic code commenting
#57Programming tooling really is living in the dark ages sometimes.
Re: ASCII art for semantic code commenting
#58Earlier quoted context omitted.
Do you have an example context in which you'd use these? I've never thought to do this and am curious about the possibilities and use cases.
Basically I use the same kind of philosophy as RFCs, and document things using ascii art where some kind of diagram makes sense. For example, see the TCP RFC https://datatracker.ietf.org/doc/html/rfc793 where they use it for packet layout, flow diagrams, block diagrams, etc. It makes the whole thing self contained, you can copy paste diagrams to almost anywhere, easy to modify. Disadvantage is in some more complex di…
Re: ASCII art for semantic code commenting
#59Re: ASCII art for semantic code commenting
#60EDIT: Deleted before I get even more downvotes.
On a general note, I think it's time to call things "text" instead of "ascii". Every time someone utters the word "ascii", they just mean text. Saying “I'm using ASCII” doesn't mean anything anymore, because nobody uses EBCDIC anymore – you are, no matter what, effectively using a superset of ASCII, by default UTF-8. The real question is which one.
I get what you're saying, but I have seen bugs at work caused by distributed systems sending text in ASCII or UTF8 to an IBM z/OS mainframe with EBCDIC.