2024-09-18 20:39:03 +03:00
# Yoda - Browser for [Gemini protocol](https://geminiprotocol.net)
2024-09-18 20:52:52 +03:00
Rust / GTK 4 implementation
2024-09-18 20:39:03 +03:00
> [!IMPORTANT]
> Project in development!
2024-09-18 20:51:18 +03:00
>
## Install
2024-09-20 17:54:28 +03:00
### Stable
``` bash
cargo install Yoda
```
2024-09-23 14:26:24 +03:00
### Repository
2024-09-19 13:23:28 +03:00
``` bash
git clone https://github.com/YGGverse/Yoda.git
cd Yoda
git checkout Rust-GTK4
2024-09-23 14:26:24 +03:00
cargo run
2024-09-19 13:23:28 +03:00
```
2024-09-23 14:26:24 +03:00
## Development
2024-09-27 23:00:20 +03:00
Guide and protocol draft
2024-09-23 14:26:24 +03:00
2024-09-27 23:00:20 +03:00
### `browser`
2024-09-23 14:26:24 +03:00
2024-09-27 23:00:20 +03:00
#### Filesystem
2024-09-23 14:26:24 +03:00
2024-09-27 22:35:53 +03:00
* Use [modern path pattern ](https://doc.rust-lang.org/edition-guide/rust-2018/path-changes.html#no-more-modrs )
* One module implements one GTK widget, it may include additional helper files in same location (like template, CSS or DB API)
2024-09-27 22:37:53 +03:00
* For children widget - create children module, located according to hierarchy
2024-09-27 23:00:20 +03:00
#### Codebase
* The codebase must be as minimal as possible, separate:
2024-09-27 22:35:53 +03:00
* different tasks
* massive structures
* structures with implementation
2024-09-26 00:29:08 +03:00
* Every module must:
2024-09-27 23:00:20 +03:00
* encapsulate it members: compose childs and stay composable for parents
* access 1 level of childs, never parents (e.g. through `super` )
2024-10-02 02:20:09 +03:00
* implement only one public `struct` per file (same as one file for one class)
2024-10-02 02:21:20 +03:00
* implementable `struct` is public, where it members - private
2024-09-27 20:49:44 +03:00
* contain main `struct` implementation:
2024-09-26 01:16:26 +03:00
* at least one constructor that must return:
2024-09-27 20:49:44 +03:00
* unwrapped main `Self` structure
* granted ownership for new object created
* public link getter for privately constructed widget
2024-09-28 01:29:05 +03:00
* Public API oriented to simple (`integer` , `boolean` ), standard (`std::*` ) or system-wide (`gio` , `glib` , etc) data types usage to reduce internal dependencies from app implementation
#### GTK
2024-09-28 01:31:03 +03:00
* Operate with [action objects ](https://docs.gtk.org/gio/class.SimpleAction.html ) instead of names like `win.action` . This allows to follow encapsulation, by the our goal, module must know nothing about parent presets. For example, define some action in parent, then delegate object created as construction argument
2024-09-26 00:29:08 +03:00
2024-09-23 14:26:24 +03:00
### Contribution
* before commit, make sure:
* new branch created for every new PR `git checkout -b 'contribution-name'`
* new code follows common [rustfmt ](https://rust-lang.github.io/rustfmt/ ) style `cargo fmt --check`
2024-09-18 20:52:52 +03:00
## See also
2024-09-18 20:56:04 +03:00
* [CPP-GTK4 ](https://github.com/YGGverse/Yoda/tree/CPP-GTK4 ) - C++ / GTK 4 implementation
* [PHP-GTK3 ](https://github.com/YGGverse/Yoda/tree/PHP-GTK3 ) - PHP / GTK 3 experimental branch