let ( let* ) = Result.bind module UserPage = struct type t = { frontmatter : Frontmatter.t; content : string } let of_string md = let yaml, content = Frontmatter.extract_frontmatter md in let* frontmatter = Frontmatter.parse_frontmatter yaml in Ok { frontmatter; content } let of_file filepath = Eio.Path.load filepath |> of_string end