@@ -186,3 +186,42 @@ let ``Can build doc content using relative input path`` () =
186186 let f2md2 = File.ReadAllText( rootOutputFolderAsGiven </> " folder2" </> " in-folder2.md" )
187187 f1md1 |> shouldContainText """ ../folder2/in-folder2.md"""
188188 f2md2 |> shouldContainText """ ../folder1/in-folder1.md"""
189+
190+ [<Test>]
191+ let ``Parses frontmatter correctly `` () =
192+ let rootOutputFolderAsGiven = __ SOURCE_ DIRECTORY__ </> " previous-next-output"
193+
194+ let relativeInputFolderAsGiven =
195+ Path.GetRelativePath( System.Environment.CurrentDirectory, __ SOURCE_ DIRECTORY__ </> " previous-next" )
196+
197+ if Directory.Exists( rootOutputFolderAsGiven) then
198+ Directory.Delete( rootOutputFolderAsGiven, true )
199+
200+ let content =
201+ DocContent(
202+ rootOutputFolderAsGiven,
203+ Map.empty,
204+ lineNumbers = None,
205+ evaluate = false ,
206+ substitutions = [],
207+ saveImages = None,
208+ watch = false ,
209+ root = " https://en.wikipedia.org" ,
210+ crefResolver = ( fun _ -> None),
211+ onError = failwith
212+ )
213+
214+ let docModels = content.Convert( relativeInputFolderAsGiven, None, [])
215+ let globals = []
216+
217+ for _ thing, action in docModels do
218+ action globals
219+
220+ let fellowshipHtml = rootOutputFolderAsGiven </> " fellowship.html" |> File.ReadAllText
221+ let twoTowersHtml = rootOutputFolderAsGiven </> " two-tower.html" |> File.ReadAllText
222+ let returnHtml = rootOutputFolderAsGiven </> " return.html" |> File.ReadAllText
223+
224+ fellowshipHtml |> shouldContainText " <a href=\" two-tower.html\" >Next</a>"
225+ twoTowersHtml |> shouldContainText " <a href=\" fellowship.html\" >Previous</a>"
226+ twoTowersHtml |> shouldContainText " <a href=\" return.html\" >Next</a>"
227+ returnHtml |> shouldContainText " <a href=\" two-tower.html\" >Previous</a>"
0 commit comments