Dip editor: Multi-platform Text editor purely written in Rust

Related tags

Text editors dip
Overview

dip editor

Multi-platform Text editor purely written in Rust, supercharged by Bevy game engine and Dioxus UI framework.

  • heavily in development

Why Game Engine?

Bevy is known as a game engine but with its extensible plugin structure and remarkable ECS plugin, it could be used for not only games but anything such as this project.

What is Dioxus?

Development

Run

# Desktop
cargo run -p dip_desktop
Comments
  • Only depend on core_foundation for macos

    Only depend on core_foundation for macos

    Fixes issue #19

    Problem

    bevy_dioxus_desktop would not build on Windows because core_foundation was not limited to the macos target.

    Solution

    Updated bevy_dioxus_desktop to only use core_foundation as a dependency on macos.

    Further Work Needed

    Ensure bevy_dioxus_desktop still builds on macos.

    opened by ImDanTheDev 2
  • Config support

    Config support

    #115

    • [x] config_plugin macro
    • [x] default file source included in binary
      • [x] default path: config/default.toml
      • [x] override default config file path and file type by macro attributes
    • [x] override config file with ENV
    • [x] look for user config file and override default config
      • [x] default
        • ./{CARGO_PKG_NAME}
        • $HOME/.{CARGO_PKG_NAME}
        • $HOME/.config/{CARGO_PKG_NAME}/{CARGO_PKG_NAME}
        • $HOME/.config/{CARGO_PKG_NAME}
      • [x] override user config file path
    • [x] override by environmental variable
      • [x] prefix
      • [x] separator
    opened by JunichiSugiura 1
  • Fix 1 frame delay by introducing new UiStage

    Fix 1 frame delay by introducing new UiStage

    close #46 close #56

    New UiStage

    pub enum UiStage {
        /// Place to register Ui event
        Action,
        /// Stage to query spawned component. Mainly for registering global state changes.
        Prepare,
        /// Apply state changes -> rerender
        Render,
    }
    
    • [x] fix toggle_all
    • [x] replace VirtualDomCommand<GlobalState> with simply GlobalState

    Demo

    https://user-images.githubusercontent.com/8398372/187746591-d5cc73a8-56b2-4b75-833d-583b55479aff.mov

    opened by JunichiSugiura 1
  • Export bevy and dioxus as sub module

    Export bevy and dioxus as sub module

    close #37

    Previously

    use bevy::{log::LogPlugin, prelude::*};
    use bevy_dioxus::desktop::prelude::*;
    use dioxus::prelude::*;
    

    Now

    use bevy_dioxus::{bevy::log::LogPlugin, desktop::prelude::*};
    
    opened by JunichiSugiura 1
  • Refine global state API + TodoMVC

    Refine global state API + TodoMVC

    close #31 ref #38

    New API

    This PR introduces global_state attribute macro. It replaces GlobalStateand GlobalStatePlugin derive macro.

    fn main() {
        App::new()
            .add_plugin(DioxusPlugin::<GlobalState, (), ()>::new(Root))
            .add_plugin(GlobalStatePlugin)
            .add_startup_system(update_todo_list)
            .run();
    }
    
    #[global_state]
    struct GlobalState {
        todo_list: Vec<UiTodo>,
        // more state if you like...
    }
    
    fn update_todo_list(
        mut events: EventReader<UpdateTodoList>,
        mut global_state: EventWriter<GlobalState>,
    
    ) {
        for e in events.iter() {
            let todo_list = vec![UiTodo::new()];
            
            // ↓ global_state macro automagically turns GlobalState struct into enum
            global_state.send(GlobalState::TodoList(todo_list));
        }
    }
    
    

    Checkout todomvc example for more.

    cargo run --example todomvc
    
    # check what's generated
    cargo install expand # if not installed
    cargo expand --example todomvc
    

    Todo

    • [x] Fix other examples
    • [x] create_todo
    • [x] remove_todo
    • [x] toggle_done
    • [x] change_title
    • [x] toggle_all
    • [x] change_filter (All | Active | Completed)
    • [x] clear_completed

    Not Todo

    • ~styling~
    • ~save in localStorage~
    opened by JunichiSugiura 1
  • Configuration support

    Configuration support

    User story

    As an application developer, I'd like a plugin that allows users to easily override app default configuration.

    Example

    [dependency]
    config = "0.13"
    serde = { version = "1.0", features = ["derive"] }
    dirs = "4.0"
    
    use dip::prelude::*;
    
    fn main() {
        App::new()
            .add_plugin(ConfigPlugin)
            .add_system(log_config)
            .run();
    }
    
    #[config_plugin]
    #[derive(Debug, Deserialize)]
    struct Config {
        base_url: String,
        backend: Backend,
    }
    
    #[derive(Debug, Deserialize)]
    struct Backend {
        api_key: String,
        api_secret: String,
    }
    
    fn log_config(config: Res<Config>) {
        println!("{config:#?}");
    }
    

    Specs

    #116

    User config file path priority

    1. env
    2. ./{CARGO_PKG_NAME} (e.g. project root): mainly for development purposes
    3. $HOME/.{CARGO_PKG_NAME}
    4. $HOME/.config/{CARGO_PKG_NAME}/{CARGO_PKG_NAME}
    5. $HOME/.config/{CARGO_PKG_NAME}

    Supported file types

    mehcode/config-rs#feature-flags

    • toml
    • yaml
    • json
    • json5
    • ini
    • ron

    Cross-platform path

    dirs-dev/dirs-rs#features

    • home_dir
      • Linux/Redox: Some($HOME)
      • Windows: Some({FOLDERID_Profile})
      • macOS: Some($HOME)
    • config_dir
      • Linux/Redox: Some($XDG_CONFIG_HOME) or Some($HOME/.config)
      • Windows: Some({FOLDERID_RoamingAppData})
      • macOS: Some($HOME/Library/Application Support)

    config_plugin attribute macro

    config_plugin generates ConfigPlugin

    Options

    • CONFIG_PATH env
      • mainly for development or testing purposes
      • e.g. CONFIG_PATH=config/development cargo run
    • default_file_path
      • e.g. #[config_plugin(default_file_path = "my-default.toml")]
      • default to "config/default.toml"
    • default_file_format
      • e.g. #[config_plugin(default_file_path = "config/default.yaml", default_file_format = "yml")]
      • default to "toml"
    • env_prefix
      • e.g. #[config_plugin(env_prefix = "MYAPP")]MYAPP__BASE_URL instead of BASE_URL
      • default to ""
    • env_separator
      • e.g. #[config_plugin(env_separator = "___")]BACKEND___API_KEY
      • default to "__"
        • to avoid conflicts between field name with underscore and nested field name
    • override_user_config_path
      • To override default lookup path
      • e.g.
        #[config_plugin(
            override_user_config_path = "examples/cli/config/config/development",
            override_user_config_path = "path/to/user/config/file2",
        )]
        

    Watch support

    • [ ] File change detection
    • example

    Async source support

    • [ ] Fetch config file remotely
    • example

    Limitation

    • only read, no write support for now

    Dependencies

    • mehcode/config-rs: ⚙️ Layered configuration system for Rust applications (with strong support for 12-factor applications).
    • serde-rs/serde: Serialization framework for Rust
    • dirs-dev/dirs-rs: a low-level library that provides config/cache/data paths, following the respective conventions on Linux, macOS and Windows
    enhancement epic CLI desktop 
    opened by JunichiSugiura 0
  • async/await support

    async/await support

    User story

    As a developer, I'd like a plugin to handle async request easily from ECS. API should be consistent between cli and desktop development.

    • CLI to fetch data from api with reqwest
    • desktop fetch from ecs side

    Unsolved

    • Temporally switch to game mode only while polling future?
    enhancement CLI desktop 
    opened by JunichiSugiura 0
Releases(v0.1.1)
  • v0.1.1(Jul 16, 2022)

    Features

    • Set global state from core via fermi #8

    Bug Fixes

    • Release build issue #15
    • Windows build issue #19

    Improvements

    • Provide keyboard_event option via DioxusSettings and get rid of JS file #9

    Examples

    • Provide example for window management #10

    Docs

    • Write docs with examples at least for exposed modules #2
    Source code(tar.gz)
    Source code(zip)
Owner
Junichi Sugiura
Junichi Sugiura
A terminal-based text editor written in Rust

Iota Iota is a terminal-based text-editor written in Rust. Here's what it looks like right now, editing itself. Motivation Iota was born out of my fru

Greg Chapple 1.5k Sep 20, 2022
A text editor in ≤1024 lines of code, written in Rust

Kibi: A text editor in ≤1024 lines of code, written in Rust A configurable text editor with UTF-8 support, incremental search, syntax highlighting, li

Ilaï Deutel 839 Sep 24, 2022
Web base text editor written in rust

Ultron Ultron is a web based monospace text-editor with syntax highlighting, completely written in rust. I wrote this code editor for my very specific

Jovansonlee Cesar 59 Aug 8, 2022
An independent Rust text editor that runs in your terminal!

Ox editor Ox is a code editor that runs in your terminal. About The Project Ox is a code editor. It was written in Rust using ANSI escape sequences. I

null 2.8k Sep 27, 2022
Ginkgo is a text editor built entirely in Rust

Ginkgo is a text editor built entirely in Rust. It supports cursor movements, CTRL commands, select vim commands, insert vs. normal modes, and more. Ginkgo is based on my text editor JED, which itself was based on the popular online editor Kilo.

James Asbury 11 Mar 21, 2022
Aspiring vim-like text editor

Rim Rim is an aspiring Vim-like text editor written in Rust. Current state Rim is in an early prototype stage. This means that you can load, edit and

Mathias Hällman 547 Sep 24, 2022
An experimental next-generation Electron-based text editor

Attention: GitHub has decided not to move forward with any aspect of this project. We'll archive the repository in case anybody finds value here, but

Atom Archive 8.6k Sep 22, 2022
Archeum - a minimalist text editor

Archeum About The Project Archeum is a minimalist text editor that is really usefull if you've been in the vim psychosis for to long. Reject plugins,

null 4 Jul 1, 2022
(An attempt to write) a modal text editor

kaka (An attempt to write) a modal text editor. NOTE: The project is very young and certainly not ready for use. Current project goals keymap and mode

Marcin Pajkowski 4 Aug 15, 2022
TIF is a terminal_image_format. (theres no TIF editor, so i made TIF images through a hex editor lol)

Colors these are the colors you can use when displaying images on the terminal BYTES: 5A = BLUE 5B = BLACK 5C = RED 5D = GREEN 5E = PURPLE 5F = WHITE

buzz 4 Jun 21, 2022
A modern editor with a backend written in Rust.

Xi Editor (pronounced "Zigh") A modern editor with a backend written in Rust. Maintenance status: The xi-editor project is not currently under active

null 19.6k Sep 27, 2022
Lightning-fast and Powerful Code Editor written in Rust

Lapce Lightning-fast and Powerful Code Editor written in Rust About Lapce is written in pure Rust, with UI in Druid. It's using Xi-Editor's Rope Scien

Lapce 18k Sep 26, 2022
A collision editor for Guilty Gear -Strive-, written in Rust

ggst_collision_editor_rs A collision editor for Guilty Gear -Strive- and other Team Red Arc System Works games, written in Rust. Uses a customized ver

null 4 May 3, 2022
Helix - A kakoune / neovim inspired editor, written in Rust

A kakoune / neovim inspired editor, written in Rust. The editing model is very heavily based on kakoune; during development I found myself agree

null 13.1k Sep 28, 2022
A pathtracer written in rust - runs in the web and includes an editor

Webtracer A pathtracer written in rust - runs in the web and includes an editor Rendering is parallelized and utilizes all cpu cores You can easily ed

Shapur 2 Aug 29, 2022
syntect is a syntax highlighting library for Rust that uses Sublime Text syntax definitions.

syntect is a syntax highlighting library for Rust that uses Sublime Text syntax definitions. It aims to be a good solution for any Rust project that needs syntax highlighting, including deep integration with text editors written in Rust.

Tristan Hume 1.4k Sep 18, 2022
Wealthy Rich ported to Rust! This aims to be a crate for rich text and beautiful formatting in the terminal

Wealthy Rich ported to Rust! This aims to be a crate for rich text and beautiful formatting in the terminal

Sourajyoti Basak 12 Sep 10, 2022
Kaolinite - A crate to assist in the creation of TUI text editors.

Kaolinite - A crate to assist in the creation of TUI text editors.

null 16 Aug 30, 2022
Subtext is a text-based, block-oriented hypertext format.

Subtext: markup for note-taking Subtext is a text-based, block-oriented hypertext format. It is designed with note-taking in mind. It has a simple, pe

Gordon Brander 202 Sep 28, 2022