-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
3a6cdb8
commit 25d3913
Showing
34 changed files
with
786 additions
and
315 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
use chalk_rs::Chalk; | ||
use lealang_chalk_rs::Chalk; | ||
use std::{ | ||
env::consts::{ARCH, FAMILY, OS}, | ||
io::Write, | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,6 @@ | ||
#![allow(unused)] | ||
|
||
use chalk_rs::Chalk; | ||
use lealang_chalk_rs::Chalk; | ||
use std::{ | ||
env::args, | ||
io::{stderr, Write}, | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,10 +1,11 @@ | ||
use utils::make_sel; | ||
|
||
mod utils; | ||
|
||
pub mod viewer; | ||
|
||
#[no_mangle] | ||
pub fn run() { | ||
println!("⚠️ Under Construction ⚠️"); | ||
|
||
make_sel(); | ||
viewer::run_cursive(); | ||
//make_sel(); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,70 +1,72 @@ | ||
use std::collections::HashMap; | ||
|
||
use inquire::Select; | ||
|
||
mod docs; | ||
mod package; | ||
|
||
pub fn make_sel() { | ||
let select = vec!["📚 Lead Default", "⚒️ Workspace"]; | ||
|
||
let category = Select::new("Select", select) | ||
.prompt() | ||
.expect("You must select one..."); | ||
|
||
let data = match category { | ||
"📚 Lead Default" => docs::lead_lib(), | ||
"⚒️ Workspace" => docs::lead_ws(), | ||
_ => panic!("Invalid category"), | ||
}; | ||
|
||
let package = docs::prompt(data); | ||
let doc: HashMap<String, HashMap<&str, &str>> = package.doc; | ||
|
||
println!("{doc:?}"); | ||
navigate(&package.display, &doc); | ||
} | ||
|
||
fn navigate(display: &str, doc: &HashMap<String, HashMap<&str, &str>>) { | ||
let mut root: Option<&str> = None; | ||
|
||
#[allow(unused_assignments)] | ||
let mut last = None; | ||
|
||
let mut current_level: u8 = 0; | ||
|
||
loop { | ||
let mut choices = if current_level == 0 { vec![] } else { vec![".."] }; | ||
let mut c = match current_level { | ||
1 => doc.get(*root.as_ref().unwrap()).unwrap().iter().map(|(a,_)| a as &str).collect::<Vec<_>>(), | ||
0 => doc.iter().map(|(a, _)| a as &str).collect::<Vec<_>>(), | ||
_ => panic!("Unknown Level") | ||
}; | ||
|
||
choices.append(&mut c); | ||
choices.push("❌ Quit"); | ||
|
||
let sel = Select::new(&format!("Inside of {display}"), choices).prompt().expect("You must select one..."); | ||
|
||
match sel { | ||
".." => { | ||
current_level -= 1; | ||
}, | ||
"❌ Quit" => return (), | ||
e => { | ||
current_level += 1; | ||
|
||
match current_level { | ||
1 => root = Some(e), | ||
2 => { | ||
last = Some(e); | ||
break; | ||
}, | ||
_ => panic!("Unknown Level") | ||
} | ||
} | ||
} | ||
} | ||
|
||
println!("? {last:?}"); | ||
} | ||
pub mod docs; | ||
pub mod package; | ||
|
||
// pub fn make_sel() { | ||
// let select = vec!["📚 Lead Default", "⚒️ Workspace"]; | ||
|
||
// let category = Select::new("Select", select) | ||
// .prompt() | ||
// .expect("You must select one..."); | ||
|
||
// let data = match category { | ||
// "📚 Lead Default" => docs::lead_lib(), | ||
// "⚒️ Workspace" => docs::lead_ws(), | ||
// _ => panic!("Invalid category"), | ||
// }; | ||
|
||
// let package = docs::prompt(data); | ||
// let doc: HashMap<String, HashMap<&str, &str>> = package.doc; | ||
|
||
// navigate(&package.display, &doc); | ||
// } | ||
|
||
// fn navigate(display: &str, doc: &HashMap<String, HashMap<&str, &str>>) { | ||
// let mut root: Option<&str> = None; | ||
|
||
// #[allow(unused_assignments)] | ||
// let mut last = None; | ||
|
||
// let mut current_level: u8 = 0; | ||
|
||
// loop { | ||
// if current_level == 2 { | ||
// let doc = doc.get(*root.as_ref().unwrap()).unwrap().get(*last.as_ref().unwrap()).unwrap(); | ||
|
||
// println!("{doc}"); | ||
// //show_cursive(include_str!("../../../LICENSE")); | ||
|
||
// current_level -= 1; | ||
// continue; | ||
// } | ||
|
||
// let mut choices = if current_level == 0 { vec![] } else { vec![".."] }; | ||
// let mut c = match current_level { | ||
// 1 => doc.get(*root.as_ref().unwrap()).unwrap().iter().map(|(a,_)| a as &str).collect::<Vec<_>>(), | ||
// 0 => doc.iter().map(|(a, _)| a as &str).collect::<Vec<_>>(), | ||
// _ => panic!("Unknown Level") | ||
// }; | ||
|
||
// choices.append(&mut c); | ||
// choices.push("❌ Quit"); | ||
|
||
// let sel = Select::new(&format!("Inside of {display}"), choices).prompt().expect("You must select one..."); | ||
|
||
// match sel { | ||
// ".." => { | ||
// current_level -= 1; | ||
// }, | ||
// "❌ Quit" => return (), | ||
// e => { | ||
// current_level += 1; | ||
|
||
// match current_level { | ||
// 1 => root = Some(e), | ||
// 2 => { | ||
// last = Some(e); | ||
// }, | ||
// _ => panic!("Unknown Level") | ||
// } | ||
// } | ||
// } | ||
// } | ||
// } |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.