diff --git a/docs/a_index.md b/docs/a_index.md deleted file mode 100644 index ec56237..0000000 --- a/docs/a_index.md +++ /dev/null @@ -1,43 +0,0 @@ ---- -title: Introduction -slug: / ---- - -OSUI is a powerful TUI library, what makes it special is it's design and features, it allows for both customization and easy of use. - -### Setup -First, you need to install osui to a already existing [rust cargo](https://doc.rust-lang.org/cargo/getting-started/index.html) project, then in your project directory run: -```bash -cargo add osui -``` - -## Hello World App -To make a hello world app in OSUI simply write this -```rust src/main.rs -use osui::Screen; - -fn main() -> std::io::Result<()> { - let mut screen = Screen::new(); - - screen.draw(format!("Hello, World!")); - - screen.run() -} -``` - -## Hello World App With Velocity -The text will move from left to right with a velocity of `100` -```rust src/main.rs -use osui::{Screen, extensions::velocity::{VelocityExtension, Velocity}}; - -fn main() -> std::io::Result<()> { - let mut screen = Screen::new(); - screen.extension(VelocityExtension); - - screen - .draw(format!("Hello, World!")) - .component(Velocity(100, 0)); // Velocity(x, y) - - screen.run() -} -``` diff --git a/docs/b_screen.md b/docs/b_screen.md deleted file mode 100644 index ad23e8e..0000000 --- a/docs/b_screen.md +++ /dev/null @@ -1,27 +0,0 @@ ---- -title: Screen -slug: /screen ---- -`Screen` is a OSUI structure that allows the program to use osui elements and it's extensions. -Diagram - -### `Screen::new()` -Creates a new `Screen` structure with empty widgets and extensions. - -### `draw(&mut self, element: E) -> &Arc` -Adds a element to the widgets array and returns the widget for extra parameters. - -### `extension(&mut self, ext: E)` -Adds a extension to the extensions array. - -### `run(&mut self) -> std::io::Result<()>` -Runs the app with the elements and extension provided. - -### `render(&self) -> std::io::Result<()>` -> :::warning -> Do not run this function if you don't know what you're doing, this function may cause a mutex deadlock. - - -### `render_extension(&self, wi: Arc) -> std::io::Result<()>` -> :::warning -> Do not run this function if you don't know what you're doing, this function may cause a mutex deadlock. \ No newline at end of file diff --git a/docs/c_extensions.md b/docs/c_extensions.md deleted file mode 100644 index 96fa9a9..0000000 --- a/docs/c_extensions.md +++ /dev/null @@ -1,16 +0,0 @@ ---- -title: Extensions -slug: /extensions ---- - -OSUI Extensions are a practical way to extend the possibilities with OSUI, Extensions allow for there to be a specific use or functionality that may otherwise be bloat or the opposite behavior of the use case. - -### `screen.extension(&mut self, ext: E)` -You likely noticed that we used this function in the [Hello World App With Velocity](/docs/next/#hello-world-app-with-velocity) example, this function simply allows for structures implementing [Extension](/docs/next/extensions#trait-extension) to be included in the program. - -## Trait `Extension` -### `init(&self, _widgets: &Vec>)` -Runs right after the Transform component is applied to every widget. - -### `render(&self, _widget: &Arc)` -Runs right before the `Element::render` is called. diff --git a/docusaurus.config.ts b/docusaurus.config.ts index 7df5b37..937aa80 100644 --- a/docusaurus.config.ts +++ b/docusaurus.config.ts @@ -26,6 +26,7 @@ const config: Config = { docs: { sidebarPath: "./sidebars.json", editUrl: "https://github.com/osui-rs/docs/tree/master/", + includeCurrentVersion: false, }, blog: { showReadingTime: true, @@ -47,7 +48,7 @@ const config: Config = { themeConfig: { colorMode: { - defaultMode: 'dark', + defaultMode: "dark", }, navbar: { title: "OSUI", @@ -62,7 +63,7 @@ const config: Config = { position: "left", label: "Docs", }, - {to: '/blog', label: 'Blog', position: 'left'}, + { to: "/blog", label: "Blog", position: "left" }, { type: "docsVersionDropdown", position: "left",