Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 15 additions & 0 deletions app/routes.res
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,17 @@ let stdlibPaths = {
->Array.filter(path => path !== "docs/manual/api/stdlib")
}

let domPaths = {
let rawFile = await Node.Fs.readFile("./markdown-pages/docs/api/dom.json", "utf-8")
let json = JSON.parseOrThrow(rawFile)
switch json {
| Object(json) => Dict.keysToArray(json)
| _ => []
}
->Array.map(key => "docs/manual/api/" ++ key)
->Array.filter(path => path !== "docs/manual/api/dom")
}

let beltPaths = {
let rawFile = await Node.Fs.readFile("./markdown-pages/docs/api/belt.json", "utf-8")
let json = JSON.parseOrThrow(rawFile)
Expand All @@ -25,6 +36,9 @@ let beltPaths = {
let stdlibRoutes =
stdlibPaths->Array.map(path => route(path, "./routes/ApiRoute.jsx", ~options={id: path}))

let domRoutes =
domPaths->Array.map(path => route(path, "./routes/ApiRoute.jsx", ~options={id: path}))

let beltRoutes =
beltPaths->Array.map(path => route(path, "./routes/ApiRoute.jsx", ~options={id: path}))

Expand Down Expand Up @@ -72,6 +86,7 @@ let default = [
route("docs/manual/api/dom", "./routes/ApiRoute.jsx", ~options={id: "api-dom"}),
...stdlibRoutes,
...beltRoutes,
...domRoutes,
...blogArticleRoutes,
...docsGuidelinesRoutes,
...communityRoutes,
Expand Down
Loading