Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Annotations #185

Merged
merged 19 commits into from
Dec 21, 2022
Merged

Annotations #185

merged 19 commits into from
Dec 21, 2022

Conversation

FedeClaudi
Copy link
Owner

@FedeClaudi FedeClaudi commented Dec 20, 2022

Working on a new feature: text annotations.

image

  • basic functionality
  • multiple annotations
  • tests
  • docs

Edit:

Usage:

using Term
using Term.Annotations
import Term: highlight_syntax, TERM_THEME

Annotation(
    highlight_syntax("Panel(content; fit=true)"),
    "Panel" => ("this is the struct constructor call", TERM_THEME[].func),
    "content" => ("here you put what goes inside the panel", "white"),
    "fit=true" => (
        "Setting this as `true` adjusts the panel's width to fit `content`. Otherwise `Panel` will have a fixed width",
        "bright_blue",
    ),
) |> print

output:
image

@codecov-commenter
Copy link

codecov-commenter commented Dec 20, 2022

Codecov Report

Merging #185 (7328868) into master (2bac8f3) will increase coverage by 0.57%.
The diff coverage is 96.33%.

@@            Coverage Diff             @@
##           master     #185      +/-   ##
==========================================
+ Coverage   89.27%   89.84%   +0.57%     
==========================================
  Files          36       38       +2     
  Lines        2414     2491      +77     
==========================================
+ Hits         2155     2238      +83     
+ Misses        259      253       -6     
Impacted Files Coverage Δ
src/prompt.jl 68.51% <ø> (+0.09%) ⬆️
src/repr.jl 95.65% <ø> (ø)
src/theme.jl 100.00% <ø> (ø)
src/link.jl 75.67% <25.00%> (+3.88%) ⬆️
src/Term.jl 90.00% <50.00%> (+10.00%) ⬆️
src/__text_utils.jl 88.78% <100.00%> (+1.04%) ⬆️
src/_code.jl 100.00% <100.00%> (ø)
src/_repr.jl 92.59% <100.00%> (ø)
src/_text_reshape.jl 100.00% <100.00%> (ø)
src/annotations.jl 100.00% <100.00%> (ø)
... and 11 more

📣 We’re building smart automated test selection to slash your CI/CD build times. Learn more

@FedeClaudi FedeClaudi marked this pull request as ready for review December 21, 2022 03:14
@FedeClaudi FedeClaudi merged commit ae9c40d into master Dec 21, 2022
@FedeClaudi FedeClaudi deleted the annotations branch December 21, 2022 23:09
FedeClaudi added a commit that referenced this pull request Feb 4, 2023
* CompatHelper: add new compat entry for WordTokenizers at version 0.5, (keep existing compat) (#171)

Co-authored-by: CompatHelper Julia <compathelper_noreply@julialang.org>

* Stack traces (#179)

* styling

* now excludes other installed packages + fmt and tests

* small improvements ot hidden frames

* format and docs

* small fixes

* fmt

* kwarg func call fmt

* show each error line code

* covergage

* stacktrace formatting

* traces rendering improvements

* test fix

* new text reshaping function from chatgpt

* fixed tests

* cleanup

* cleanup

* bump

* bump

* bump

* prompt init

* small fixes to repr and error

* fixed small repr bugs

* removed deps

* wip errors

* method error kwargs call

* parsed kwargs calls in stackrace

* fixes

* method error edge cases

* bump

* bump

* bump

* fixed textlen bug for orphaned tags

* Update Project.toml

* Update Project.toml

* errors with no backtrace are now shown

* logger doesn't cut msgs

* CI fix

* error msg panel now always shows

* reworked logs rendering code

* msg reshaping

* refactored stacktrace code + further logs improvements

* fixed bug with markdown rendering

* Link renderable development (#180)

* bump

* bump

* working on making Link work

* functional link?

* fixing them errors

* fixed behavior of hidden frames in stacktrace and docs

* fixed bugs

* bugs fixed and more test

* bugfix

* tests fix

* tests fixing

* tests fix

* tests fix

* Fix #181 (#182)

* small fixes

* bump

* `Prompt` (#175)

* prompt init

* small fixes to repr and error

* fixed small repr bugs

* removed deps

* wip errors

* bump

* bump

* bump

* bump

* prompt wip

* bump

* prompt almost finished

* added tests and docs for prompt

* bump

* coverage and CI

* docs fix

* Update _error_messages.jl

* Annotations (#185)

* init

* more extensive precompilation

* small fixes for error IO

* 204 method invalidation at startup ops

* bump

* working on annotation

* added style

* bump

* disabled precompilation

* new code reshaping function

* new annotation system

* tests for annotations passing

* fmt

* more tests

* bump

* bump

* ci fix

* bump

Co-authored-by: Federico Claudi <federicoclaudi@imac.mynetworksettings.com>

* Create Invalidations.yml

* Create unused_dependencies.yml

* Update Invalidations.yml

* Update Invalidations.yml

* Update CI.yml

* Update CI.yml

* Coverage - adding more tests (#186)

* increasing test coverage

* fixed bug with markup tags including newline

* test coverage

* bump

* bump

* bump

* bump

* bump

* CI fix

* CI fix

* CI fix

* CI fix

* bump

* Update CI.yml

* bump

* refactored tree

* CI fix

* docs

* Update unused_dependencies.yml

* ci fix

* Update Invalidations.yml

* removed fillin(segments)

* Update CI.yml

* fmt

* bump

* removed error message functionality, using base

* bump

* fix_markup_across_lines (#188)

* fix_markup_across_lines

* tests passing

* fixed small things

* bump

* wip for fix_ansi_across_lines

* fixed nested style tags

* reshaping with ANSI and markup works well

* fmt

* bump

* bump

* bump

* removed unused funcs

* docstring

* small fixes

* bump

* Update CI.yml

* Working on pre-compilation (#173)

* init

* more extensive precompilation

* small fixes for error IO

* 204 method invalidation at startup ops

* bump

* cleaned up precompilation

* removed deps

* bump

Co-authored-by: Federico Claudi <federicoclaudi@imac.mynetworksettings.com>

* CompatHelper: add new compat entry for AbstractTrees at version 0.4, (keep existing compat) (#189)

Co-authored-by: CompatHelper Julia <compathelper_noreply@julialang.org>

* bump

* no stdout in precomp (#191)

* no stdout in precomp

* ignore precompilation code in coverage

* finished re-factoring tree

* CI fix

---------

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
Co-authored-by: CompatHelper Julia <compathelper_noreply@julialang.org>
Co-authored-by: Rémi Vezy <VEZY@users.noreply.github.com>
Co-authored-by: Federico Claudi <federicoclaudi@imac.mynetworksettings.com>
FedeClaudi added a commit that referenced this pull request Feb 5, 2023
* Live first push

* bump

* bump

* pager almost ready

* pager ready

* making progress with menu

* making progress with menu

* hacky but working

* reduced flicker

* progress on making progress a Live

* redirect tsdout

* bump

* test

* introspection fmt + error fmt

* bump

* bump

* CompatHelper: add new compat entry for WordTokenizers at version 0.5, (keep existing compat) (#171)

Co-authored-by: CompatHelper Julia <compathelper_noreply@julialang.org>

* Stack traces (#179)

* styling

* now excludes other installed packages + fmt and tests

* small improvements ot hidden frames

* format and docs

* small fixes

* fmt

* kwarg func call fmt

* show each error line code

* covergage

* stacktrace formatting

* traces rendering improvements

* test fix

* new text reshaping function from chatgpt

* fixed tests

* cleanup

* cleanup

* bump

* bump

* bump

* prompt init

* small fixes to repr and error

* fixed small repr bugs

* removed deps

* wip errors

* method error kwargs call

* parsed kwargs calls in stackrace

* fixes

* method error edge cases

* bump

* bump

* bump

* fixed textlen bug for orphaned tags

* Update Project.toml

* Update Project.toml

* errors with no backtrace are now shown

* logger doesn't cut msgs

* CI fix

* error msg panel now always shows

* reworked logs rendering code

* msg reshaping

* refactored stacktrace code + further logs improvements

* fixed bug with markdown rendering

* Link renderable development (#180)

* bump

* bump

* working on making Link work

* functional link?

* fixing them errors

* fixed behavior of hidden frames in stacktrace and docs

* fixed bugs

* bugs fixed and more test

* bugfix

* tests fix

* tests fixing

* tests fix

* tests fix

* Fix #181 (#182)

* small fixes

* bump

* `Prompt` (#175)

* prompt init

* small fixes to repr and error

* fixed small repr bugs

* removed deps

* wip errors

* bump

* bump

* bump

* bump

* prompt wip

* bump

* prompt almost finished

* added tests and docs for prompt

* bump

* coverage and CI

* docs fix

* Update _error_messages.jl

* Annotations (#185)

* init

* more extensive precompilation

* small fixes for error IO

* 204 method invalidation at startup ops

* bump

* working on annotation

* added style

* bump

* disabled precompilation

* new code reshaping function

* new annotation system

* tests for annotations passing

* fmt

* more tests

* bump

* bump

* ci fix

* bump

Co-authored-by: Federico Claudi <federicoclaudi@imac.mynetworksettings.com>

* Create Invalidations.yml

* Create unused_dependencies.yml

* Update Invalidations.yml

* Update Invalidations.yml

* Update CI.yml

* Update CI.yml

* Coverage - adding more tests (#186)

* increasing test coverage

* fixed bug with markup tags including newline

* test coverage

* bump

* bump

* bump

* bump

* bump

* CI fix

* CI fix

* CI fix

* CI fix

* bump

* Update CI.yml

* bump

* refactored tree

* CI fix

* docs

* Update unused_dependencies.yml

* ci fix

* Update Invalidations.yml

* removed fillin(segments)

* Update CI.yml

* fmt

* bump

* removed error message functionality, using base

* bump

* fix_markup_across_lines (#188)

* fix_markup_across_lines

* tests passing

* fixed small things

* bump

* wip for fix_ansi_across_lines

* fixed nested style tags

* reshaping with ANSI and markup works well

* fmt

* bump

* bump

* bump

* removed unused funcs

* docstring

* small fixes

* bump

* Update CI.yml

* Working on pre-compilation (#173)

* init

* more extensive precompilation

* small fixes for error IO

* 204 method invalidation at startup ops

* bump

* cleaned up precompilation

* removed deps

* bump

Co-authored-by: Federico Claudi <federicoclaudi@imac.mynetworksettings.com>

* CompatHelper: add new compat entry for AbstractTrees at version 0.4, (keep existing compat) (#189)

Co-authored-by: CompatHelper Julia <compathelper_noreply@julialang.org>

* bump

* restored to old LiveInternals

* small improvements

* simple menu

* working on help message

* working on help

* added multi select menu

* bump

* help tooltip working

* small fixes

* pager with liner numbers and scrollbar

* tab viewer refactor

* improved key controls

* refactor

* more widgets and improvements

* tabviewer improvemens

* fixed scrollbar

* fixed introspection

* compositor accepts fractional values

* added apply_style to ren and removed extra style resets from boxes and panels

* removed apply style for renderables and working on app

* menu can be horizontal

* added gallery

* refactor

* small fixes

* RGB example

* inspect re-worked

* refactor

* bump

* reverted to master progress bar

* tests passing

* tests passing

* refactoring controls

* no stdout in precomp (#191)

* no stdout in precomp

* ignore precompilation code in coverage

* working on controls

* debug mode and working controls

* small imrpvoements

* removed live internals from widgets

* all widgets play through app

* bump

* small fixes

* working on responsive app size

* working on resposive

* pager improvements

* tictactoe

* small improvements

* tests fix

* bump

* widget internals

* transitions inferred from layout

* wip

* all widgets work

* added help msg

* help msg

* bump

* finished re-factoring tree

* CI fix

* added test

* CI fix

* bump

---------

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
Co-authored-by: CompatHelper Julia <compathelper_noreply@julialang.org>
Co-authored-by: Rémi Vezy <VEZY@users.noreply.github.com>
Co-authored-by: Federico Claudi <federicoclaudi@imac.mynetworksettings.com>
FedeClaudi added a commit that referenced this pull request Feb 6, 2023
* init

* Pulling Abstract Trees into 2.0 (#198)

* CompatHelper: add new compat entry for WordTokenizers at version 0.5, (keep existing compat) (#171)

Co-authored-by: CompatHelper Julia <compathelper_noreply@julialang.org>

* Stack traces (#179)

* styling

* now excludes other installed packages + fmt and tests

* small improvements ot hidden frames

* format and docs

* small fixes

* fmt

* kwarg func call fmt

* show each error line code

* covergage

* stacktrace formatting

* traces rendering improvements

* test fix

* new text reshaping function from chatgpt

* fixed tests

* cleanup

* cleanup

* bump

* bump

* bump

* prompt init

* small fixes to repr and error

* fixed small repr bugs

* removed deps

* wip errors

* method error kwargs call

* parsed kwargs calls in stackrace

* fixes

* method error edge cases

* bump

* bump

* bump

* fixed textlen bug for orphaned tags

* Update Project.toml

* Update Project.toml

* errors with no backtrace are now shown

* logger doesn't cut msgs

* CI fix

* error msg panel now always shows

* reworked logs rendering code

* msg reshaping

* refactored stacktrace code + further logs improvements

* fixed bug with markdown rendering

* Link renderable development (#180)

* bump

* bump

* working on making Link work

* functional link?

* fixing them errors

* fixed behavior of hidden frames in stacktrace and docs

* fixed bugs

* bugs fixed and more test

* bugfix

* tests fix

* tests fixing

* tests fix

* tests fix

* Fix #181 (#182)

* small fixes

* bump

* `Prompt` (#175)

* prompt init

* small fixes to repr and error

* fixed small repr bugs

* removed deps

* wip errors

* bump

* bump

* bump

* bump

* prompt wip

* bump

* prompt almost finished

* added tests and docs for prompt

* bump

* coverage and CI

* docs fix

* Update _error_messages.jl

* Annotations (#185)

* init

* more extensive precompilation

* small fixes for error IO

* 204 method invalidation at startup ops

* bump

* working on annotation

* added style

* bump

* disabled precompilation

* new code reshaping function

* new annotation system

* tests for annotations passing

* fmt

* more tests

* bump

* bump

* ci fix

* bump

Co-authored-by: Federico Claudi <federicoclaudi@imac.mynetworksettings.com>

* Create Invalidations.yml

* Create unused_dependencies.yml

* Update Invalidations.yml

* Update Invalidations.yml

* Update CI.yml

* Update CI.yml

* Coverage - adding more tests (#186)

* increasing test coverage

* fixed bug with markup tags including newline

* test coverage

* bump

* bump

* bump

* bump

* bump

* CI fix

* CI fix

* CI fix

* CI fix

* bump

* Update CI.yml

* bump

* refactored tree

* CI fix

* docs

* Update unused_dependencies.yml

* ci fix

* Update Invalidations.yml

* removed fillin(segments)

* Update CI.yml

* fmt

* bump

* removed error message functionality, using base

* bump

* fix_markup_across_lines (#188)

* fix_markup_across_lines

* tests passing

* fixed small things

* bump

* wip for fix_ansi_across_lines

* fixed nested style tags

* reshaping with ANSI and markup works well

* fmt

* bump

* bump

* bump

* removed unused funcs

* docstring

* small fixes

* bump

* Update CI.yml

* Working on pre-compilation (#173)

* init

* more extensive precompilation

* small fixes for error IO

* 204 method invalidation at startup ops

* bump

* cleaned up precompilation

* removed deps

* bump

Co-authored-by: Federico Claudi <federicoclaudi@imac.mynetworksettings.com>

* CompatHelper: add new compat entry for AbstractTrees at version 0.4, (keep existing compat) (#189)

Co-authored-by: CompatHelper Julia <compathelper_noreply@julialang.org>

* bump

* no stdout in precomp (#191)

* no stdout in precomp

* ignore precompilation code in coverage

* finished re-factoring tree

* CI fix

---------

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
Co-authored-by: CompatHelper Julia <compathelper_noreply@julialang.org>
Co-authored-by: Rémi Vezy <VEZY@users.noreply.github.com>
Co-authored-by: Federico Claudi <federicoclaudi@imac.mynetworksettings.com>

* Live (#199)

* Live first push

* bump

* bump

* pager almost ready

* pager ready

* making progress with menu

* making progress with menu

* hacky but working

* reduced flicker

* progress on making progress a Live

* redirect tsdout

* bump

* test

* introspection fmt + error fmt

* bump

* bump

* CompatHelper: add new compat entry for WordTokenizers at version 0.5, (keep existing compat) (#171)

Co-authored-by: CompatHelper Julia <compathelper_noreply@julialang.org>

* Stack traces (#179)

* styling

* now excludes other installed packages + fmt and tests

* small improvements ot hidden frames

* format and docs

* small fixes

* fmt

* kwarg func call fmt

* show each error line code

* covergage

* stacktrace formatting

* traces rendering improvements

* test fix

* new text reshaping function from chatgpt

* fixed tests

* cleanup

* cleanup

* bump

* bump

* bump

* prompt init

* small fixes to repr and error

* fixed small repr bugs

* removed deps

* wip errors

* method error kwargs call

* parsed kwargs calls in stackrace

* fixes

* method error edge cases

* bump

* bump

* bump

* fixed textlen bug for orphaned tags

* Update Project.toml

* Update Project.toml

* errors with no backtrace are now shown

* logger doesn't cut msgs

* CI fix

* error msg panel now always shows

* reworked logs rendering code

* msg reshaping

* refactored stacktrace code + further logs improvements

* fixed bug with markdown rendering

* Link renderable development (#180)

* bump

* bump

* working on making Link work

* functional link?

* fixing them errors

* fixed behavior of hidden frames in stacktrace and docs

* fixed bugs

* bugs fixed and more test

* bugfix

* tests fix

* tests fixing

* tests fix

* tests fix

* Fix #181 (#182)

* small fixes

* bump

* `Prompt` (#175)

* prompt init

* small fixes to repr and error

* fixed small repr bugs

* removed deps

* wip errors

* bump

* bump

* bump

* bump

* prompt wip

* bump

* prompt almost finished

* added tests and docs for prompt

* bump

* coverage and CI

* docs fix

* Update _error_messages.jl

* Annotations (#185)

* init

* more extensive precompilation

* small fixes for error IO

* 204 method invalidation at startup ops

* bump

* working on annotation

* added style

* bump

* disabled precompilation

* new code reshaping function

* new annotation system

* tests for annotations passing

* fmt

* more tests

* bump

* bump

* ci fix

* bump

Co-authored-by: Federico Claudi <federicoclaudi@imac.mynetworksettings.com>

* Create Invalidations.yml

* Create unused_dependencies.yml

* Update Invalidations.yml

* Update Invalidations.yml

* Update CI.yml

* Update CI.yml

* Coverage - adding more tests (#186)

* increasing test coverage

* fixed bug with markup tags including newline

* test coverage

* bump

* bump

* bump

* bump

* bump

* CI fix

* CI fix

* CI fix

* CI fix

* bump

* Update CI.yml

* bump

* refactored tree

* CI fix

* docs

* Update unused_dependencies.yml

* ci fix

* Update Invalidations.yml

* removed fillin(segments)

* Update CI.yml

* fmt

* bump

* removed error message functionality, using base

* bump

* fix_markup_across_lines (#188)

* fix_markup_across_lines

* tests passing

* fixed small things

* bump

* wip for fix_ansi_across_lines

* fixed nested style tags

* reshaping with ANSI and markup works well

* fmt

* bump

* bump

* bump

* removed unused funcs

* docstring

* small fixes

* bump

* Update CI.yml

* Working on pre-compilation (#173)

* init

* more extensive precompilation

* small fixes for error IO

* 204 method invalidation at startup ops

* bump

* cleaned up precompilation

* removed deps

* bump

Co-authored-by: Federico Claudi <federicoclaudi@imac.mynetworksettings.com>

* CompatHelper: add new compat entry for AbstractTrees at version 0.4, (keep existing compat) (#189)

Co-authored-by: CompatHelper Julia <compathelper_noreply@julialang.org>

* bump

* restored to old LiveInternals

* small improvements

* simple menu

* working on help message

* working on help

* added multi select menu

* bump

* help tooltip working

* small fixes

* pager with liner numbers and scrollbar

* tab viewer refactor

* improved key controls

* refactor

* more widgets and improvements

* tabviewer improvemens

* fixed scrollbar

* fixed introspection

* compositor accepts fractional values

* added apply_style to ren and removed extra style resets from boxes and panels

* removed apply style for renderables and working on app

* menu can be horizontal

* added gallery

* refactor

* small fixes

* RGB example

* inspect re-worked

* refactor

* bump

* reverted to master progress bar

* tests passing

* tests passing

* refactoring controls

* no stdout in precomp (#191)

* no stdout in precomp

* ignore precompilation code in coverage

* working on controls

* debug mode and working controls

* small imrpvoements

* removed live internals from widgets

* all widgets play through app

* bump

* small fixes

* working on responsive app size

* working on resposive

* pager improvements

* tictactoe

* small improvements

* tests fix

* bump

* widget internals

* transitions inferred from layout

* wip

* all widgets work

* added help msg

* help msg

* bump

* finished re-factoring tree

* CI fix

* added test

* CI fix

* bump

---------

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
Co-authored-by: CompatHelper Julia <compathelper_noreply@julialang.org>
Co-authored-by: Rémi Vezy <VEZY@users.noreply.github.com>
Co-authored-by: Federico Claudi <federicoclaudi@imac.mynetworksettings.com>

* working on docs

* bump

* Fixing known v2.0 problems ahead of release (#200)

* fixed logs problems

* bump

* fixed layout in repr functionality

* fixed err msg not showing up in progress

* added option to expand stackatrace width

* CI fix

* CI fix

* CI fix

* CI fix

* CI fix

* CI fix

* CI fix

* working on docs

* bump

* docs

* docs fix

* merged

---------

Co-authored-by: Federico Claudi <federicoclaudi@imac.mynetworksettings.com>
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
Co-authored-by: CompatHelper Julia <compathelper_noreply@julialang.org>
Co-authored-by: Rémi Vezy <VEZY@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants