clj-commons / clj-commons/pretty
feat: annotations/callouts needs a higher level interface
- Dominant language
- Clojure
- Stars
- 623
- Forks
- 29
- Avg merge
- 2m
- Merged PRs (30d)
- 3
Description
Currently, it's a bit low level, and if you want to start with a seq of lines (i.e., read from a file) and just add some callouts, it's a lot of work.
Something more like:
```clojure
(-> file slurp string/split-lines
ann/create-annotation-set
(ann/add-annotation 13 "Rule not allowed here.")
(ann/add-annotation 42 [:bold "This!!"])
(ann/prepare {:style my-style :window 3 :prefix (list "Errors in " [:bold file] ":"})
```
This would build up the lines and annotations data needed and then make one or more calls to ann/annotate-lines) and return the seq of results.
The window is the number of lines before an after the annotation line to include. This operates by dropping some number of lines and modifying the :start-line option.
Contributor guide
No contributing guide indexed for this repository
Research direction
Start by reading the existing ann/annotate-lines entry point and the annotation data it consumes. Trace how lines, annotations, :start-line, and the window option are currently handled. Done means a higher-level pipeline can build an annotation set from input lines, add the shown callouts, prepare the options, and return the annotated results.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- clojure
- Domain
- cli
- Issue type
- Feature
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Active
- Clarity
- Mostly clear
- Newbie friendliness
- 45/100