canop / clima Goto Github PK
View Code? Open in Web Editor NEWA minimal viewer for Termimad
License: MIT License
A minimal viewer for Termimad
License: MIT License
Hi. i'm eager to create a package for your tool for void-linux. But they only accept release versions of packages. So, please provide release version. Thanks.
It would be nice if it could provide binaries, avoiding people to compiling it to test/use.
Hey @Canop,
First of all, I would like to say that's seems a pretty great library.
I was trying to test https://github.com/Canop/termimad by clima
, but when I was breaking through the manual I immediately encountered on the issue with building its origin :)
error[E0277]: `?` couldn't convert the error to `termimad::Error`
--> src/viewer.rs:35:36
|
35 | queue!(w, cursor::MoveTo(0, y))?;
| ^ the trait `std::convert::From<crossterm::utils::error::ErrorKind>` is not implemented for `termimad::Error`
|
= note: the question mark operation (`?`) implicitly performs a conversion on the error value using the `From` trait
= help: the following implementations were found:
<termimad::Error as std::convert::From<crossterm::error::ErrorKind>>
<termimad::Error as std::convert::From<std::io::Error>>
= note: required by `std::convert::From::from`
error[E0308]: mismatched types
--> src/viewer.rs:37:5
|
37 | mad_write_inline!(w, skin, "**Clima >** *$0*", &path)
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ expected struct `minimad::composite::Composite`, found struct `minimad::Composite`
|
= note: expected type `minimad::composite::Composite<'_>`
found type `minimad::Composite<'_>`
note: Perhaps two different versions of crate `minimad` are being used?
--> src/viewer.rs:37:5
|
37 | mad_write_inline!(w, skin, "**Clima >** *$0*", &path)
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
= note: this error originates in a macro outside of the current crate (in Nightly builds, run with -Z external-macro-backtrace for more info)
error[E0277]: `?` couldn't convert the error to `termimad::Error`
--> src/viewer.rs:41:36
|
41 | queue!(w, cursor::MoveTo(0, y))?;
| ^ the trait `std::convert::From<crossterm::utils::error::ErrorKind>` is not implemented for `termimad::Error`
|
= note: the question mark operation (`?`) implicitly performs a conversion on the error value using the `From` trait
= help: the following implementations were found:
<termimad::Error as std::convert::From<crossterm::error::ErrorKind>>
<termimad::Error as std::convert::From<std::io::Error>>
= note: required by `std::convert::From::from`
error[E0308]: mismatched types
--> src/viewer.rs:42:5
|
42 | / mad_write_inline!(
43 | | w,
44 | | skin,
45 | | "Use the **๐ก** and **๐ก** arrow keys to scroll, any other key to quit"
46 | | )
| |_____^ expected struct `minimad::composite::Composite`, found struct `minimad::Composite`
|
= note: expected type `minimad::composite::Composite<'_>`
found type `minimad::Composite<'_>`
note: Perhaps two different versions of crate `minimad` are being used?
--> src/viewer.rs:42:5
|
42 | / mad_write_inline!(
43 | | w,
44 | | skin,
45 | | "Use the **๐ก** and **๐ก** arrow keys to scroll, any other key to quit"
46 | | )
| |_____^
= note: this error originates in a macro outside of the current crate (in Nightly builds, run with -Z external-macro-backtrace for more info)
error[E0308]: mismatched types
--> src/viewer.rs:52:25
|
52 | skin.set_headers_fg(Yellow);
| ^^^^^^ expected enum `crossterm::style::enums::color::Color`, found a different enum `crossterm::style::enums::color::Color`
|
= note: expected type `crossterm::style::enums::color::Color` (enum `crossterm::style::enums::color::Color`)
found type `crossterm::style::enums::color::Color` (enum `crossterm::style::enums::color::Color`)
note: Perhaps two different versions of crate `crossterm` are being used?
--> src/viewer.rs:52:25
|
52 | skin.set_headers_fg(Yellow);
| ^^^^^^
error[E0308]: mismatched types
--> src/viewer.rs:53:22
|
53 | skin.bold.set_fg(Yellow);
| ^^^^^^ expected enum `crossterm::style::enums::color::Color`, found a different enum `crossterm::style::enums::color::Color`
|
= note: expected type `crossterm::style::enums::color::Color` (enum `crossterm::style::enums::color::Color`)
found type `crossterm::style::enums::color::Color` (enum `crossterm::style::enums::color::Color`)
note: Perhaps two different versions of crate `crossterm` are being used?
--> src/viewer.rs:53:22
|
53 | skin.bold.set_fg(Yellow);
| ^^^^^^
error[E0308]: mismatched types
--> src/viewer.rs:54:24
|
54 | skin.italic.set_fg(White);
| ^^^^^ expected enum `crossterm::style::enums::color::Color`, found a different enum `crossterm::style::enums::color::Color`
|
= note: expected type `crossterm::style::enums::color::Color` (enum `crossterm::style::enums::color::Color`)
found type `crossterm::style::enums::color::Color` (enum `crossterm::style::enums::color::Color`)
note: Perhaps two different versions of crate `crossterm` are being used?
--> src/viewer.rs:54:24
|
54 | skin.italic.set_fg(White);
| ^^^^^
error[E0308]: mismatched types
--> src/viewer.rs:55:33
|
55 | skin.scrollbar.thumb.set_fg(AnsiValue(178));
| ^^^^^^^^^^^^^^ expected enum `crossterm::style::enums::color::Color`, found a different enum `crossterm::style::enums::color::Color`
|
= note: expected type `crossterm::style::enums::color::Color` (enum `crossterm::style::enums::color::Color`)
found type `crossterm::style::enums::color::Color` (enum `crossterm::style::enums::color::Color`)
note: Perhaps two different versions of crate `crossterm` are being used?
--> src/viewer.rs:55:33
|
55 | skin.scrollbar.thumb.set_fg(AnsiValue(178));
| ^^^^^^^^^^^^^^
error[E0277]: `?` couldn't convert the error to `termimad::Error`
--> src/viewer.rs:68:40
|
68 | queue!(w, EnterAlternateScreen)?;
| ^ the trait `std::convert::From<crossterm::utils::error::ErrorKind>` is not implemented for `termimad::Error`
|
= note: the question mark operation (`?`) implicitly performs a conversion on the error value using the `From` trait
= help: the following implementations were found:
<termimad::Error as std::convert::From<crossterm::error::ErrorKind>>
<termimad::Error as std::convert::From<std::io::Error>>
= note: required by `std::convert::From::from`
error[E0277]: `?` couldn't convert the error to `termimad::Error`
--> src/viewer.rs:69:32
|
69 | queue!(w, cursor::Hide)?; // hiding the cursor
| ^ the trait `std::convert::From<crossterm::utils::error::ErrorKind>` is not implemented for `termimad::Error`
|
= note: the question mark operation (`?`) implicitly performs a conversion on the error value using the `From` trait
= help: the following implementations were found:
<termimad::Error as std::convert::From<crossterm::error::ErrorKind>>
<termimad::Error as std::convert::From<std::io::Error>>
= note: required by `std::convert::From::from`
error[E0277]: `?` couldn't convert the error to `termimad::Error`
--> src/viewer.rs:70:53
|
70 | let _raw_screen = RawScreen::into_raw_mode()?;
| ^ the trait `std::convert::From<crossterm::utils::error::ErrorKind>` is not implemented for `termimad::Error`
|
= note: the question mark operation (`?`) implicitly performs a conversion on the error value using the `From` trait
= help: the following implementations were found:
<termimad::Error as std::convert::From<crossterm::error::ErrorKind>>
<termimad::Error as std::convert::From<std::io::Error>>
= note: required by `std::convert::From::from`
error[E0277]: `?` couldn't convert the error to `termimad::Error`
--> src/viewer.rs:76:32
|
76 | queue!(w, cursor::Show)?;
| ^ the trait `std::convert::From<crossterm::utils::error::ErrorKind>` is not implemented for `termimad::Error`
|
= note: the question mark operation (`?`) implicitly performs a conversion on the error value using the `From` trait
= help: the following implementations were found:
<termimad::Error as std::convert::From<crossterm::error::ErrorKind>>
<termimad::Error as std::convert::From<std::io::Error>>
= note: required by `std::convert::From::from`
error[E0277]: `?` couldn't convert the error to `termimad::Error`
--> src/viewer.rs:77:40
|
77 | queue!(w, LeaveAlternateScreen)?;
| ^ the trait `std::convert::From<crossterm::utils::error::ErrorKind>` is not implemented for `termimad::Error`
|
= note: the question mark operation (`?`) implicitly performs a conversion on the error value using the `From` trait
= help: the following implementations were found:
<termimad::Error as std::convert::From<crossterm::error::ErrorKind>>
<termimad::Error as std::convert::From<std::io::Error>>
= note: required by `std::convert::From::from`
error: aborting due to 13 previous errors
Some errors have detailed explanations: E0277, E0308.
For more information about an error, try `rustc --explain E0277`.
error: Could not compile `clima`.
I am not precisely an expert but it feels like termimad has gone further by dependences then this crate.
Thanks
Fresh checkout:
[...]
Compiling hyper v0.14.17
Compiling hyper-tls v0.5.0
Compiling reqwest v0.11.10
Compiling clima v0.1.0 (/home/user/clima)
error: there is no argument named `user`
--> src/open.rs:56:60
|
56 | format!("https://raw.githubusercontent.com/{user}/{repo}/master/README.md")
| ^^^^^^
error: there is no argument named `repo`
--> src/open.rs:56:67
|
56 | format!("https://raw.githubusercontent.com/{user}/{repo}/master/README.md")
| ^^^^^^
error: there is no argument named `user`
--> src/open.rs:66:60
|
66 | format!("https://raw.githubusercontent.com/{user}/{repo}/{path}")
| ^^^^^^
error: there is no argument named `repo`
--> src/open.rs:66:67
|
66 | format!("https://raw.githubusercontent.com/{user}/{repo}/{path}")
| ^^^^^^
error: there is no argument named `path`
--> src/open.rs:66:74
|
66 | format!("https://raw.githubusercontent.com/{user}/{repo}/{path}")
| ^^^^^^
error: could not compile `clima` due to 5 previous errors
Environment:
$ cargo --version
cargo 1.56.0 (4ed5d137b 2021-10-04)
$ rustc --version
rustc 1.56.1 (59eed8a2a 2021-11-01)
...
Compiling clima v0.0.6
error[E0277]: `?` couldn't convert the error to `termimad::Error`
--> /home/tshepang/.cargo/registry/src/github.com-1ecc6299db9ec823/clima-0.0.6/src/viewer.rs:27:32
|
27 | terminal::enable_raw_mode()?;
| ^ the trait `std::convert::From<crossterm::error::ErrorKind>` is not implemented for `termimad::Error`
|
= note: the question mark operation (`?`) implicitly performs a conversion on the error value using the `From` trait
= help: the following implementations were found:
<termimad::Error as std::convert::From<crossterm::error::ErrorKind>>
<termimad::Error as std::convert::From<std::io::Error>>
= note: required by `std::convert::From::from`
This is followed by other similar errors.
`:~/clima$ cargo install --path .
Installing clima v0.0.5 (/home/june/clima)
Updating crates.io index
Downloaded log v0.4.8
Downloaded lazy_static v1.4.0
Downloaded clap v2.33.0
Downloaded crossterm v0.14.2
Downloaded cfg-if v0.1.10
Downloaded ansi_term v0.11.0
Downloaded atty v0.2.14
Downloaded signal-hook v0.1.13
Downloaded vec_map v0.8.1
Downloaded textwrap v0.11.0
Downloaded mio v0.6.21
Downloaded unicode-width v0.1.7
Downloaded libc v0.2.66
Downloaded strsim v0.8.0
Downloaded minimad v0.6.3
Downloaded simplelog v0.6.0
Downloaded custom_error v1.7.1
Downloaded bitflags v1.2.1
Downloaded parking_lot v0.10.0
Downloaded iovec v0.1.4
Downloaded chrono v0.4.10
Downloaded signal-hook-registry v1.2.0
Downloaded slab v0.4.2
Downloaded term v0.5.2
Downloaded net2 v0.2.33
Downloaded parking_lot_core v0.7.0
Downloaded num-traits v0.2.11
Downloaded num-integer v0.1.42
Downloaded termimad v0.8.13
Downloaded time v0.1.42
Downloaded lock_api v0.3.3
Downloaded arc-swap v0.4.4
Downloaded byteorder v1.3.4
Downloaded autocfg v1.0.0
Downloaded dirs v1.0.5
Downloaded smallvec v1.2.0
Downloaded crossbeam v0.7.3
Downloaded scopeguard v1.0.0
Downloaded crossterm v0.16.0
Downloaded thiserror v1.0.10
Downloaded crossbeam-deque v0.7.2
Downloaded crossbeam-queue v0.2.1
Downloaded crossbeam-channel v0.4.0
Downloaded crossbeam-utils v0.7.0
Downloaded crossbeam-epoch v0.8.0
Downloaded autocfg v0.1.7
Downloaded memoffset v0.5.3
Downloaded thiserror-impl v1.0.10
Downloaded rustc_version v0.2.3
Downloaded quote v1.0.2
Downloaded syn v1.0.14
Downloaded semver v0.9.0
Downloaded proc-macro2 v1.0.8
Downloaded unicode-xid v0.2.0
Downloaded semver-parser v0.7.0
Compiling semver-parser v0.7.0
Compiling autocfg v0.1.7
Compiling libc v0.2.66
Compiling proc-macro2 v1.0.8
Compiling log v0.4.8
Compiling autocfg v1.0.0
Compiling unicode-xid v0.2.0
Compiling lazy_static v1.4.0
Compiling cfg-if v0.1.10
Compiling syn v1.0.14
Compiling scopeguard v1.0.0
Compiling slab v0.4.2
Compiling smallvec v1.2.0
error[E0658]: use of unstable library feature 'alloc': this library is unlikely to be stabilized in its current form or name (see issue #27783)
--> /home/june/.cargo/registry/src/github.com-1ecc6299db9ec823/smallvec-1.2.0/lib.rs:35:1
|
35 | pub extern crate alloc;
| ^^^^^^^^^^^^^^^^^^^^^^^
error[E0658]: use of unstable library feature 'maybe_uninit' (see issue #53491)
--> /home/june/.cargo/registry/src/github.com-1ecc6299db9ec823/smallvec-1.2.0/lib.rs:49:5
|
49 | use core::mem::MaybeUninit;
| ^^^^^^^^^^^^^^^^^^^^^^
error[E0658]: use of unstable library feature 'maybe_uninit' (see issue #53491)
--> /home/june/.cargo/registry/src/github.com-1ecc6299db9ec823/smallvec-1.2.0/lib.rs:294:12
|
294 | Inline(MaybeUninit),
| ^^^^^^^^^^^^^^
error[E0658]: use of unstable library feature 'maybe_uninit' (see issue #53491)
--> /home/june/.cargo/registry/src/github.com-1ecc6299db9ec823/smallvec-1.2.0/lib.rs:315:28
|
315 | fn from_inline(inline: MaybeUninit) -> SmallVecData {
| ^^^^^^^^^^^^^^
error[E0658]: use of unstable library feature 'maybe_uninit' (see issue #53491)
--> /home/june/.cargo/registry/src/github.com-1ecc6299db9ec823/smallvec-1.2.0/lib.rs:319:36
|
319 | unsafe fn into_inline(self) -> MaybeUninit {
| ^^^^^^^^^^^^^^
error[E0658]: use of unstable library feature 'maybe_uninit' (see issue #53491)
--> /home/june/.cargo/registry/src/github.com-1ecc6299db9ec823/smallvec-1.2.0/lib.rs:394:45
|
394 | data: SmallVecData::from_inline(MaybeUninit::uninit()),
| ^^^^^^^^^^^^^^^^^^^
error[E0658]: use of unstable library feature 'maybe_uninit' (see issue #53491)
--> /home/june/.cargo/registry/src/github.com-1ecc6299db9ec823/smallvec-1.2.0/lib.rs:434:63
|
434 | let mut data = SmallVecData::::from_inline(MaybeUninit::uninit());
| ^^^^^^^^^^^^^^^^^^^
error[E0658]: use of unstable library feature 'maybe_uninit' (see issue #53491)
--> /home/june/.cargo/registry/src/github.com-1ecc6299db9ec823/smallvec-1.2.0/lib.rs:470:45
|
470 | data: SmallVecData::from_inline(MaybeUninit::new(buf)),
| ^^^^^^^^^^^^^^^^
error[E0658]: use of unstable library feature 'maybe_uninit' (see issue #53491)
--> /home/june/.cargo/registry/src/github.com-1ecc6299db9ec823/smallvec-1.2.0/lib.rs:489:55
|
489 | unsafe { SmallVec::from_buf_and_len_unchecked(MaybeUninit::new(buf), len) }
| ^^^^^^^^^^^^^^^^
error[E0658]: use of unstable library feature 'maybe_uninit' (see issue #53491)
--> /home/june/.cargo/registry/src/github.com-1ecc6299db9ec823/smallvec-1.2.0/lib.rs:508:51
|
508 | pub unsafe fn from_buf_and_len_unchecked(buf: MaybeUninit, len: usize) -> SmallVec {
| ^^^^^^^^^^^^^^
error[E0658]: use of unstable library feature 'maybe_uninit' (see issue #53491)
--> /home/june/.cargo/registry/src/github.com-1ecc6299db9ec823/smallvec-1.2.0/lib.rs:670:55
|
670 | self.data = SmallVecData::from_inline(MaybeUninit::uninit());
| ^^^^^^^^^^^^^^^^^^^
error[E0658]: use of unstable library feature 'maybe_uninit' (see issue #53491)
--> /home/june/.cargo/registry/src/github.com-1ecc6299db9ec823/smallvec-1.2.0/lib.rs:737:55
|
737 | self.data = SmallVecData::from_inline(MaybeUninit::uninit());
| ^^^^^^^^^^^^^^^^^^^
error[E0658]: use of unstable library feature 'maybe_uninit' (see issue #53491)
--> /home/june/.cargo/registry/src/github.com-1ecc6299db9ec823/smallvec-1.2.0/lib.rs:1078:52
|
1078 | let mut data: MaybeUninit = MaybeUninit::uninit();
| ^^^^^^^^^^^^^^^^^^^
error[E0658]: use of unstable library feature 'maybe_uninit' (see issue #53491)
--> /home/june/.cargo/registry/src/github.com-1ecc6299db9ec823/smallvec-1.2.0/lib.rs:1078:35
|
1078 | let mut data: MaybeUninit = MaybeUninit::uninit();
| ^^^^^^^^^^^^^^
error[E0658]: use of unstable library feature 'maybe_uninit' (see issue #53491)
--> /home/june/.cargo/registry/src/github.com-1ecc6299db9ec823/smallvec-1.2.0/lib.rs:303:42
|
303 | SmallVecData::Inline(a) => a.as_ptr() as *const A::Item,
| ^^^^^^
error[E0658]: use of unstable library feature 'maybe_uninit' (see issue #53491)
--> /home/june/.cargo/registry/src/github.com-1ecc6299db9ec823/smallvec-1.2.0/lib.rs:310:42
|
310 | SmallVecData::Inline(a) => a.as_mut_ptr() as *mut A::Item,
| ^^^^^^^^^^
Compiling arc-swap v0.4.4
error[E0599]: no function or associated item named uninit
found for type core::mem::MaybeUninit<_>
in the current scope
--> /home/june/.cargo/registry/src/github.com-1ecc6299db9ec823/smallvec-1.2.0/lib.rs:394:58
|
394 | data: SmallVecData::from_inline(MaybeUninit::uninit()),
| -------------^^^^^^
| |
| function or associated item not found in core::mem::MaybeUninit<_>
error[E0599]: no function or associated item named uninit
found for type core::mem::MaybeUninit<_>
in the current scope
--> /home/june/.cargo/registry/src/github.com-1ecc6299db9ec823/smallvec-1.2.0/lib.rs:434:76
|
434 | let mut data = SmallVecData::::from_inline(MaybeUninit::uninit());
| -------------^^^^^^
| |
| function or associated item not found in core::mem::MaybeUninit<_>
error[E0599]: no function or associated item named uninit
found for type core::mem::MaybeUninit<_>
in the current scope
--> /home/june/.cargo/registry/src/github.com-1ecc6299db9ec823/smallvec-1.2.0/lib.rs:670:68
|
670 | self.data = SmallVecData::from_inline(MaybeUninit::uninit());
| -------------^^^^^^
| |
| function or associated item not found in core::mem::MaybeUninit<_>
error[E0599]: no function or associated item named uninit
found for type core::mem::MaybeUninit<_>
in the current scope
--> /home/june/.cargo/registry/src/github.com-1ecc6299db9ec823/smallvec-1.2.0/lib.rs:737:68
|
737 | self.data = SmallVecData::from_inline(MaybeUninit::uninit());
| -------------^^^^^^
| |
| function or associated item not found in core::mem::MaybeUninit<_>
error[E0599]: no method named assume_init
found for type core::mem::MaybeUninit<A>
in the current scope
--> /home/june/.cargo/registry/src/github.com-1ecc6299db9ec823/smallvec-1.2.0/lib.rs:916:39
|
916 | Ok(data.into_inline().assume_init())
| ^^^^^^^^^^^
error[E0599]: no function or associated item named uninit
found for type core::mem::MaybeUninit<_>
in the current scope
--> /home/june/.cargo/registry/src/github.com-1ecc6299db9ec823/smallvec-1.2.0/lib.rs:1078:65
|
1078 | let mut data: MaybeUninit = MaybeUninit::uninit();
| -------------^^^^^^
| |
| function or associated item not found in core::mem::MaybeUninit<_>
error[E0658]: use of unstable library feature 'maybe_uninit' (see issue #53491)
--> /home/june/.cargo/registry/src/github.com-1ecc6299db9ec823/smallvec-1.2.0/lib.rs:1081:30
|
1081 | data.as_mut_ptr() as *mut A::Item,
| ^^^^^^^^^^
error: aborting due to 23 previous errors
Some errors occurred: E0599, E0658.
For more information about an error, try rustc --explain E0599
.
error: Could not compile smallvec
.
warning: build failed, waiting for other jobs to finish...
error: failed to compile clima v0.0.5 (/home/june/clima)
, intermediate artifacts can be found at /home/june/clima/target
Caused by:
build failed
`
Measured colouring helps user to recognise key elements: headings, links, etc.
Would you consider optionally rendering those in colour?
Vim and Neovim alike offer vertical and horizontal split panes. Out of the box, clima
also offers a print option. I think there's some magic in combining the two for a live markdown preview with clima
's capabilities.
Does this make sense to expose from the crate, or seem like a viable feature to implement?
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.