Skip to content

Commit

Permalink
Children_order: fix error message
Browse files Browse the repository at this point in the history
  • Loading branch information
panglesd committed Nov 12, 2024
1 parent 70f7250 commit d13eac4
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 5 deletions.
3 changes: 1 addition & 2 deletions src/odoc/compile.ml
Original file line number Diff line number Diff line change
Expand Up @@ -249,8 +249,7 @@ let mld ~parent_id ~parents_children ~output ~children ~warnings_options input =
let zero_heading = Comment.find_zero_heading content in
if (not (is_index_page name)) && has_children_order frontmatter then
Error.raise_warning
(Error.filename_only
"Non-index page cannot specify (children _) in the frontmatter."
(Error.filename_only "Non-index page cannot specify @children_order."
input_s);
let root =
let file =
Expand Down
4 changes: 2 additions & 2 deletions test/frontmatter/frontmatter.t/run.t
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ When there is one frontmatter, it is extracted from the content:

$ odoc compile one_frontmatter.mld
File "one_frontmatter.mld":
Warning: Non-index page cannot specify (children _) in the frontmatter.
Warning: Non-index page cannot specify @children_order.
$ odoc_print page-one_frontmatter.odoc | jq '.frontmatter'
{
"children": {
Expand Down Expand Up @@ -62,7 +62,7 @@ When there is more than one children order, we raise a warning and keep only the
File "two_frontmatters.mld", line 2, characters 0-25:
Warning: Duplicated @children_order entry
File "two_frontmatters.mld":
Warning: Non-index page cannot specify (children _) in the frontmatter.
Warning: Non-index page cannot specify @children_order.
$ odoc_print page-two_frontmatters.odoc | jq '.frontmatter'
{
"children": {
Expand Down
2 changes: 1 addition & 1 deletion test/frontmatter/toc_order.t/run.t
Original file line number Diff line number Diff line change
Expand Up @@ -105,4 +105,4 @@ Some more parsing test:
> EOF
$ odoc compile --parent-id pkg/doc --output-dir _odoc errors/not_index.mld
File "errors/not_index.mld":
Warning: Non-index page cannot specify (children _) in the frontmatter.
Warning: Non-index page cannot specify @children_order.

0 comments on commit d13eac4

Please sign in to comment.