Skip to content

Commit

Permalink
[core, tui] Fix doc links errors, update Cargo.lock, update CHANGELOG.md
Browse files Browse the repository at this point in the history
`yaml-rust` crate is unmaintained

1) `syntect` author won't update this dep to a fork of it due to lack
of trust concerns with this new fork:
trishume/syntect#526

2) cargo-deny produces this output:

error[unmaintained]: yaml-rust is unmaintained.
    ┌─ /home/nazmul/github/r3bl-open-core/Cargo.lock:295:1
    │
295 │ yaml-rust 0.4.5 registry+https://github.com/rust-lang/crates.io-index
    │ --------------------------------------------------------------------- unmaintained advisory detected
    │
    = ID: RUSTSEC-2024-0320
    = Advisory: https://rustsec.org/advisories/RUSTSEC-2024-0320
    = The maintainer seems [unreachable](chyh1990/yaml-rust#197).

      Many issues and pull requests have been submitted over the years
      without any [response](chyh1990/yaml-rust#160).

      ## Alternatives

      Consider switching to the actively maintained `yaml-rust2` fork of the original project:

      - [yaml-rust2](https://github.com/Ethiraric/yaml-rust2)
      - [yaml-rust2 @ crates.io](https://crates.io/crates/yaml-rust2))
    = Announcement: rustsec/advisory-db#1921
    = Solution: No safe upgrade is available!
    = yaml-rust v0.4.5
      └── syntect v5.1.0
          └── r3bl_tui v0.5.2
              └── r3bl-cmdr v0.0.11
  • Loading branch information
nazmulidris committed Apr 15, 2024
1 parent fccf70e commit 29ff8e8
Show file tree
Hide file tree
Showing 10 changed files with 83 additions and 31 deletions.
63 changes: 62 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,14 @@
<!-- TOC -->

- [r3bl-cmdr](#r3bl-cmdr)
- [Next Release](#next-release)
- [v0.0.11 2024-01-14](#v0011-2024-01-14)
- [v0.0.10 2024-01-02](#v0010-2024-01-02)
- [v0.0.9 2023-12-31](#v009-2023-12-31)
- [v0.0.8 2023-12-22](#v008-2023-12-22)
- [r3bl_tuify](#r3bl_tuify)
- [v0.1.26 2024-04-15](#v0126-2024-04-15)
- [v0.1.25 2024-01-14](#v0125-2024-01-14)
- [v0.1.24 2023-12-31](#v0124-2023-12-31)
- [v0.1.23 2023-12-22](#v0123-2023-12-22)
- [v0.1.22 2023-12-20](#v0122-2023-12-20)
Expand All @@ -18,6 +21,8 @@
- [v0.1.18 2023-10-17](#v0118-2023-10-17)
- [v0.1.17 2023-10-14](#v0117-2023-10-14)
- [r3bl_tui](#r3bl_tui)
- [v0.5.3 2024-04-15](#v053-2024-04-15)
- [v0.5.2 2024-01-14](#v052-2024-01-14)
- [v0.5.1 2024-01-09](#v051-2024-01-09)
- [v0.5.0 2023-12-31](#v050-2023-12-31)
- [v0.4.0 2023-12-22](#v040-2023-12-22)
Expand All @@ -30,6 +35,7 @@
- [v0.3.2 2023-03-06](#v032-2023-03-06)
- [v0.3.1 2023-03-06](#v031-2023-03-06)
- [r3bl_rs_utils_core](#r3bl_rs_utils_core)
- [v0.9.13 2024-04-15](#v0913-2024-04-15)
- [v0.9.12 2024-01-07](#v0912-2024-01-07)
- [v0.9.11 2024-01-02](#v0911-2024-01-02)
- [v0.9.10 2023-12-22](#v0910-2023-12-22)
Expand All @@ -46,6 +52,8 @@
- [v0.9.7 2023-10-21](#v097-2023-10-21)
- [v0.9.6 2023-10-17](#v096-2023-10-17)
- [v0.9.5 2023-10-14](#v095-2023-10-14)
- [r3bl_terminal_async](#r3bl_terminal_async)
- [v0.3.0 2024-04-15](#v030-2024-04-15)
- [r3bl_ansi_color](#r3bl_ansi_color)
- [v0.6.9 2023-10-21](#v069-2023-10-21)
- [v0.6.8 2023-10-16](#v068-2023-10-16)
Expand Down Expand Up @@ -74,6 +82,17 @@
## `r3bl-cmdr`
<a id="markdown-r3bl-cmdr" name="r3bl-cmdr"></a>

### Next Release
<a id="markdown-next-release" name="next-release"></a>

- Changed:
- Use the latest deps:
- `r3bl_tui` version `0.5.3`.
- `r3bl_rs_utils_core` version `0.9.13`.
- Fixed:
- TBD: markdown parser issues
- TBD: editor issues

### v0.0.11 (2024-01-14)
<a id="markdown-v0.0.11-2024-01-14" name="v0.0.11-2024-01-14"></a>

Expand Down Expand Up @@ -134,7 +153,18 @@
## `r3bl_tuify`
<a id="markdown-r3bl_tuify" name="r3bl_tuify"></a>

### v0.1.26 (2024-04-15)
<a id="markdown-v0.1.26-2024-04-15" name="v0.1.26-2024-04-15"></a>

- Updated:
- Make `clip_string_to_width_with_ellipsis` pub so that other crates can use it (eg:
`r3bl_terminal_async`).
- Change the names of enums to be more readable.
- `IsTTYResult::IsTTY` -> `TTYResult::IsInteractive`.
- `IsTTYResult::IsNotTTY` -> `TTYResult::IsNotInteractive`.

### v0.1.25 (2024-01-14)
<a id="markdown-v0.1.25-2024-01-14" name="v0.1.25-2024-01-14"></a>

- Updated:
- Dependency updated `reedline` version `0.28.0`, `r3bl_rs_utils_core` version `0.9.12`.
Expand Down Expand Up @@ -228,7 +258,15 @@
## `r3bl_tui`
<a id="markdown-r3bl_tui" name="r3bl_tui"></a>

### v0.5.3 (2024-04-15)
<a id="markdown-v0.5.3-2024-04-15" name="v0.5.3-2024-04-15"></a>

- Updated:
- Dependency changes inherited from `r3bl_rs_utils_core` version `0.9.13`.
- Lots of clippy fixes.

### v0.5.2 (2024-01-14)
<a id="markdown-v0.5.2-2024-01-14" name="v0.5.2-2024-01-14"></a>

- Updated:
- Dependency updated `reedline` version `0.28.0`, `r3bl_rs_utils_core` version `0.9.12`.
Expand Down Expand Up @@ -449,10 +487,18 @@
## `r3bl_rs_utils_core`
<a id="markdown-r3bl_rs_utils_core" name="r3bl_rs_utils_core"></a>

### v0.9.13 (2024-04-15)
<a id="markdown-v0.9.13-2024-04-15" name="v0.9.13-2024-04-15"></a>

- Changed:
- Removed `syntect` dep.
- Rename `Style` to `TuiStyle`.
- Lots of cargo clippy fixes.

### v0.9.12 (2024-01-07)
<a id="markdown-v0.9.12-2024-01-07" name="v0.9.12-2024-01-07"></a>

Added:
- Added:
- Add `generate_friendly_random_id()` to generate human readable and friendly IDs.

### v0.9.11 (2024-01-02)
Expand Down Expand Up @@ -565,6 +611,21 @@ Added:
- Dependency on `simplelog` is replaced w/ `r3bl_simple_logger` (which is in the
`r3bl_rs_utils` repo workspace as `simple_logger`).

## `r3bl_terminal_async`
<a id="markdown-r3bl_terminal_async" name="r3bl_terminal_async"></a>

### v0.3.0 (2024-04-15)
<a id="markdown-v0.3.0-2024-04-15" name="v0.3.0-2024-04-15"></a>

This is the first release of this crate.

- Added:
- A new crate in this repo that allows for async terminal input and output. This is
useful for building TUIs that are async and can handle input and output in parallel.
To build apps that are not full TUI, this is a great option to create interactive CLIs
and REPLs that are fully async and multithreaded (with input and output) with a really
powerful (multi) line editor and prompt.

## `r3bl_ansi_color`
<a id="markdown-r3bl_ansi_color" name="r3bl_ansi_color"></a>

Expand Down
25 changes: 8 additions & 17 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion tui/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -429,7 +429,7 @@
//! 2. [App] - This is where you write your code. You pass in a [App] to the [TerminalWindow] to
//! bootstrap your TUI app. You can just use [App] to build your app, if it is a simple one & you
//! don't really need any sophisticated layout or styling. But if you want layout and styling,
//! now we have to deal with [FlexBox], [Component], and [r3bl_rs_utils_core::Style].
//! now we have to deal with [FlexBox], [Component], and [r3bl_rs_utils_core::TuiStyle].
//!
//! # Layout and styling
//! <a id="markdown-layout-and-styling" name="layout-and-styling"></a>
Expand Down
2 changes: 1 addition & 1 deletion tui/src/tui/color_wheel/tui_styled_text.rs
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ use crate::*;
#[derive(Debug, Clone, Default)]
pub struct TuiStyledText(pub TuiStyle, pub UnicodeString);

/// Use [styled_texts!] macro for easier construction.
/// Use [tui_styled_texts!] macro for easier construction.
pub type TuiStyledTexts = List<TuiStyledText>;

mod tui_styled_text_impl {
Expand Down
2 changes: 1 addition & 1 deletion tui/src/tui/lolcat/lolcat_impl.rs
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ impl Debug for Lolcat {
impl Lolcat {
/// This function does not respect [r3bl_ansi_color::global_color_support::detect()]
/// (it will always colorize to truecolor regardless of terminal limitations). Use
/// [ColorWheel] if you want to respect
/// [crate::ColorWheel] if you want to respect
/// [r3bl_ansi_color::global_color_support::detect].
pub fn colorize_to_styled_texts(&mut self, input: &UnicodeString) -> TuiStyledTexts {
let mut acc = TuiStyledTexts::default();
Expand Down
4 changes: 2 additions & 2 deletions tui/src/tui/syntax_highlighting/intermediate_types.rs
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
//! strings).
//! 2. This intermediate type is [clipped](StyleUSSpanLine::clip) to the visible area of the editor
//! component (based on scroll state in viewport). And finally that is converted to a
//! [crate::StyledTexts].
//! [crate::TuiStyledTexts].

use r3bl_rs_utils_core::*;

Expand Down Expand Up @@ -134,7 +134,7 @@ impl StyleUSSpanLine {
}

/// Clip the text (in one line) in this range: [ `start_col` .. `end_col` ]. Each line is
/// represented as a [List] of ([Style], [US])`s.
/// represented as a [List] of ([TuiStyle], [US])`s.
pub fn clip(
&self,
scroll_offset_col_index: ChUnit,
Expand Down
2 changes: 1 addition & 1 deletion tui/src/tui/syntax_highlighting/md_parser_syn_hi/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
//! 1. [crate::md_parser] - Responsible for parsing markdown into a [crate::MdDocument] data
//! structure.
//! 2. [crate::syntax_highlighting] - Responsible for converting a [crate::MdDocument] into a list
//! of tuples of [r3bl_rs_utils_core::Style] and [String].
//! of tuples of [r3bl_rs_utils_core::TuiStyle] and [String].
//! 3. [crate::editor] - Responsible for displaying the [crate::MdDocument] to the user.

// Attach.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
//!
//! This requires the conversion code to perform the following steps:
//! 1. Convert the syntect [SyntectStyleStrSpanLine] into a [StyleUSSpanLine].
//! 2. Then convert [StyleUSSpanLine] into a [StyledTexts].
//! 2. Then convert [StyleUSSpanLine] into a [TuiStyledTexts].

use syntect::parsing::SyntaxSet;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -69,9 +69,9 @@ impl OffscreenBufferPaint for OffscreenBufferPaintImplCrossterm {
/// Process each [PixelChar] in [OffscreenBuffer] and generate a [RenderOp] for it. Return a
/// [RenderOps] containing all the [RenderOp]s.
///
/// > Note that each [PixelChar] gets the full [Style] embedded in it (not just a part of it
/// > Note that each [PixelChar] gets the full [TuiStyle] embedded in it (not just a part of it
/// > that is different than the previous char). This means that it is possible to quickly
/// > "diff" between 2 of them, since the [Style] is part of the [PixelChar]. This is important
/// > "diff" between 2 of them, since the [TuiStyle] is part of the [PixelChar]. This is important
/// > for selective re-rendering of the [OffscreenBuffer].
///
/// Here's the algorithm used in this function using pseudo-code:
Expand Down
8 changes: 4 additions & 4 deletions tui/src/tui/terminal_lib_backends/render_op.rs
Original file line number Diff line number Diff line change
Expand Up @@ -251,20 +251,20 @@ pub enum RenderOp {

ClearScreen,

/// Directly set the fg color for crossterm w/out using [Style].
/// Directly set the fg color for crossterm w/out using [TuiStyle].
SetFgColor(TuiColor),

/// Directly set the bg color for crossterm w/out using [Style].
/// Directly set the bg color for crossterm w/out using [TuiStyle].
SetBgColor(TuiColor),

ResetColor,

/// Translate [Style] into fg and bg colors for crossterm. Note that this does not
/// Translate [TuiStyle] into fg and bg colors for crossterm. Note that this does not
/// apply attributes (bold, italic, underline, strikethrough, etc). If you need to
/// apply attributes, use [RenderOp::PaintTextWithAttributes] instead.
ApplyColors(Option<TuiStyle>),

/// Translate [Style] into *only* attributes for crossterm (bold, italic, underline,
/// Translate [TuiStyle] into *only* attributes for crossterm (bold, italic, underline,
/// strikethrough, etc) and not colors. If you need to apply color, use
/// [RenderOp::ApplyColors] instead.
///
Expand Down

0 comments on commit 29ff8e8

Please sign in to comment.