aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorNerdyPepper <[email protected]>2018-06-28 16:36:06 +0100
committerNerdyPepper <[email protected]>2018-06-28 16:36:06 +0100
commit95039a0abc39dcc8cfe6b9f8f5d59f0b86021f75 (patch)
tree0e7734ceb8b76729d35ad8bf6ae245b10cad681c /src
parent07412986834f08ce3a70878a332ec2e81d836b86 (diff)
Add support for sub-sub-headings
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}