From 95039a0abc39dcc8cfe6b9f8f5d59f0b86021f75 Mon Sep 17 00:00:00 2001 From: NerdyPepper Date: Thu, 28 Jun 2018 21:06:06 +0530 Subject: Add support for sub-sub-headings --- src/content.rs | 7 +++++++ src/gui.rs | 9 +++++++++ 2 files changed, 16 insertions(+) create mode 100644 src/gui.rs 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 { let heading= Regex::new(r"^== (?P.*) ==$").unwrap(); let subheading= Regex::new(r"^=== (?P.*) ===$").unwrap(); + let subsubheading= Regex::new(r"^==== (?P.*) ====$").unwrap(); for line in extract.lines() { if heading.is_match(line) { @@ -84,6 +85,12 @@ pub fn extract_formatter(extract: String) -> StyledString { subheading.replace(line, "$d"), Effect::Italic ) ); + } else if subsubheading.is_match(line) { + formatted.append( + StyledString::styled( + subsubheading.replace(line, "$d"), Effect::Underline + ) + ); } else { formatted.append(StyledString::plain(line)); } 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 @@ +extern crate cursive; + +use cursive::Cursive; +use cursive::traits::*; +use cursive::views::{TextView, Dialog, LinearLayout, Button}; + +fn draw_content(s: &mut Cursive) { + +} -- cgit v1.2.3