aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/content.rs7
-rw-r--r--src/gui.rs9
2 files changed, 16 insertions, 0 deletions
diff --git a/src/content.rs b/src/content.rs
index 18b39f7..6492431 100644
--- a/src/content.rs
+++ b/src/content.rs
@@ -70,6 +70,7 @@ pub fn extract_formatter(extract: String) -> StyledString {
70 70
71 let heading= Regex::new(r"^== (?P<d>.*) ==$").unwrap(); 71 let heading= Regex::new(r"^== (?P<d>.*) ==$").unwrap();
72 let subheading= Regex::new(r"^=== (?P<d>.*) ===$").unwrap(); 72 let subheading= Regex::new(r"^=== (?P<d>.*) ===$").unwrap();
73 let subsubheading= Regex::new(r"^==== (?P<d>.*) ====$").unwrap();
73 74
74 for line in extract.lines() { 75 for line in extract.lines() {
75 if heading.is_match(line) { 76 if heading.is_match(line) {
@@ -84,6 +85,12 @@ pub fn extract_formatter(extract: String) -> StyledString {
84 subheading.replace(line, "$d"), Effect::Italic 85 subheading.replace(line, "$d"), Effect::Italic
85 ) 86 )
86 ); 87 );
88 } else if subsubheading.is_match(line) {
89 formatted.append(
90 StyledString::styled(
91 subsubheading.replace(line, "$d"), Effect::Underline
92 )
93 );
87 } else { 94 } else {
88 formatted.append(StyledString::plain(line)); 95 formatted.append(StyledString::plain(line));
89 } 96 }
diff --git a/src/gui.rs b/src/gui.rs
new file mode 100644
index 0000000..ec2302c
--- /dev/null
+++ b/src/gui.rs
@@ -0,0 +1,9 @@
1extern crate cursive;
2
3use cursive::Cursive;
4use cursive::traits::*;
5use cursive::views::{TextView, Dialog, LinearLayout, Button};
6
7fn draw_content(s: &mut Cursive) {
8
9}