Skip to content

Commit

Permalink
Clarify docs expected markup mismatch message
Browse files Browse the repository at this point in the history
  • Loading branch information
aantron committed Apr 28, 2023
1 parent 881d26d commit 0826c26
Showing 1 changed file with 29 additions and 2 deletions.
31 changes: 29 additions & 2 deletions docs/web/postprocess/common.ml
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,35 @@ let if_expected expected test f =
f ()
else begin
Soup.write_file "actual" actual;
Printf.ksprintf failwith "Mismatch; wrote %s"
(Filename.concat (Sys.getcwd ()) "actual")
prerr_newline ();
prerr_newline ();
prerr_endline "Mismatch with expected initial HTML content.";
prerr_newline ();
prerr_endline
"The Dream docs build rewrites HTML emitted by odoc to make it neater.";
prerr_endline
"Each rewritten tag has an expected initial content for sanity checking.";

prerr_endline "The actual found content has been written to";
prerr_newline ();
prerr_endline (" " ^ (Filename.concat (Sys.getcwd ()) "actual"));
prerr_newline ();

begin match String.split_on_char '\n' actual with
| [] -> ()
| first_line::_ ->
prerr_endline "Hint:";
prerr_newline ();
prerr_endline (" " ^ first_line);
prerr_newline ()
end;

prerr_endline "Hint: make sure odoc 2.0.2 is installed.";
prerr_endline
"Other versions of odoc generate markup that doesn't match the expected.";
prerr_newline ();

Printf.ksprintf failwith "Mismatch"
end

let add_backing_lines soup =
Expand Down

0 comments on commit 0826c26

Please sign in to comment.