hypra

SEM-002: file has no page

Error: the page doesn't build until this is fixed.

A file you build is a page: everything in it goes inside page(...) { }, which also gives it its title and description. Files with only components and layouts, for other files to import, pass hypra check but can't be built themselves.

Fails

h1 "Shoes"
p "All our running shoes."
error[SEM-002]: a .hypra file needs a `page` element
 --> page.hypra
  = help: page(title: "...", description: "...") { ... }
  = docs: https://hypralang.dev/rules/sem-002/

error[SEM-003]: `h1` must be inside the page
 --> page.hypra:1:1
  |
1 | h1 "Shoes"
  | ^^
  = docs: https://hypralang.dev/rules/sem-003/

error[SEM-003]: `p` must be inside the page
 --> page.hypra:2:1
  |
2 | p "All our running shoes."
  | ^
  = docs: https://hypralang.dev/rules/sem-003/

3 errors, 0 warnings

Fixed

page(title: "Shoes", description: "All our running shoes, from light racers to trail shoes.") {
  h1 "Shoes"
  p "All our running shoes."
}