Live data from Hacker News

ASCII art for semantic code commenting

asciiflow.com

41–50 of 82 posts

Re: ASCII art for semantic code commenting

#41
post #12

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.

Nice. Though it makes me think it would be nice to have this as a built in code editor minimap feature without the multi line ASCII code. The editor would parse special tags in comments and overlay the minimap with the tag text in big letters.

Re: ASCII art for semantic code commenting

#42
While being an almost daily user of MonoDraw, I utilize Valery Kocubinsky's Table Editor package for Sublime at least a dozen or more times every day. All my daily habit, scheduling, trackers, and labor is in some sort of table. Thank you, Valery!

It isn't maintained but 90% of the features work fine. The project was picked up and is current on Atom.

Grabbing boxes for commenting is within scope of Table Editor but again, Monodraw offers some great flexibility. If you're working with code that's getting printed in a newsletter, drop it in a Monodraw box (remove border) and you can add call-outs on either or both sides of the code and paste it all in the newsletter. Looks nifty, and keeps the aesthetic consistent.

    Sublime Table Editor ... https://packagecontrol.io/packages/Table%20Editor
    Atom Table Editor ...... https://atom.io/packages/table-editor
    Vim .................... https://github.com/dhruvasagar/vim-table-mode

Re: ASCII art for semantic code commenting

#43
post #12

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.

Nice. Though it makes me think it would be nice to have this as a built in code editor minimap feature without the multi line ASCII code. The editor would parse special tags in comments and overlay the minimap with the tag text in big letters.

Yeah, a bit like how CSSEdit used `@group` https://live.staticflickr.com/112/291326042_18115aa3c1_b.jpg

Re: ASCII art for semantic code commenting

#44
post #32

For 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. ─ │ ┌ ┬ ┐ ┄ ┆ ├ ┼ ┤ ╲ ╱ ┈ ┊ └ ┴ ┘ ━ ┃ ┏ ┳ ┓ ┏ ┯ ┓ ┏ ┳ ┓ ┏ ┯ ┓ ┅ ┇ ┣ ╋ ┫ ┣ ┿ ┫ ┠ ╂ ┨ ┠ ┼ ┨ ┉ ┋ ┗ ┻ ┛ ┗ ┷ ┛ ┗ ┻ ┛ ┗ ┷ ┛

I usually copy from wikipedia but that's that's a good idea. In fact, since I have a "cols" command that just prints an ansi-colour table, I've just added "box" to do this.

can you share the contents of your cols script/function/alias?

Re: ASCII art for semantic code commenting

#46

For 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. ─ │ ┌ ┬ ┐ ┄ ┆ ├ ┼ ┤ ╲ ╱ ┈ ┊ └ ┴ ┘ ━ ┃ ┏ ┳ ┓ ┏ ┯ ┓ ┏ ┳ ┓ ┏ ┯ ┓ ┅ ┇ ┣ ╋ ┫ ┣ ┿ ┫ ┠ ╂ ┨ ┠ ┼ ┨ ┉ ┋ ┗ ┻ ┛ ┗ ┷ ┛ ┗ ┻ ┛ ┗ ┷ ┛

Similar here, I use snippets for some of these things as well. As long as you're using a monospace font, I find it nice to take advantage of things like grid layouts in the extra column space for splitting up concepts into groups for example.

Re: ASCII art for semantic code commenting

#47
post #21
post #9

For emacs users, there are some modes with similar functionalities (as expected from emacs!): picture-mode and artist-mode See for example http://xahlee.info/emacs/emacs/emacs_ascii_diagram.html

Came here to say this. If it's text, Emacs can handle it. Oh, also, if you want your ASCII diagrams to render into pretty pictures, I found org-mode + ditaa to work quite nicely: https://www.orgmode.org/worg/org-contrib/babel/languages/ob-...

Another option for rendering (to SVG) is goat:

https://github.com/blampe/goat

Re: ASCII art for semantic code commenting

#48
post #12

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.

Nice. Though it makes me think it would be nice to have this as a built in code editor minimap feature without the multi line ASCII code. The editor would parse special tags in comments and overlay the minimap with the tag text in big letters.

This is one of my favourite features of XCode. If you "// MARK:" lines, they'll show up in the minimap.

Eg. https://miro.medium.com/max/1400/1*j38oOm3Pt5AMnDI3HQ6TGQ.pn...

Screenshot stolen from this Medium[0].

[0]: https://medium.com/@mumtaz.hussain/xcode-11-now-makes-mark-c...

Re: ASCII art for semantic code commenting

#50
post #48

Earlier quoted context omitted.

Nice. Though it makes me think it would be nice to have this as a built in code editor minimap feature without the multi line ASCII code. The editor would parse special tags in comments and overlay the minimap with the tag text in big letters.

This is one of my favourite features of XCode. If you "// MARK:" lines, they'll show up in the minimap. Eg. https://miro.medium.com/max/1400/1*j38oOm3Pt5AMnDI3HQ6TGQ.pn... Screenshot stolen from this Medium[0]. [0]: https://medium.com/@mumtaz.hussain/xcode-11-now-makes-mark-c...

Excellent. I hoped for a similar VS Code extension but found none. There's only Banner comments[0] to ease converting a string to large ASCII letters inline. [0]: https://marketplace.visualstudio.com/items?itemName=heyimfuz...
Post reply on HN