3 unstable releases

0.2.1 Jan 10, 2025
0.1.1 Apr 7, 2024
0.1.0 Feb 20, 2024

#246 in Programming languages

Download history 178/week @ 2025-01-07 8/week @ 2025-01-14 11/week @ 2025-01-28 23/week @ 2025-02-04 39/week @ 2025-02-11 16/week @ 2025-02-25 11/week @ 2025-03-04 11/week @ 2025-03-11 74/week @ 2025-03-18 359/week @ 2025-03-25 449/week @ 2025-04-01 72/week @ 2025-04-08

956 downloads per month

MIT license

69KB
2.5K SLoC

hi-doc

annotated code example

Diagnostic formatting library.

Motivation

Most diagnostic formatting libraries implement both formatting and span/source management simultaneously. This can be beneficial for consistency, but it requires tying the code of your library to a third-party annotation library, which can be inconvenient, especially when your library already has its own logic for diagnostics.

hi-doc solely implements diagnostic formatting, allowing for seamless integration with existing diagnostic logic within a library.

Finished features

  • Multiple ranges per annotation

  • Multi-line annotations

  • Multi-line annotation text

  • Support for unicode fullwidth characters

    code with fullwidth characters

  • Correct handling of non-printable control characters, and configurable tab width

    tab alignment

  • Formatting of the annotation text itself

  • Syntax highlightning in annotated text

    syntax highlightning

  • Support for non-colored terminals

  • Place annotations on top of the line

Dependencies

~1.5–2.1MB
~41K SLoC