Before this change, it wasn't possible to build all features and all
targets at the same time, which prevents rust-analyzer from working
for the whole project.
Adds a bacon.toml file to the project, which is used by bacon
https://dystroy.org/bacon/
Configures docs.rs to show the feature flags that are necessary to
make modules / types / functions available.
Reduce benchmarks from 60 calls to 18. Now 3 different line counts
(64, 2048, 65535) * 6 different tests (new, render, scroll half / full,
wrap, wrap and scroll)
This allows the following types to be used in a constant context:
- `Layout`
- `Rect`
- `Style`
- `BorderType`
- `Padding`
- `Block`
Also adds several missing `new()` functions to the above types.
Blocks can now be used in the following way:
```
const DEFAULT_BLOCK: Block = Block::new()
.title_style(Style::new())
.title_alignment(Alignment::Left)
.title_position(Position::Top)
.borders(Borders::ALL)
.border_style(Style::new())
.style(Style::reset())
.padding(Padding::uniform(1));
```
Layouts can now be used in the following way:
``
const DEFAULT_LAYOUT: Layout = Layout::new()
.direction(Direction::Horizontal)
.margin(1)
.expand_to_fill(false);
```
Rects can now be used in the following way:
```
const RECT: Rect = Rect {
x: 0,
y: 0,
width: 10,
height: 10,
};
```
* docs(src\widgets\scrollbar.rs): wrap scrollbar's visualisation in text block
'cargo doc' and 'rust-analyzer' removes many whitespaces thus making those parts render improperly
* docs(src/widgets/calendar.rs): fix `no item named ...` for calendar.rs
* style(src/widgets/block.rs): format `block.rs`
Represents a scrollbar widget that renders a track, thumb and arrows
either horizontally or vertically. State is kept in ScrollbarState, and
passed as a parameter to the render function.
To run the benchmarks:
cargo bench
And then open the generated `target/criterion/report/index.html` in a
browser.
- add the BSD 2 clause and ISC licenses to the `cargo deny` allowed
licenses list (as a transitive dependency of the `fakeit` crate).
- remove the WTFPL license from the `cargo deny` allowed licenses list
as it is unused and causes a warning when running the check.
* refactor(ci): simplify cargo-make installation
* chore(ci): use the latest version of cargo-make
* refactor(ci): remove unused triple values
* chore(ci): list all steps before ci
* fix(ci): checkout the repository
* refactor(ci): remove unnecessary os variables
* refactor(ci): use dtolnay/rust-toolchain action
* fix(gauge): render gauge with unicode correctly
Gauge now correctly renders a block rather than a space when in unicode mode.
* docs: update demo.gif
- remove existing gif
- upload using VHS (https://github.com/charmbracelet/vhs)
- add instructions to RELEASE.md
- link new gif in README
- Adds a new typos.toml
- Prevents ratatui from being marked as a typo of ratatouille
- Changes paragraph tests so that the truncated word is a valid word
- Add contributors graph
- Add markdownlint config file
- Reformat README line width to 100
- Add a link to the CHANGELOG
- Remove APPS.md
- Change apps link to the Wiki instead of APPS.md
* style(commitizen): add commitizen
add customized commitizen config to match repo needs
implement request mentioned in [#214](https://github.com/tui-rs-revival/ratatui/issues/214) by @joshka
* docs(CONTRIBUTING.md): add a section for the commitizen installation
BREAKING_CHANGE:
* style(commitizen): update breaking change default to false
This is an opinionated default that helps avoid horizontal scrolling.
100 is the most common width on github rust projects and works well for
displaying code on a 16in macbook pro.
BREAKING CHANGE: The serde representation of bitflags has changed. Any
existing serialized types that have Borders or Modifiers will need to be
re-serialized. This is documented in the bitflags changelog.
https://github.com/bitflags/bitflags/blob/main/CHANGELOG.md#200-rc2
- Reformat summary info
- Add badges for dependencies, discord, license
- point existing badges to shields.io
- add Table of Contents
- tweaked installation instructions to show instructions for new and
existing crates
- moved fork status lower
- chop lines generally to 100 limit
- add a quickstart based on a simplified hello_world example
- added / updated some internal links to point locally
- removed some details to simplify the readme (e.g. tick-rate)
- reordered widgets and pointed these at the widget docs
- adds a hello_world example that has just the absolute basic code
necessary to run a ratatui app. This includes some comments that help
guide the user towards other approaches and considerations for a real
world app.
`Paragraph` now supports rendering each line in the paragraph with a
different alignment (Center, Left and Right) rather than the entire
paragraph being aligned the same. Each line either overrides the
paragraph's alignment or inherits it if the line's alignment is
unspecified.
- Adds `alignment` field to `Line` and builder methods on `Line` and
`Span`
- Updates reflow module types to be line oriented rather than symbol
oriented to take account of each lines alignment
- Adds unit tests to `Paragraph` to fully capture the existing and new
behavior
---------
Co-authored-by: Josh McKinney <joshka@users.noreply.github.com>
- `Default::default` is hard to read
- a few `map` -> `map_or`
- simplified `match` -> `let-if`
Signed-off-by: Yuri Astrakhan <YuriAstrakhan@gmail.com>
Adds a `border!` macro that takes TOP, BOTTOM, LEFT, RIGHT, and ALL and
returns a Borders object. An empty `border!()` call returns
Borders::NONE
This is gated behind a `macros` feature flag to ensure short build
times. To enable, add the following to your `Cargo.toml`:
```toml
ratatui = { version = 0.21.0, features = ["macros"] }
```
Co-authored-by: C-Jameson <booksncode@gmail.com>