ParseTaskFile reads and parses a markdown file with YAML frontmatter
(filePath string)
| 32 | |
| 33 | // ParseTaskFile reads and parses a markdown file with YAML frontmatter |
| 34 | func ParseTaskFile(filePath string) (*model.Task, error) { |
| 35 | content, err := os.ReadFile(filePath) |
| 36 | if err != nil { |
| 37 | return nil, &ParseError{ |
| 38 | FilePath: filePath, |
| 39 | Message: "failed to read file", |
| 40 | Err: err, |
| 41 | } |
| 42 | } |
| 43 | |
| 44 | return ParseTaskContent(filePath, content) |
| 45 | } |
| 46 | |
| 47 | // ParseTaskContent parses task content from bytes |
| 48 | func ParseTaskContent(filePath string, content []byte) (*model.Task, error) { |
nothing calls this directly
no test coverage detected