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

Well documented README.md #192

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
43 changes: 36 additions & 7 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,25 +1,54 @@
# annotate-snippets

`annotate-snippets` is a Rust library for annotation of programming code slices.
`annotate-snippets` is a Rust library designed to annotate programming code slices, making debugging and diagnostic rendering more intuitive and visually appealing.

[![crates.io](https://img.shields.io/crates/v/annotate-snippets.svg)](https://crates.io/crates/annotate-snippets)
[![documentation](https://img.shields.io/badge/docs-master-blue.svg)][Documentation]
[![documentation](https://img.shields.io/badge/docs-master-blue.svg)](https://docs.rs/annotate-snippets/)
![build status](https://github.com/rust-lang/annotate-snippets-rs/actions/workflows/ci.yml/badge.svg)

The library helps visualize meta information annotating source code slices.
About the Library
-----------------
The annotate-snippets library provides tools to annotate source code slices with rich, meta information. It generates visually organized, styled error or informational messages, helping developers quickly pinpoint issues in their code.

Key Feature:
------------
It takes a data structure called `Snippet` on the input and produces a `String`
which may look like this:

![Screenshot](./examples/expected_type.svg)

Local Development
-----------------

To build and test the project locally, use the following commands:

cargo build
cargo test

When submitting a PR please use [`cargo fmt`][] (nightly).
Formatting
----------
Before submitting a pull request (PR), ensure the code follows Rust’s formatting standards by running:

cargo fmt

Contributing
------------
When submitting a PR please use [`cargo fmt`](https://github.com/rust-lang/rustfmt)
**NOTE:-** `cargo fmt` requires the nightly version of Rust.

Core Concepts:
--------------
`Annotation`: Adding labels or notes to specific parts of code slices for clarity.

`Snippet`: A small section of programming code to which annotations and diagnostics are applied.

`Diagnostic Rendering`: Presenting errors or meta information visually for better debugging.

`Renderer`: A mechanism that transforms the annotated snippets into styled, readable output.

`Meta Information`: Data that gives additional context or details about a code snippet, like where an error occurred or what caused it.

`Feature Parity`: Ensuring two tools (or versions of the same tool) have the same capabilities

[`cargo fmt`]: https://github.com/rust-lang/rustfmt
`Error Severity Levels`: Categories that describe how bad an error is (e.g., Error, Warning, Info) to help prioritize fixes.

[Documentation]: https://docs.rs/annotate-snippets/
`Programming code slices`: are small, specific portions or snippets of a larger codebase.
Loading