meyermarcel / annot

Annotate a string line with arrows leading to a description.
MIT License
17 stars 0 forks source link

Arrow style, option to highlight more than one character #1

Closed floscher closed 2 months ago

floscher commented 3 months ago

A small idea for the arrows, I think in the other direction they could look a bit nicer:

 ↑       │
 │   vs  │
 └─      └─►

Also, then the other end of the arrow could be used to highlight more than just one character like this (either automatically extending to the nearest whitespaces, or passing it a start and end index):

The quick brown fox jumps over the lazy dog
    ━┯━━━ ━┯━━━                    ━┯━━
     │     └─► adjective            └─► adjective
     │
     └─► adjective
ccoVeille commented 3 months ago

Maybe, you can have a look at what is done with https://github.com/rhysd/actionlint (hi @rhysd :wave:)

meyermarcel commented 2 months ago

Hey, thanks for your ideas and inputs. I plan to implement ranged annotations to allow usage for example in https://github.com/rhysd/actionlint.

meyermarcel commented 2 months ago

@floscher @ccoVeille If https://github.com/meyermarcel/annot/issues/5 solves the ranged annotations and https://github.com/meyermarcel/annot/issues/4 addresses the custom arrow style, can this issue be closed? :)

ccoVeille commented 2 months ago

Sure, it's great. Please let me know about your progression in https://github.com/rhysd/actionlint or any project you consider using your tool.

ccoVeille commented 2 months ago

I cannot close, so please do

meyermarcel commented 2 months ago

I think it is better if @floscher closes the issue if it is closable :)

floscher commented 2 months ago

@meyermarcel Sure, this can be closed. Feel free to do as much or little about this issue as you want :wink:. At the moment I don't have a real usecase for your project myself, so it was more a suggestion than a real issue/problem I had with it.