pub fn to_markdown(&self) -> String {
        let mut md: String = String::new();

        writeln!(md, "# {}", self.date().format("%m/%d/%Y")).unwrap();
        writeln!(md, "{}", self.day()).unwrap();
        writeln!(md).unwrap();

        if let Some(tasks) = self.tasks() {
            writeln!(md, "## Tasks").unwrap();
            for category in tasks.categories() {
                writeln!(md, "- **{}**", category.name()).unwrap();
                for task in category.tasks() {
                    match task.status() {
                        self::tasks::TaskStatus::Incomplete => {
                            writeln!(md, "  - [ ] {}", task.description()).unwrap();
                        }
                        self::tasks::TaskStatus::Complete => {}
                    }
                }
            }
            writeln!(md).unwrap();
        }

        if let Some(schedule) = self.schedule() {
            writeln!(md, "## Schedule").unwrap();

            writeln!(md, "- **Planned**").unwrap();
            for event in schedule.planned() {
                let time = event.start().format("%H%M").to_string();
                writeln!(md, "  - {}\t{}", time, event.description()).unwrap();
            }

            writeln!(md, "- **Actual**").unwrap();
            for event in schedule.actual() {
                let time = event.start().format("%H%M").to_string();
                writeln!(md, "  - {}\t{}", time, event.description()).unwrap();
            }
        }
        writeln!(md, "## Notes").unwrap();
        writeln!(md).unwrap();

        md
    }
/// Exports a copy of the plan as markdown.
Exports a copy of the plan as markdown.
Exports a copy of the plan as markdown .
pub fn to_markdown(&self) -> String {
        let mut md: String = String::new();
        writeln!(md, "# {}", self.date().format("%m/%d/%Y")).unwrap();
        writeln!(md, "{}", self.day()).unwrap();
        writeln!(md).unwrap();
        if let Some(tasks) = self.tasks() {
            writeln!(md, "## Tasks").unwrap();
            for category in tasks.categories() {
                writeln!(md, "- **{}**", category.name()).unwrap();
                for task in category.tasks() {
                    match task.status() {
                        self::tasks::TaskStatus::Incomplete => {
                            writeln!(md, "  - [ ] {}", task.description()).unwrap();
                        }
                        self::tasks::TaskStatus::Complete => {}
                    }
                }
            }
            writeln!(md).unwrap();
        }
        if let Some(schedule) = self.schedule() {
            writeln!(md, "## Schedule").unwrap();
            writeln!(md, "- **Planned**").unwrap();
            for event in schedule.planned() {
                let time = event.start().format("%H%M").to_string();
                writeln!(md, "  - {}\t{}", time, event.description()).unwrap();
            }
            writeln!(md, "- **Actual**").unwrap();
            for event in schedule.actual() {
                let time = event.start().format("%H%M").to_string();
                writeln!(md, "  - {}\t{}", time, event.description()).unwrap();
            }
        }
        writeln!(md, "## Notes").unwrap();
        writeln!(md).unwrap();
        md
    }
pub fn to_markdown ( & self ) -> String { let mut md : String = String :: new ( ) ; writeln ! ( md " " self date ( ) format ( " " ) ) . unwrap ( ) ; writeln ! ( md " " self day ( ) ) . unwrap ( ) ; writeln ! ( md ) . unwrap ( ) ; if let Some ( tasks ) = self . tasks ( ) { writeln ! ( md " " ) . unwrap ( ) ; for category in tasks . categories ( ) { writeln ! ( md " " category name ( ) ) . unwrap ( ) ; for task in category . tasks ( ) { match task . status ( ) { self :: tasks :: TaskStatus :: Incomplete => { writeln ! ( md " " task description ( ) ) . unwrap ( ) ; } self :: tasks :: TaskStatus :: Complete => { } } } } writeln ! ( md ) . unwrap ( ) ; } if let Some ( schedule ) = self . schedule ( ) { writeln ! ( md " " ) . unwrap ( ) ; writeln ! ( md " " ) . unwrap ( ) ; for event in schedule . planned ( ) { let time = event . start ( ) . format ( " " ) . to_string ( ) ; writeln ! ( md " \t " time event description ( ) ) . unwrap ( ) ; } writeln ! ( md " " ) . unwrap ( ) ; for event in schedule . actual ( ) { let time = event . start ( ) . format ( " " ) . to_string ( ) ; writeln ! ( md " \t " time event description ( ) ) . unwrap ( ) ; } } writeln ! ( md " " ) . unwrap ( ) ; writeln ! ( md ) . unwrap ( ) ; md }
Exports a copy of the plan as markdown.
Exports a copy of the plan as markdown .
&self
&self