|
|
@ -80,7 +80,7 @@ fn walk(input: &Handle, result: &mut String) { |
|
|
|
"html" | "head" | "body" => keep_going!(input, result), |
|
|
|
"html" | "head" | "body" => keep_going!(input, result), |
|
|
|
"p" | "br" => { |
|
|
|
"p" | "br" => { |
|
|
|
keep_going!(input, result); |
|
|
|
keep_going!(input, result); |
|
|
|
result.push_str("\n "); |
|
|
|
result.push_str("\n\n "); |
|
|
|
} |
|
|
|
} |
|
|
|
"span" => { |
|
|
|
"span" => { |
|
|
|
let attrs = attrs.borrow(); |
|
|
|
let attrs = attrs.borrow(); |
|
|
@ -146,9 +146,7 @@ impl Org { |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
/// Adds information about the attachments
|
|
|
|
/// Do the initialization of saving the data in Org format.
|
|
|
|
fn attachments(&self, fp: &mut File, record: &Data) {} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
fn start_org<'a>(&self, record: &'a Data) -> Dump<'a> { |
|
|
|
fn start_org<'a>(&self, record: &'a Data) -> Dump<'a> { |
|
|
|
let org_file = self.path.join(&self.filename); |
|
|
|
let org_file = self.path.join(&self.filename); |
|
|
|
let fp = OpenOptions::new() |
|
|
|
let fp = OpenOptions::new() |
|
|
@ -177,7 +175,7 @@ impl Org { |
|
|
|
Dump { |
|
|
|
Dump { |
|
|
|
fp, |
|
|
|
fp, |
|
|
|
record, |
|
|
|
record, |
|
|
|
path: self.path, |
|
|
|
path: self.path.to_path_buf(), |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
@ -237,8 +235,11 @@ impl Dump<'_> { |
|
|
|
); |
|
|
|
); |
|
|
|
attachment.download().copy_to(&mut target).unwrap(); |
|
|
|
attachment.download().copy_to(&mut target).unwrap(); |
|
|
|
|
|
|
|
|
|
|
|
let attachment_info = |
|
|
|
let attachment_info = format!( |
|
|
|
format!(" - [[{}][{}]\n", in_storage.to_string_lossy(), filename); |
|
|
|
" - [[file:{}][{}]\n", |
|
|
|
|
|
|
|
in_storage.to_string_lossy(), |
|
|
|
|
|
|
|
filename |
|
|
|
|
|
|
|
); |
|
|
|
self.fp.write_all(attachment_info.as_bytes()).unwrap(); |
|
|
|
self.fp.write_all(attachment_info.as_bytes()).unwrap(); |
|
|
|
} |
|
|
|
} |
|
|
|
Dump::prologue(&mut self.fp); |
|
|
|
Dump::prologue(&mut self.fp); |
|
|
|