pop-os / cosmic-text

Pure Rust multi-line text handling
https://pop-os.github.io/cosmic-text/cosmic_text/
Apache License 2.0
1.53k stars 89 forks source link

[Examples] Issues running examples #46

Open saona-raimundo opened 1 year ago

saona-raimundo commented 1 year ago

Hi! First of all, thanks for the crate!

I was trying to run the examples but faced some issues and I was wondering Would accept PRs to improve them?

The issues I faced are the following. Some of them are from the "first-user perspective", I just want to help.

  1. I was not sure what each example was about. There was no README or module documentation on the source code.
  2. The terminal example uses termion, which does not compile on Windows... So I could not run it.
  3. The editor-orbclient example compiles, but panic with [2022-11-23T10:09:18Z ERROR editor_orbclient] failed to load "": The system cannot find the path specified.
  4. The editor-libcosmic example failed to build because xdg::BaseDirectories was not found.

(I am on Windows running rustc 1.64.0) Some preliminary thoughts about these issues are the following.

  1. The terminal example uses termion modules color and cursor. A more platform-friendly crate with these features may be console. It also ranks higher in https://lib.rs/std so I thought the change would be an improvement.

I have not checked the other examples in detail yet.

CeleritasCelery commented 1 year ago

I am also having issues running the example on MacOS. the terminal one was the only one that worked.

phsilva commented 1 year ago

One additional comment on the example is that they don't follow regular cargo examples structure. Although examples are a top-level folder, the following fails:

cargo run --example terminal

it says there are no example named terminal, because on the main Cargo.toml examples are included as members of the workspace, which works of course, but creates a a learning curve by not following the standard cargo structure for examples.

Just for reference, to run example you need:

cargo run --package terminal