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