close #3
This commit is contained in:
		
							
								
								
									
										24
									
								
								src/main.rs
									
									
									
									
									
								
							
							
						
						
									
										24
									
								
								src/main.rs
									
									
									
									
									
								
							@@ -37,7 +37,7 @@ fn main() -> iced::Result {
 | 
			
		||||
                    if let Ok(f) = bible::get(
 | 
			
		||||
                        query,
 | 
			
		||||
                        second_query,
 | 
			
		||||
                        vec![&bible],
 | 
			
		||||
                        &bible,
 | 
			
		||||
                    ) {
 | 
			
		||||
                        println!("{}", f);
 | 
			
		||||
                    }
 | 
			
		||||
@@ -214,22 +214,18 @@ impl State {
 | 
			
		||||
                    Ok(file) => {
 | 
			
		||||
                        let mut buffer = BufWriter::new(file);
 | 
			
		||||
 | 
			
		||||
                        // the toml heading at the top of md files
 | 
			
		||||
                        let _ = buffer.write_all("---\n---\n".as_bytes());
 | 
			
		||||
 | 
			
		||||
                        for col in &self.states {
 | 
			
		||||
                            // start code block
 | 
			
		||||
                            let _ = buffer.write_all("```\n".as_bytes());
 | 
			
		||||
                            // write header
 | 
			
		||||
                            if let Some(bible) = &col.bible_selected {
 | 
			
		||||
                                let translation = &bible.translation_name;
 | 
			
		||||
                                let location = &col.bible_search;
 | 
			
		||||
 | 
			
		||||
                                let _ = buffer.write_all(format!("{translation} {location}\n").as_bytes());
 | 
			
		||||
                            }
 | 
			
		||||
                            // separate each col with hr
 | 
			
		||||
                            let _ = buffer.write_all("\n---\n".as_bytes());
 | 
			
		||||
                            if let Some(scripture) = &col.scripture_body {
 | 
			
		||||
                                // code block for scripture
 | 
			
		||||
                                let _ = buffer.write_all("```\n".as_bytes());
 | 
			
		||||
                                let _ = buffer.write_all(parse(scripture).as_bytes());
 | 
			
		||||
                                let _ = buffer.write_all("```\n".as_bytes());
 | 
			
		||||
                            }
 | 
			
		||||
                            // end code block
 | 
			
		||||
                            let _ = buffer.write_all("```\n".as_bytes());
 | 
			
		||||
 | 
			
		||||
                            let _ = buffer.write_all(&col.notes.text().as_bytes());
 | 
			
		||||
                        }
 | 
			
		||||
                        let _ = buffer.flush();
 | 
			
		||||
@@ -337,7 +333,7 @@ impl State {
 | 
			
		||||
                if let (Some(book), Some(chap_and_ver), Some(bible)) =
 | 
			
		||||
                    (book, location, &self.states[i].bible_selected)
 | 
			
		||||
                {
 | 
			
		||||
                    self.states[i].scripture_body = match bible::get(book, chap_and_ver, vec![bible]) {
 | 
			
		||||
                    self.states[i].scripture_body = match bible::get(book, chap_and_ver, bible) {
 | 
			
		||||
                        Ok(s) => {
 | 
			
		||||
                            Some(s)
 | 
			
		||||
                        },
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user