From b535b79df3d8b2f645733f8b5540e21b5833cde8 Mon Sep 17 00:00:00 2001 From: fwcd Date: Thu, 5 Sep 2024 18:46:50 +0200 Subject: [PATCH] Add create documentation and update README --- README.md | 10 +++++++++- src/lib.rs | 15 +++++++++++++++ 2 files changed, 24 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index b107027..3c189a8 100644 --- a/README.md +++ b/README.md @@ -12,7 +12,15 @@ A declarative, cross-platform UI library for Rust that uses native controls. | [nuit-core](./nuit-core) | Core structures and traits | [![crates.io](https://img.shields.io/crates/v/nuit-core)](https://crates.io/crates/nuit-core) | [![docs.rs](https://img.shields.io/docsrs/nuit-core)](https://docs.rs/nuit-core) | | [nuit-derive](./nuit-derive) | Derive macros | [![crates.io](https://img.shields.io/crates/v/nuit-derive)](https://crates.io/crates/nuit-derive) | [![docs.rs](https://img.shields.io/docsrs/nuit-derive)](https://docs.rs/nuit-derive) | -Nuit's API takes inspiration from SwiftUI, Xilem, React and a number of other frameworks, while itself using SwiftUI under the hood on macOS. +The API takes inspiration from contemporary reactive frameworks like SwiftUI, Xilem and React. A central design goal is to avoid using too much macro magic and instead heavily leverage associated types, traits and generics. + +A simple hello world program in Nuit takes only a single line: + +```rust +nuit::run_app(Text::new("Hello world!")); +``` + +For a more elaborate example, check out [the section below](#example). > [!IMPORTANT] > Nuit is still experimental with a rapidly evolving API. As such, treat this library as a sandbox rather than as a finished product, especially if you intend to write an app with it. diff --git a/src/lib.rs b/src/lib.rs index d95f5c2..21515cb 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -1,3 +1,18 @@ +//! A declarative, cross-platform UI library that uses native controls. +//! +//! The API takes inspiration from contemporary reactive frameworks like +//! SwiftUI, Xilem and React. A central design goal is to avoid using too much +//! macro magic and instead heavily leverage associated types, traits and +//! generics. +//! +//! A simple hello world program in Nuit takes only a single line: +//! +//! ```no_run +//! use nuit::Text; +//! +//! nuit::run_app(Text::new("Hello world!")); +//! ``` + mod backend; mod config;