diff --git a/src/common/App.res b/src/common/App.res index 78dfde1f5..750aaffad 100644 --- a/src/common/App.res +++ b/src/common/App.res @@ -64,36 +64,8 @@ let make = (props: props): React.element => { | (1, _) => content | _ => content } - | "v8.0.0" => - switch (Array.length(pagepath), pagepath[1]) { - | (1, _) => content - | (2, Some("js")) => content - | (2, Some("belt")) => content - | (_, Some("js")) => content - | (_, Some("belt")) => content - | (_, Some("dom")) => content - | _ => React.null - } - | "v9.0.0" => - switch (Array.length(pagepath), pagepath[1]) { - | (1, _) => content - | (2, Some("js")) => content - | (2, Some("belt")) => content - | (_, Some("js")) => content - | (_, Some("belt")) => content - | (_, Some("dom")) => content - | _ => React.null - } - | "v10.0.0" => - switch (Array.length(pagepath), pagepath[1]) { - | (1, _) => content - | (2, Some("js")) => content - | (2, Some("belt")) => content - | (_, Some("js")) => content - | (_, Some("belt")) => content - | (_, Some("dom")) => content - | _ => React.null - } + | ("v8.0.0" | "v9.0.0" | "v10.0.0") as version => + content | _ => content } | _ => diff --git a/src/layouts/ApiOverviewLayout.res b/src/layouts/ApiOverviewLayout.res index ab5b4225a..94c21c7bb 100644 --- a/src/layouts/ApiOverviewLayout.res +++ b/src/layouts/ApiOverviewLayout.res @@ -25,8 +25,17 @@ let makeCategories: string => array = version => [ module Docs = { @react.component let make = (~version, ~components=ApiMarkdown.default, ~children) => { + let router = Next.Router.useRouter() + let route = router.route + let categories = makeCategories(version) - children + + {switch version { + | "v9.0.0" | "v8.0.0" => + | _ => React.null + }} + children + } } diff --git a/src/layouts/ApiOverviewLayout10_0_0.res b/src/layouts/ApiOverviewLayout10_0_0.res deleted file mode 100644 index 1d43ca425..000000000 --- a/src/layouts/ApiOverviewLayout10_0_0.res +++ /dev/null @@ -1,38 +0,0 @@ -module Sidebar = SidebarLayout.Sidebar - -let categories: array = [ - { - name: "Introduction", - items: [{name: "Overview", href: "/docs/manual/v10.0.0/api"}], - }, - { - name: "Modules", - items: [ - {name: "Js Module", href: "/docs/manual/v10.0.0/api/js"}, - {name: "Belt Stdlib", href: "/docs/manual/v10.0.0/api/belt"}, - {name: "Dom Module", href: "/docs/manual/v10.0.0/api/dom"}, - ], - }, -] - -/* Used for API docs (structured data) */ -module Docs = { - @react.component - let make = (~components=ApiMarkdown.default, ~children) => { - let title = "API" - let version = "v10.0.0" - - children - } -} - -/* - This layout is used for structured prose text with proper H2 headings. - We cannot really use the same layout as with the Docs module, since they - have different semantic styling and do things such as hiding the text - of H2 nodes. - */ -/* module Prose = { */ -/* @react.component */ -/* let make = (~children) => children */ -/* } */ diff --git a/src/layouts/ApiOverviewLayout10_0_0.resi b/src/layouts/ApiOverviewLayout10_0_0.resi deleted file mode 100644 index 44164d31e..000000000 --- a/src/layouts/ApiOverviewLayout10_0_0.resi +++ /dev/null @@ -1,4 +0,0 @@ -module Docs: { - @react.component - let make: (~components: MarkdownComponents.t=?, ~children: React.element) => React.element -} diff --git a/src/layouts/ApiOverviewLayout8_0_0.res b/src/layouts/ApiOverviewLayout8_0_0.res deleted file mode 100644 index 2cdf8cf71..000000000 --- a/src/layouts/ApiOverviewLayout8_0_0.res +++ /dev/null @@ -1,46 +0,0 @@ -module Sidebar = SidebarLayout.Sidebar - -let categories: array = [ - { - name: "Introduction", - items: [{name: "Overview", href: "/docs/manual/v8.0.0/api"}], - }, - { - name: "Modules", - items: [ - {name: "Js Module", href: "/docs/manual/v8.0.0/api/js"}, - {name: "Belt Stdlib", href: "/docs/manual/v8.0.0/api/belt"}, - {name: "Dom Module", href: "/docs/manual/v8.0.0/api/dom"}, - ], - }, -] - -/* Used for API docs (structured data) */ -module Docs = { - @react.component - let make = (~components=ApiMarkdown.default, ~children) => { - let router = Next.Router.useRouter() - let route = router.route - - let title = "API" - let version = "v8.0.0" - - let warnBanner = - - - warnBanner - children - - } -} - -/* - This layout is used for structured prose text with proper H2 headings. - We cannot really use the same layout as with the Docs module, since they - have different semantic styling and do things such as hiding the text - of H2 nodes. - */ -/* module Prose = { */ -/* @react.component */ -/* let make = (~children) => children */ -/* } */ diff --git a/src/layouts/ApiOverviewLayout8_0_0.resi b/src/layouts/ApiOverviewLayout8_0_0.resi deleted file mode 100644 index 44164d31e..000000000 --- a/src/layouts/ApiOverviewLayout8_0_0.resi +++ /dev/null @@ -1,4 +0,0 @@ -module Docs: { - @react.component - let make: (~components: MarkdownComponents.t=?, ~children: React.element) => React.element -} diff --git a/src/layouts/ApiOverviewLayout9_0_0.res b/src/layouts/ApiOverviewLayout9_0_0.res deleted file mode 100644 index 8c229de4d..000000000 --- a/src/layouts/ApiOverviewLayout9_0_0.res +++ /dev/null @@ -1,46 +0,0 @@ -module Sidebar = SidebarLayout.Sidebar - -let categories: array = [ - { - name: "Introduction", - items: [{name: "Overview", href: "/docs/manual/v9.0.0/api"}], - }, - { - name: "Modules", - items: [ - {name: "Js Module", href: "/docs/manual/v9.0.0/api/js"}, - {name: "Belt Stdlib", href: "/docs/manual/v9.0.0/api/belt"}, - {name: "Dom Module", href: "/docs/manual/v9.0.0/api/dom"}, - ], - }, -] - -/* Used for API docs (structured data) */ -module Docs = { - @react.component - let make = (~components=ApiMarkdown.default, ~children) => { - let router = Next.Router.useRouter() - let route = router.route - - let title = "API" - let version = "v9.0.0" - - let warnBanner = - - - warnBanner - children - - } -} - -/* - This layout is used for structured prose text with proper H2 headings. - We cannot really use the same layout as with the Docs module, since they - have different semantic styling and do things such as hiding the text - of H2 nodes. - */ -/* module Prose = { */ -/* @react.component */ -/* let make = (~children) => children */ -/* } */ diff --git a/src/layouts/ApiOverviewLayout9_0_0.resi b/src/layouts/ApiOverviewLayout9_0_0.resi deleted file mode 100644 index 44164d31e..000000000 --- a/src/layouts/ApiOverviewLayout9_0_0.resi +++ /dev/null @@ -1,4 +0,0 @@ -module Docs: { - @react.component - let make: (~components: MarkdownComponents.t=?, ~children: React.element) => React.element -} diff --git a/src/layouts/ApiOverviewLayoutLegacy.res b/src/layouts/ApiOverviewLayoutLegacy.res new file mode 100644 index 000000000..4b703d18b --- /dev/null +++ b/src/layouts/ApiOverviewLayoutLegacy.res @@ -0,0 +1,406 @@ +type indexData = dict<{"moduleName": string, "headers": array<{"name": string, "href": string}>}> + +@module("index_data/v800_belt_api_index.json") +external belt_v8_data: indexData = "default" + +@module("index_data/v900_belt_api_index.json") +external belt_v9_data: indexData = "default" + +@module("index_data/v1000_belt_api_index.json") +external belt_v10_data: indexData = "default" + +@module("index_data/v800_js_api_index.json") +external js_v8_data: indexData = "default" + +@module("index_data/v900_js_api_index.json") +external js_v9_data: indexData = "default" + +@module("index_data/v1000_belt_api_index.json") +external js_v10_data: indexData = "default" + +@module("index_data/v800_dom_api_index.json") +external dom_v8_data: indexData = "default" + +@module("index_data/v900_dom_api_index.json") +external dom_v9_data: indexData = "default" + +@module("index_data/v1000_dom_api_index.json") +external dom_v10_data: indexData = "default" + +let indexData = dict{ + "belt": dict{ + "v8.0.0": belt_v8_data, + "v9.0.0": belt_v9_data, + "v10.0.0": belt_v10_data, + }, + "js": dict{ + "v8.0.0": js_v8_data, + "v9.0.0": js_v9_data, + "v10.0.0": js_v10_data, + }, + "dom": dict{ + "v8.0.0": dom_v8_data, + "v9.0.0": dom_v9_data, + "v10.0.0": dom_v10_data, + }, +} + +module Category = SidebarLayout.Sidebar.Category +module NavItem = SidebarLayout.Sidebar.NavItem + +module BeltDocs = { + let overviewNavs = [ + { + open NavItem + {name: "Introduction", href: "/docs/manual//api/belt"} + }, + ] + + let setNavs = [ + { + open NavItem + {name: "HashSet", href: "/docs/manual//api/belt/hash-set"} + }, + {name: "HashSetInt", href: "/docs/manual//api/belt/hash-set-int"}, + {name: "HashSetString", href: "/docs/manual//api/belt/hash-set-string"}, + {name: "Set", href: "/docs/manual//api/belt/set"}, + {name: "SetDict", href: "/docs/manual//api/belt/set-dict"}, + {name: "SetInt", href: "/docs/manual//api/belt/set-int"}, + {name: "SetString", href: "/docs/manual//api/belt/set-string"}, + ] + + let mapNavs = [ + { + open NavItem + {name: "HashMap", href: "/docs/manual//api/belt/hash-map"} + }, + {name: "HashMapInt", href: "/docs/manual//api/belt/hash-map-int"}, + {name: "HashMapString", href: "/docs/manual//api/belt/hash-map-string"}, + {name: "Map", href: "/docs/manual//api/belt/map"}, + {name: "MapDict", href: "/docs/manual//api/belt/map-dict"}, + {name: "MapInt", href: "/docs/manual//api/belt/map-int"}, + {name: "MapString", href: "/docs/manual//api/belt/map-string"}, + ] + + let mutableCollectionsNavs = [ + { + open NavItem + {name: "MutableMap", href: "/docs/manual//api/belt/mutable-map"} + }, + {name: "MutableMapInt", href: "/docs/manual//api/belt/mutable-map-int"}, + {name: "MutableMapString", href: "/docs/manual//api/belt/mutable-map-string"}, + {name: "MutableQueue", href: "/docs/manual//api/belt/mutable-queue"}, + {name: "MutableSet", href: "/docs/manual//api/belt/mutable-set"}, + {name: "MutableSetInt", href: "/docs/manual//api/belt/mutable-set-int"}, + {name: "MutableSetString", href: "/docs/manual//api/belt/mutable-set-string"}, + {name: "MutableStack", href: "/docs/manual//api/belt/mutable-stack"}, + ] + + let basicNavs = [ + { + open NavItem + {name: "Array", href: "/docs/manual//api/belt/array"} + }, + {name: "List", href: "/docs/manual//api/belt/list"}, + {name: "Float", href: "/docs/manual//api/belt/float"}, + {name: "Int", href: "/docs/manual//api/belt/int"}, + {name: "Range", href: "/docs/manual//api/belt/range"}, + {name: "Id", href: "/docs/manual//api/belt/id"}, + {name: "Option", href: "/docs/manual//api/belt/option"}, + {name: "Result", href: "/docs/manual//api/belt/result"}, + ] + + let sortNavs = [ + { + open NavItem + {name: "SortArray", href: "/docs/manual//api/belt/sort-array"} + }, + {name: "SortArrayInt", href: "/docs/manual//api/belt/sort-array-int"}, + {name: "SortArrayString", href: "/docs/manual//api/belt/sort-array-string"}, + ] + + let utilityNavs = [ + { + open NavItem + {name: "Debug", href: "/docs/manual//api/belt/debug"} + }, + ] + + let categories = [ + { + open Category + {name: "Overview", items: overviewNavs} + }, + {name: "Basics", items: basicNavs}, + {name: "Set", items: setNavs}, + {name: "Map", items: mapNavs}, + {name: "Mutable Collections", items: mutableCollectionsNavs}, + {name: "Sort Collections", items: sortNavs}, + {name: "Utilities", items: utilityNavs}, + ] +} + +module DomDocs = { + let overviewNavs = [ + { + open NavItem + {name: "Dom", href: "/docs/manual//api/dom"} + }, + ] + + let moduleNavs = [ + { + open NavItem + {name: "Storage", href: "/docs/manual//api/dom/storage"} + }, + { + open NavItem + {name: "Storage2", href: "/docs/manual//api/dom/storage2"} + }, + ] + + let categories = [ + { + open Category + {name: "Overview", items: overviewNavs} + }, + {name: "Submodules", items: moduleNavs}, + ] +} + +module JsDocs = { + let overviewNavs = [ + { + open NavItem + {name: "JS", href: "/docs/manual//api/js"} + }, + ] + + let apiNavs = [ + { + open NavItem + {name: "Array2", href: "/docs/manual//api/js/array-2"} + }, + {name: "Array", href: "/docs/manual//api/js/array"}, + {name: "Console", href: "/docs/manual//api/js/console"}, + {name: "Date", href: "/docs/manual//api/js/date"}, + {name: "Dict", href: "/docs/manual//api/js/dict"}, + {name: "Exn", href: "/docs/manual//api/js/exn"}, + {name: "Float", href: "/docs/manual//api/js/float"}, + {name: "Global", href: "/docs/manual//api/js/global"}, + {name: "Int", href: "/docs/manual//api/js/int"}, + {name: "Json", href: "/docs/manual//api/js/json"}, + {name: "List", href: "/docs/manual//api/js/list"}, + {name: "Math", href: "/docs/manual//api/js/math"}, + {name: "NullUndefined", href: "/docs/manual//api/js/null-undefined"}, + {name: "Null", href: "/docs/manual//api/js/null"}, + {name: "Nullable", href: "/docs/manual//api/js/nullable"}, + {name: "Obj", href: "/docs/manual//api/js/obj"}, + {name: "Option", href: "/docs/manual//api/js/option"}, + {name: "Promise", href: "/docs/manual//api/js/promise"}, + {name: "Re", href: "/docs/manual//api/js/re"}, + {name: "Result", href: "/docs/manual//api/js/result"}, + {name: "String2", href: "/docs/manual//api/js/string-2"}, + {name: "String", href: "/docs/manual//api/js/string"}, + { + name: "TypedArrayArrayBuffer", + href: "/docs/manual//api/js/typed-array_array-buffer", + }, + {name: "TypedArrayDataView", href: "/docs/manual//api/js/typed-array_data-view"}, + { + name: "TypedArrayFloat32Array", + href: "/docs/manual//api/js/typed-array_float-32-array", + }, + { + name: "TypedArrayFloat64Array", + href: "/docs/manual//api/js/typed-array_float-64-array", + }, + { + name: "TypedArrayInt8Array", + href: "/docs/manual//api/js/typed-array_int-8-array", + }, + { + name: "TypedArrayInt16Array", + href: "/docs/manual//api/js/typed-array_int-16-array", + }, + { + name: "TypedArrayInt32Array", + href: "/docs/manual//api/js/typed-array_int-32-array", + }, + {name: "TypedArrayTypeS", href: "/docs/manual//api/js/typed-array_type-s"}, + { + name: "TypedArrayUint8Array", + href: "/docs/manual//api/js/typed-array_uint-8-array", + }, + { + name: "TypedArrayUint8ClampedArray", + href: "/docs/manual//api/js/typed-array_uint-8-clamped-array", + }, + { + name: "TypedArrayUint16Array", + href: "/docs/manual//api/js/typed-array_uint-16-array", + }, + { + name: "TypedArrayUint32Array", + href: "/docs/manual//api/js/typed-array_uint-32-array", + }, + { + name: "TypedArray2ArrayBuffer", + href: "/docs/manual//api/js/typed-array-2_array-buffer", + }, + { + name: "TypedArray2DataView", + href: "/docs/manual//api/js/typed-array-2_data-view", + }, + { + name: "TypedArray2Float32Array", + href: "/docs/manual//api/js/typed-array-2_float-32-array", + }, + { + name: "TypedArray2Float64Array", + href: "/docs/manual//api/js/typed-array-2_float-64-array", + }, + { + name: "TypedArray2Int8Array", + href: "/docs/manual//api/js/typed-array-2_int-8-array", + }, + { + name: "TypedArray2Int16Array", + href: "/docs/manual//api/js/typed-array-2_int-16-array", + }, + { + name: "TypedArray2Int32Array", + href: "/docs/manual//api/js/typed-array-2_int-32-array", + }, + { + name: "TypedArray2Uint8Array", + href: "/docs/manual//api/js/typed-array-2_uint-8-array", + }, + { + name: "TypedArray2Uint8ClampedArray", + href: "/docs/manual//api/js/typed-array-2_uint-8-clamped-array", + }, + { + name: "TypedArray2Uint16Array", + href: "/docs/manual//api/js/typed-array-2_uint-16-array", + }, + { + name: "TypedArray2Uint32Array", + href: "/docs/manual//api/js/typed-array-2_uint-32-array", + }, + {name: "TypedArray2", href: "/docs/manual//api/js/typed-array-2"}, + {name: "TypedArray", href: "/docs/manual//api/js/typed-array"}, + {name: "Types", href: "/docs/manual//api/js/types"}, + {name: "Undefined", href: "/docs/manual//api/js/undefined"}, + {name: "Vector", href: "/docs/manual//api/js/vector"}, + ] + + let categories = [ + { + open Category + {name: "Overview", items: overviewNavs} + }, + {name: "Submodules", items: apiNavs}, + ] +} + +module type Docs = { + let categories: array +} + +let makeCategories = (module_: module(Docs), version) => { + let module(Docs) = module_ + Docs.categories->Array.map(({name, items}) => { + let items = items->Array.map(item => { + ...item, + href: item.href->String.replace("", version), + }) + {Category.name, items} + }) +} + +let moduleCategories = (moduleName, version) => { + switch moduleName { + | "belt" => makeCategories(module(BeltDocs), version) + | "js" => makeCategories(module(JsDocs), version) + | "dom" => makeCategories(module(DomDocs), version) + | _ => [] + } +} + +@react.component +let make = (~components=ApiMarkdown.default, ~version, ~children) => { + let router = Next.Router.useRouter() + let route = router.route + let url = router.route->Url.parse + + let warnBanner = + + switch url.pagepath->Array.get(1) { + | None => + let title = "API" + let categories: array = [ + { + name: "Introduction", + items: [{name: "Overview", href: `/docs/manual/${version}/api`}], + }, + { + name: "Modules", + items: [ + {name: "Js Module", href: `/docs/manual/${version}/api/js`}, + {name: "Belt Module", href: `/docs/manual/${version}/api/belt`}, + {name: "Dom Module", href: `/docs/manual/${version}/api/dom`}, + ], + }, + ] + + warnBanner + children + + | Some(moduleName) => + let indexData = switch Dict.get(indexData, moduleName) { + | Some(moduleData) => + Dict.get(moduleData, version)->Option.getOrThrow( + ~message=`Not found data for ${moduleName} version ${version}`, + ) + | None => throw(Failure(`Not found index data for module: ${moduleName}`)) + } + + // Gather data for the CollapsibleSection + let headers = { + open Option + Dict.get(indexData, route) + ->map(data => data["headers"]->Array.map(header => (header["name"], "#" ++ header["href"]))) + ->getOr([]) + } + + let prefix = { + open Url + {name: "API", href: "/docs/manual/" ++ (version ++ "/api")} + } + + let breadcrumbs = ApiLayout.makeBreadcrumbs(~prefix, route) + + let activeToc = { + open SidebarLayout.Toc + { + title: moduleName, + entries: Array.map(headers, ((name, href)) => {header: name, href}), + } + } + + let categories = moduleCategories(moduleName, version) + + let title = switch moduleName { + | "belt" => "Belt Module" + | "js" => "Js Module" + | "dom" => "Dom Module" + | _ => assert(false) + } + + + warnBanner + children + + } +} diff --git a/src/layouts/ApiOverviewLayoutLegacy.resi b/src/layouts/ApiOverviewLayoutLegacy.resi new file mode 100644 index 000000000..5a14a5123 --- /dev/null +++ b/src/layouts/ApiOverviewLayoutLegacy.resi @@ -0,0 +1,6 @@ +@react.component +let make: ( + ~components: MarkdownComponents.t=?, + ~version: string, + ~children: React.element, +) => React.element diff --git a/src/layouts/BeltDocsLayout10_0_0.res b/src/layouts/BeltDocsLayout10_0_0.res deleted file mode 100644 index 1a3e94d6a..000000000 --- a/src/layouts/BeltDocsLayout10_0_0.res +++ /dev/null @@ -1,152 +0,0 @@ -// Structure defined by `scripts/extract-indices.js` -@module("index_data/v1000_belt_api_index.json") -external indexData: Dict.t<{ - "moduleName": string, - "headers": array<{ - "name": string, - "href": string, - }>, -}> = "default" - -module Category = SidebarLayout.Sidebar.Category -module NavItem = SidebarLayout.Sidebar.NavItem - -let overviewNavs = [ - { - open NavItem - {name: "Introduction", href: "/docs/manual/v10.0.0/api/belt"} - }, -] - -let setNavs = [ - { - open NavItem - {name: "HashSet", href: "/docs/manual/v10.0.0/api/belt/hash-set"} - }, - {name: "HashSetInt", href: "/docs/manual/v10.0.0/api/belt/hash-set-int"}, - {name: "HashSetString", href: "/docs/manual/v10.0.0/api/belt/hash-set-string"}, - {name: "Set", href: "/docs/manual/v10.0.0/api/belt/set"}, - {name: "SetDict", href: "/docs/manual/v10.0.0/api/belt/set-dict"}, - {name: "SetInt", href: "/docs/manual/v10.0.0/api/belt/set-int"}, - {name: "SetString", href: "/docs/manual/v10.0.0/api/belt/set-string"}, -] - -let mapNavs = [ - { - open NavItem - {name: "HashMap", href: "/docs/manual/v10.0.0/api/belt/hash-map"} - }, - {name: "HashMapInt", href: "/docs/manual/v10.0.0/api/belt/hash-map-int"}, - {name: "HashMapString", href: "/docs/manual/v10.0.0/api/belt/hash-map-string"}, - {name: "Map", href: "/docs/manual/v10.0.0/api/belt/map"}, - {name: "MapDict", href: "/docs/manual/v10.0.0/api/belt/map-dict"}, - {name: "MapInt", href: "/docs/manual/v10.0.0/api/belt/map-int"}, - {name: "MapString", href: "/docs/manual/v10.0.0/api/belt/map-string"}, -] - -let mutableCollectionsNavs = [ - { - open NavItem - {name: "MutableMap", href: "/docs/manual/v10.0.0/api/belt/mutable-map"} - }, - {name: "MutableMapInt", href: "/docs/manual/v10.0.0/api/belt/mutable-map-int"}, - {name: "MutableMapString", href: "/docs/manual/v10.0.0/api/belt/mutable-map-string"}, - {name: "MutableQueue", href: "/docs/manual/v10.0.0/api/belt/mutable-queue"}, - {name: "MutableSet", href: "/docs/manual/v10.0.0/api/belt/mutable-set"}, - {name: "MutableSetInt", href: "/docs/manual/v10.0.0/api/belt/mutable-set-int"}, - {name: "MutableSetString", href: "/docs/manual/v10.0.0/api/belt/mutable-set-string"}, - {name: "MutableStack", href: "/docs/manual/v10.0.0/api/belt/mutable-stack"}, -] - -let basicNavs = [ - { - open NavItem - {name: "Array", href: "/docs/manual/v10.0.0/api/belt/array"} - }, - {name: "List", href: "/docs/manual/v10.0.0/api/belt/list"}, - {name: "Float", href: "/docs/manual/v10.0.0/api/belt/float"}, - {name: "Int", href: "/docs/manual/v10.0.0/api/belt/int"}, - {name: "Range", href: "/docs/manual/v10.0.0/api/belt/range"}, - {name: "Id", href: "/docs/manual/v10.0.0/api/belt/id"}, - {name: "Option", href: "/docs/manual/v10.0.0/api/belt/option"}, - {name: "Result", href: "/docs/manual/v10.0.0/api/belt/result"}, -] - -let sortNavs = [ - { - open NavItem - {name: "SortArray", href: "/docs/manual/v10.0.0/api/belt/sort-array"} - }, - {name: "SortArrayInt", href: "/docs/manual/v10.0.0/api/belt/sort-array-int"}, - {name: "SortArrayString", href: "/docs/manual/v10.0.0/api/belt/sort-array-string"}, -] - -let utilityNavs = [ - { - open NavItem - {name: "Debug", href: "/docs/manual/v10.0.0/api/belt/debug"} - }, -] - -let categories = [ - { - open Category - {name: "Overview", items: overviewNavs} - }, - {name: "Basics", items: basicNavs}, - {name: "Set", items: setNavs}, - {name: "Map", items: mapNavs}, - {name: "Mutable Collections", items: mutableCollectionsNavs}, - {name: "Sort Collections", items: sortNavs}, - {name: "Utilities", items: utilityNavs}, -] - -module Docs = { - @react.component - let make = (~components=ApiMarkdown.default, ~children) => { - let router = Next.Router.useRouter() - let route = router.route - - // Gather data for the CollapsibleSection - let headers = { - open Option - Dict.get(indexData, route) - ->map(data => data["headers"]->Array.map(header => (header["name"], "#" ++ header["href"]))) - ->getOr([]) - } - - let moduleName = { - open Option - Dict.get(indexData, route)->map(data => data["moduleName"])->getOr("?") - } - - let url = route->Url.parse - - let version = url->Url.getVersionString - - let prefix = { - open Url - {name: "API", href: "/docs/manual/" ++ (version ++ "/api")} - } - - let breadcrumbs = ApiLayout.makeBreadcrumbs(~prefix, route) - - let activeToc = { - open SidebarLayout.Toc - { - title: moduleName, - entries: Array.map(headers, ((name, href)) => {header: name, href}), - } - } - - let title = "Belt Stdlib" - let version = "v10.0.0" - - children - } -} - -module Prose = { - @react.component - let make = (~children) => children -} diff --git a/src/layouts/BeltDocsLayout10_0_0.resi b/src/layouts/BeltDocsLayout10_0_0.resi deleted file mode 100644 index 8e4b9eb04..000000000 --- a/src/layouts/BeltDocsLayout10_0_0.resi +++ /dev/null @@ -1,9 +0,0 @@ -module Docs: { - @react.component - let make: (~components: MarkdownComponents.t=?, ~children: React.element) => React.element -} - -module Prose: { - @react.component - let make: (~children: React.element) => React.element -} diff --git a/src/layouts/BeltDocsLayout8_0_0.res b/src/layouts/BeltDocsLayout8_0_0.res deleted file mode 100644 index 614adad86..000000000 --- a/src/layouts/BeltDocsLayout8_0_0.res +++ /dev/null @@ -1,184 +0,0 @@ -// Structure defined by `scripts/extract-indices.js` -@module("index_data/v800_belt_api_index.json") -external indexData: Dict.t<{ - "moduleName": string, - "headers": array<{ - "name": string, - "href": string, - }>, -}> = "default" - -module Category = SidebarLayout.Sidebar.Category -module NavItem = SidebarLayout.Sidebar.NavItem - -let overviewNavs = [ - { - open NavItem - {name: "Introduction", href: "/docs/manual/v8.0.0/api/belt"} - }, -] - -let setNavs = [ - { - open NavItem - {name: "HashSet", href: "/docs/manual/v8.0.0/api/belt/hash-set"} - }, - {name: "HashSetInt", href: "/docs/manual/v8.0.0/api/belt/hash-set-int"}, - { - name: "HashSetString", - href: "/docs/manual/v8.0.0/api/belt/hash-set-string", - }, - {name: "Set", href: "/docs/manual/v8.0.0/api/belt/set"}, - {name: "SetDict", href: "/docs/manual/v8.0.0/api/belt/set-dict"}, - {name: "SetInt", href: "/docs/manual/v8.0.0/api/belt/set-int"}, - {name: "SetString", href: "/docs/manual/v8.0.0/api/belt/set-string"}, -] - -let mapNavs = [ - { - open NavItem - {name: "HashMap", href: "/docs/manual/v8.0.0/api/belt/hash-map"} - }, - {name: "HashMapInt", href: "/docs/manual/v8.0.0/api/belt/hash-map-int"}, - { - name: "HashMapString", - href: "/docs/manual/v8.0.0/api/belt/hash-map-string", - }, - {name: "Map", href: "/docs/manual/v8.0.0/api/belt/map"}, - {name: "MapDict", href: "/docs/manual/v8.0.0/api/belt/map-dict"}, - {name: "MapInt", href: "/docs/manual/v8.0.0/api/belt/map-int"}, - {name: "MapString", href: "/docs/manual/v8.0.0/api/belt/map-string"}, -] - -let mutableCollectionsNavs = [ - { - open NavItem - { - name: "MutableMap", - href: "/docs/manual/v8.0.0/api/belt/mutable-map", - } - }, - { - name: "MutableMapInt", - href: "/docs/manual/v8.0.0/api/belt/mutable-map-int", - }, - { - name: "MutableMapString", - href: "/docs/manual/v8.0.0/api/belt/mutable-map-string", - }, - {name: "MutableQueue", href: "/docs/manual/v8.0.0/api/belt/mutable-queue"}, - {name: "MutableSet", href: "/docs/manual/v8.0.0/api/belt/mutable-set"}, - { - name: "MutableSetInt", - href: "/docs/manual/v8.0.0/api/belt/mutable-set-int", - }, - { - name: "MutableSetString", - href: "/docs/manual/v8.0.0/api/belt/mutable-set-string", - }, - {name: "MutableStack", href: "/docs/manual/v8.0.0/api/belt/mutable-stack"}, -] - -let basicNavs = [ - { - open NavItem - {name: "Array", href: "/docs/manual/v8.0.0/api/belt/array"} - }, - {name: "List", href: "/docs/manual/v8.0.0/api/belt/list"}, - {name: "Float", href: "/docs/manual/v8.0.0/api/belt/float"}, - {name: "Int", href: "/docs/manual/v8.0.0/api/belt/int"}, - {name: "Range", href: "/docs/manual/v8.0.0/api/belt/range"}, - {name: "Id", href: "/docs/manual/v8.0.0/api/belt/id"}, - {name: "Option", href: "/docs/manual/v8.0.0/api/belt/option"}, - {name: "Result", href: "/docs/manual/v8.0.0/api/belt/result"}, -] - -let sortNavs = [ - { - open NavItem - { - name: "SortArray", - href: "/docs/manual/v8.0.0/api/belt/sort-array", - } - }, - {name: "SortArrayInt", href: "/docs/manual/v8.0.0/api/belt/sort-array-int"}, - { - name: "SortArrayString", - href: "/docs/manual/v8.0.0/api/belt/sort-array-string", - }, -] - -let utilityNavs = [ - { - open NavItem - {name: "Debug", href: "/docs/manual/v8.0.0/api/belt/debug"} - }, -] - -let categories = [ - { - open Category - {name: "Overview", items: overviewNavs} - }, - {name: "Basics", items: basicNavs}, - {name: "Set", items: setNavs}, - {name: "Map", items: mapNavs}, - {name: "Mutable Collections", items: mutableCollectionsNavs}, - {name: "Sort Collections", items: sortNavs}, - {name: "Utilities", items: utilityNavs}, -] - -module Docs = { - @react.component - let make = (~components=ApiMarkdown.default, ~children) => { - let router = Next.Router.useRouter() - let route = router.route - - // Gather data for the CollapsibleSection - let headers = { - open Option - Dict.get(indexData, route) - ->map(data => data["headers"]->Array.map(header => (header["name"], "#" ++ header["href"]))) - ->getOr([]) - } - - let moduleName = { - open Option - Dict.get(indexData, route)->map(data => data["moduleName"])->getOr("?") - } - - let url = route->Url.parse - - let version = url->Url.getVersionString - - let prefix = { - open Url - {name: "API", href: "/docs/manual/" ++ (version ++ "/api")} - } - - let breadcrumbs = ApiLayout.makeBreadcrumbs(~prefix, route) - - let activeToc = { - open SidebarLayout.Toc - { - title: moduleName, - entries: Array.map(headers, ((name, href)) => {header: name, href}), - } - } - - let title = "Belt Stdlib" - let version = "v8.0.0" - - let warnBanner = - - - warnBanner - children - - } -} - -module Prose = { - @react.component - let make = (~children) => children -} diff --git a/src/layouts/BeltDocsLayout8_0_0.resi b/src/layouts/BeltDocsLayout8_0_0.resi deleted file mode 100644 index 8e4b9eb04..000000000 --- a/src/layouts/BeltDocsLayout8_0_0.resi +++ /dev/null @@ -1,9 +0,0 @@ -module Docs: { - @react.component - let make: (~components: MarkdownComponents.t=?, ~children: React.element) => React.element -} - -module Prose: { - @react.component - let make: (~children: React.element) => React.element -} diff --git a/src/layouts/BeltDocsLayout9_0_0.res b/src/layouts/BeltDocsLayout9_0_0.res deleted file mode 100644 index c40eb5a4c..000000000 --- a/src/layouts/BeltDocsLayout9_0_0.res +++ /dev/null @@ -1,152 +0,0 @@ -// Structure defined by `scripts/extract-indices.js` -@module("index_data/v900_belt_api_index.json") -external indexData: Dict.t<{ - "moduleName": string, - "headers": array<{ - "name": string, - "href": string, - }>, -}> = "default" - -module Category = SidebarLayout.Sidebar.Category -module NavItem = SidebarLayout.Sidebar.NavItem - -let overviewNavs = [ - { - open NavItem - {name: "Introduction", href: "/docs/manual/v9.0.0/api/belt"} - }, -] - -let setNavs = [ - { - open NavItem - {name: "HashSet", href: "/docs/manual/v9.0.0/api/belt/hash-set"} - }, - {name: "HashSetInt", href: "/docs/manual/v9.0.0/api/belt/hash-set-int"}, - {name: "HashSetString", href: "/docs/manual/v9.0.0/api/belt/hash-set-string"}, - {name: "Set", href: "/docs/manual/v9.0.0/api/belt/set"}, - {name: "SetDict", href: "/docs/manual/v9.0.0/api/belt/set-dict"}, - {name: "SetInt", href: "/docs/manual/v9.0.0/api/belt/set-int"}, - {name: "SetString", href: "/docs/manual/v9.0.0/api/belt/set-string"}, -] - -let mapNavs = [ - { - open NavItem - {name: "HashMap", href: "/docs/manual/v9.0.0/api/belt/hash-map"} - }, - {name: "HashMapInt", href: "/docs/manual/v9.0.0/api/belt/hash-map-int"}, - {name: "HashMapString", href: "/docs/manual/v9.0.0/api/belt/hash-map-string"}, - {name: "Map", href: "/docs/manual/v9.0.0/api/belt/map"}, - {name: "MapDict", href: "/docs/manual/v9.0.0/api/belt/map-dict"}, - {name: "MapInt", href: "/docs/manual/v9.0.0/api/belt/map-int"}, - {name: "MapString", href: "/docs/manual/v9.0.0/api/belt/map-string"}, -] - -let mutableCollectionsNavs = [ - { - open NavItem - {name: "MutableMap", href: "/docs/manual/v9.0.0/api/belt/mutable-map"} - }, - {name: "MutableMapInt", href: "/docs/manual/v9.0.0/api/belt/mutable-map-int"}, - {name: "MutableMapString", href: "/docs/manual/v9.0.0/api/belt/mutable-map-string"}, - {name: "MutableQueue", href: "/docs/manual/v9.0.0/api/belt/mutable-queue"}, - {name: "MutableSet", href: "/docs/manual/v9.0.0/api/belt/mutable-set"}, - {name: "MutableSetInt", href: "/docs/manual/v9.0.0/api/belt/mutable-set-int"}, - {name: "MutableSetString", href: "/docs/manual/v9.0.0/api/belt/mutable-set-string"}, - {name: "MutableStack", href: "/docs/manual/v9.0.0/api/belt/mutable-stack"}, -] - -let basicNavs = [ - { - open NavItem - {name: "Array", href: "/docs/manual/v9.0.0/api/belt/array"} - }, - {name: "List", href: "/docs/manual/v9.0.0/api/belt/list"}, - {name: "Float", href: "/docs/manual/v9.0.0/api/belt/float"}, - {name: "Int", href: "/docs/manual/v9.0.0/api/belt/int"}, - {name: "Range", href: "/docs/manual/v9.0.0/api/belt/range"}, - {name: "Id", href: "/docs/manual/v9.0.0/api/belt/id"}, - {name: "Option", href: "/docs/manual/v9.0.0/api/belt/option"}, - {name: "Result", href: "/docs/manual/v9.0.0/api/belt/result"}, -] - -let sortNavs = [ - { - open NavItem - {name: "SortArray", href: "/docs/manual/v9.0.0/api/belt/sort-array"} - }, - {name: "SortArrayInt", href: "/docs/manual/v9.0.0/api/belt/sort-array-int"}, - {name: "SortArrayString", href: "/docs/manual/v9.0.0/api/belt/sort-array-string"}, -] - -let utilityNavs = [ - { - open NavItem - {name: "Debug", href: "/docs/manual/v9.0.0/api/belt/debug"} - }, -] - -let categories = [ - { - open Category - {name: "Overview", items: overviewNavs} - }, - {name: "Basics", items: basicNavs}, - {name: "Set", items: setNavs}, - {name: "Map", items: mapNavs}, - {name: "Mutable Collections", items: mutableCollectionsNavs}, - {name: "Sort Collections", items: sortNavs}, - {name: "Utilities", items: utilityNavs}, -] - -module Docs = { - @react.component - let make = (~components=ApiMarkdown.default, ~children) => { - let router = Next.Router.useRouter() - let route = router.route - - // Gather data for the CollapsibleSection - let headers = { - open Option - Dict.get(indexData, route) - ->map(data => data["headers"]->Array.map(header => (header["name"], "#" ++ header["href"]))) - ->getOr([]) - } - - let moduleName = { - open Option - Dict.get(indexData, route)->map(data => data["moduleName"])->getOr("?") - } - - let url = route->Url.parse - - let version = url->Url.getVersionString - - let prefix = { - open Url - {name: "API", href: "/docs/manual/" ++ (version ++ "/api")} - } - - let breadcrumbs = ApiLayout.makeBreadcrumbs(~prefix, route) - - let activeToc = { - open SidebarLayout.Toc - { - title: moduleName, - entries: Array.map(headers, ((name, href)) => {header: name, href}), - } - } - - let title = "Belt Stdlib" - let version = "latest" - - children - } -} - -module Prose = { - @react.component - let make = (~children) => children -} diff --git a/src/layouts/DomDocsLayout10_0_0.res b/src/layouts/DomDocsLayout10_0_0.res deleted file mode 100644 index 73bd5a4c0..000000000 --- a/src/layouts/DomDocsLayout10_0_0.res +++ /dev/null @@ -1,88 +0,0 @@ -// Structure defined by `scripts/extract-indices.js` -@module("index_data/v1000_dom_api_index.json") -external indexData: Dict.t<{ - "moduleName": string, - "headers": array<{ - "name": string, - "href": string, - }>, -}> = "default" - -module Category = SidebarLayout.Sidebar.Category -module NavItem = SidebarLayout.Sidebar.NavItem - -let overviewNavs = [ - { - open NavItem - {name: "Dom", href: "/docs/manual/v9.0.0/api/dom"} - }, -] - -let moduleNavs = [ - { - open NavItem - {name: "Storage", href: "/docs/manual/v9.0.0/api/dom/storage"} - }, - { - open NavItem - {name: "Storage2", href: "/docs/manual/v9.0.0/api/dom/storage2"} - }, -] - -let categories = [ - { - open Category - {name: "Overview", items: overviewNavs} - }, - {name: "Submodules", items: moduleNavs}, -] - -module Docs = { - @react.component - let make = (~components=ApiMarkdown.default, ~children) => { - let router = Next.Router.useRouter() - let route = router.route - - // Gather data for the CollapsibleSection - let headers = { - open Option - Dict.get(indexData, route) - ->map(data => data["headers"]->Array.map(header => (header["name"], "#" ++ header["href"]))) - ->getOr([]) - } - - let moduleName = { - open Option - Dict.get(indexData, route)->map(data => data["moduleName"])->getOr("?") - } - - let url = route->Url.parse - - let version = url->Url.getVersionString - - let prefix = { - open Url - {name: "API", href: "/docs/manual/" ++ (version ++ "/api")} - } - - let breadcrumbs = ApiLayout.makeBreadcrumbs(~prefix, route) - - let activeToc = { - open SidebarLayout.Toc - { - title: moduleName, - entries: Array.map(headers, ((name, href)) => {header: name, href}), - } - } - - let title = "Dom Module" - let version = "v9.0.0" - - children - } -} - -module Prose = { - @react.component - let make = (~children) => children -} diff --git a/src/layouts/DomDocsLayout10_0_0.resi b/src/layouts/DomDocsLayout10_0_0.resi deleted file mode 100644 index 8e4b9eb04..000000000 --- a/src/layouts/DomDocsLayout10_0_0.resi +++ /dev/null @@ -1,9 +0,0 @@ -module Docs: { - @react.component - let make: (~components: MarkdownComponents.t=?, ~children: React.element) => React.element -} - -module Prose: { - @react.component - let make: (~children: React.element) => React.element -} diff --git a/src/layouts/DomDocsLayout8_0_0.res b/src/layouts/DomDocsLayout8_0_0.res deleted file mode 100644 index 259dcbb88..000000000 --- a/src/layouts/DomDocsLayout8_0_0.res +++ /dev/null @@ -1,93 +0,0 @@ -// Structure defined by `scripts/extract-indices.js` -@module("index_data/v800_dom_api_index.json") -external indexData: Dict.t<{ - "moduleName": string, - "headers": array<{ - "name": string, - "href": string, - }>, -}> = "default" - -module Category = SidebarLayout.Sidebar.Category -module NavItem = SidebarLayout.Sidebar.NavItem - -let overviewNavs = [ - { - open NavItem - {name: "Dom", href: "/docs/manual/v8.0.0/api/dom"} - }, -] - -let moduleNavs = [ - { - open NavItem - {name: "Storage", href: "/docs/manual/v8.0.0/api/dom/storage"} - }, - { - open NavItem - {name: "Storage2", href: "/docs/manual/v8.0.0/api/dom/storage2"} - }, -] - -let categories = [ - { - open Category - {name: "Overview", items: overviewNavs} - }, - {name: "Submodules", items: moduleNavs}, -] - -module Docs = { - @react.component - let make = (~components=ApiMarkdown.default, ~children) => { - let router = Next.Router.useRouter() - let route = router.route - - // Gather data for the CollapsibleSection - let headers = { - open Option - Dict.get(indexData, route) - ->map(data => data["headers"]->Array.map(header => (header["name"], "#" ++ header["href"]))) - ->getOr([]) - } - - let moduleName = { - open Option - Dict.get(indexData, route)->map(data => data["moduleName"])->getOr("?") - } - - let url = route->Url.parse - - let version = url->Url.getVersionString - - let prefix = { - open Url - {name: "API", href: "/docs/manual/" ++ (version ++ "/api")} - } - - let breadcrumbs = ApiLayout.makeBreadcrumbs(~prefix, route) - - let activeToc = { - open SidebarLayout.Toc - { - title: moduleName, - entries: Array.map(headers, ((name, href)) => {header: name, href}), - } - } - - let title = "Dom Module" - let version = "v8.0.0" - - let warnBanner = - - - warnBanner - children - - } -} - -module Prose = { - @react.component - let make = (~children) => children -} diff --git a/src/layouts/DomDocsLayout8_0_0.resi b/src/layouts/DomDocsLayout8_0_0.resi deleted file mode 100644 index 8e4b9eb04..000000000 --- a/src/layouts/DomDocsLayout8_0_0.resi +++ /dev/null @@ -1,9 +0,0 @@ -module Docs: { - @react.component - let make: (~components: MarkdownComponents.t=?, ~children: React.element) => React.element -} - -module Prose: { - @react.component - let make: (~children: React.element) => React.element -} diff --git a/src/layouts/DomDocsLayout9_0_0.res b/src/layouts/DomDocsLayout9_0_0.res deleted file mode 100644 index 79827dc7d..000000000 --- a/src/layouts/DomDocsLayout9_0_0.res +++ /dev/null @@ -1,93 +0,0 @@ -// Structure defined by `scripts/extract-indices.js` -@module("index_data/v900_dom_api_index.json") -external indexData: Dict.t<{ - "moduleName": string, - "headers": array<{ - "name": string, - "href": string, - }>, -}> = "default" - -module Category = SidebarLayout.Sidebar.Category -module NavItem = SidebarLayout.Sidebar.NavItem - -let overviewNavs = [ - { - open NavItem - {name: "Dom", href: "/docs/manual/v9.0.0/api/dom"} - }, -] - -let moduleNavs = [ - { - open NavItem - {name: "Storage", href: "/docs/manual/v9.0.0/api/dom/storage"} - }, - { - open NavItem - {name: "Storage2", href: "/docs/manual/v9.0.0/api/dom/storage2"} - }, -] - -let categories = [ - { - open Category - {name: "Overview", items: overviewNavs} - }, - {name: "Submodules", items: moduleNavs}, -] - -module Docs = { - @react.component - let make = (~components=ApiMarkdown.default, ~children) => { - let router = Next.Router.useRouter() - let route = router.route - - // Gather data for the CollapsibleSection - let headers = { - open Option - Dict.get(indexData, route) - ->map(data => data["headers"]->Array.map(header => (header["name"], "#" ++ header["href"]))) - ->getOr([]) - } - - let moduleName = { - open Option - Dict.get(indexData, route)->map(data => data["moduleName"])->getOr("?") - } - - let url = route->Url.parse - - let version = url->Url.getVersionString - - let prefix = { - open Url - {name: "API", href: "/docs/manual/" ++ (version ++ "/api")} - } - - let breadcrumbs = ApiLayout.makeBreadcrumbs(~prefix, route) - - let activeToc = { - open SidebarLayout.Toc - { - title: moduleName, - entries: Array.map(headers, ((name, href)) => {header: name, href}), - } - } - - let title = "Dom Module" - let version = "v9.0.0" - - let warnBanner = - - - warnBanner - children - - } -} - -module Prose = { - @react.component - let make = (~children) => children -} diff --git a/src/layouts/DomDocsLayout9_0_0.resi b/src/layouts/DomDocsLayout9_0_0.resi deleted file mode 100644 index 3f9b2e92a..000000000 --- a/src/layouts/DomDocsLayout9_0_0.resi +++ /dev/null @@ -1,8 +0,0 @@ -module Docs: { - @react.component - let make: (~components: MarkdownComponents.t=?, ~children: React.element) => React.element -} -module Prose: { - @react.component - let make: (~children: React.element) => React.element -} diff --git a/src/layouts/JsDocsLayout10_0_0.res b/src/layouts/JsDocsLayout10_0_0.res deleted file mode 100644 index d44dbf21c..000000000 --- a/src/layouts/JsDocsLayout10_0_0.res +++ /dev/null @@ -1,196 +0,0 @@ -// Structure defined by `scripts/extract-indices.js` -@module("index_data/v1000_js_api_index.json") -external indexData: Dict.t<{ - "moduleName": string, - "headers": array<{ - "name": string, - "href": string, - }>, -}> = "default" - -module Category = SidebarLayout.Sidebar.Category -module NavItem = SidebarLayout.Sidebar.NavItem - -let overviewNavs = [ - { - open NavItem - {name: "JS", href: "/docs/manual/v10.0.0/api/js"} - }, -] - -let apiNavs = [ - { - open NavItem - {name: "Array2", href: "/docs/manual/v10.0.0/api/js/array-2"} - }, - {name: "Array", href: "/docs/manual/v10.0.0/api/js/array"}, - {name: "Console", href: "/docs/manual/v10.0.0/api/js/console"}, - {name: "Date", href: "/docs/manual/v10.0.0/api/js/date"}, - {name: "Dict", href: "/docs/manual/v10.0.0/api/js/dict"}, - {name: "Exn", href: "/docs/manual/v10.0.0/api/js/exn"}, - {name: "Float", href: "/docs/manual/v10.0.0/api/js/float"}, - {name: "Global", href: "/docs/manual/v10.0.0/api/js/global"}, - {name: "Int", href: "/docs/manual/v10.0.0/api/js/int"}, - {name: "Json", href: "/docs/manual/v10.0.0/api/js/json"}, - {name: "List", href: "/docs/manual/v10.0.0/api/js/list"}, - {name: "Math", href: "/docs/manual/v10.0.0/api/js/math"}, - {name: "NullUndefined", href: "/docs/manual/v10.0.0/api/js/null-undefined"}, - {name: "Null", href: "/docs/manual/v10.0.0/api/js/null"}, - {name: "Nullable", href: "/docs/manual/v10.0.0/api/js/nullable"}, - {name: "Obj", href: "/docs/manual/v10.0.0/api/js/obj"}, - {name: "Option", href: "/docs/manual/v10.0.0/api/js/option"}, - {name: "Promise", href: "/docs/manual/v10.0.0/api/js/promise"}, - {name: "Re", href: "/docs/manual/v10.0.0/api/js/re"}, - {name: "Result", href: "/docs/manual/v10.0.0/api/js/result"}, - {name: "String2", href: "/docs/manual/v10.0.0/api/js/string-2"}, - {name: "String", href: "/docs/manual/v10.0.0/api/js/string"}, - { - name: "TypedArrayArrayBuffer", - href: "/docs/manual/v10.0.0/api/js/typed-array_array-buffer", - }, - {name: "TypedArrayDataView", href: "/docs/manual/v10.0.0/api/js/typed-array_data-view"}, - { - name: "TypedArrayFloat32Array", - href: "/docs/manual/v10.0.0/api/js/typed-array_float-32-array", - }, - { - name: "TypedArrayFloat64Array", - href: "/docs/manual/v10.0.0/api/js/typed-array_float-64-array", - }, - { - name: "TypedArrayInt8Array", - href: "/docs/manual/v10.0.0/api/js/typed-array_int-8-array", - }, - { - name: "TypedArrayInt16Array", - href: "/docs/manual/v10.0.0/api/js/typed-array_int-16-array", - }, - { - name: "TypedArrayInt32Array", - href: "/docs/manual/v10.0.0/api/js/typed-array_int-32-array", - }, - {name: "TypedArrayTypeS", href: "/docs/manual/v10.0.0/api/js/typed-array_type-s"}, - { - name: "TypedArrayUint8Array", - href: "/docs/manual/v10.0.0/api/js/typed-array_uint-8-array", - }, - { - name: "TypedArrayUint8ClampedArray", - href: "/docs/manual/v10.0.0/api/js/typed-array_uint-8-clamped-array", - }, - { - name: "TypedArrayUint16Array", - href: "/docs/manual/v10.0.0/api/js/typed-array_uint-16-array", - }, - { - name: "TypedArrayUint32Array", - href: "/docs/manual/v10.0.0/api/js/typed-array_uint-32-array", - }, - { - name: "TypedArray2ArrayBuffer", - href: "/docs/manual/v10.0.0/api/js/typed-array-2_array-buffer", - }, - { - name: "TypedArray2DataView", - href: "/docs/manual/v10.0.0/api/js/typed-array-2_data-view", - }, - { - name: "TypedArray2Float32Array", - href: "/docs/manual/v10.0.0/api/js/typed-array-2_float-32-array", - }, - { - name: "TypedArray2Float64Array", - href: "/docs/manual/v10.0.0/api/js/typed-array-2_float-64-array", - }, - { - name: "TypedArray2Int8Array", - href: "/docs/manual/v10.0.0/api/js/typed-array-2_int-8-array", - }, - { - name: "TypedArray2Int16Array", - href: "/docs/manual/v10.0.0/api/js/typed-array-2_int-16-array", - }, - { - name: "TypedArray2Int32Array", - href: "/docs/manual/v10.0.0/api/js/typed-array-2_int-32-array", - }, - { - name: "TypedArray2Uint8Array", - href: "/docs/manual/v10.0.0/api/js/typed-array-2_uint-8-array", - }, - { - name: "TypedArray2Uint8ClampedArray", - href: "/docs/manual/v10.0.0/api/js/typed-array-2_uint-8-clamped-array", - }, - { - name: "TypedArray2Uint16Array", - href: "/docs/manual/v10.0.0/api/js/typed-array-2_uint-16-array", - }, - { - name: "TypedArray2Uint32Array", - href: "/docs/manual/v10.0.0/api/js/typed-array-2_uint-32-array", - }, - {name: "TypedArray2", href: "/docs/manual/v10.0.0/api/js/typed-array-2"}, - {name: "TypedArray", href: "/docs/manual/v10.0.0/api/js/typed-array"}, - {name: "Types", href: "/docs/manual/v10.0.0/api/js/types"}, - {name: "Undefined", href: "/docs/manual/v10.0.0/api/js/undefined"}, - {name: "Vector", href: "/docs/manual/v10.0.0/api/js/vector"}, -] - -let categories = [ - { - open Category - {name: "Overview", items: overviewNavs} - }, - {name: "Submodules", items: apiNavs}, -] - -module Docs = { - @react.component - let make = (~components=ApiMarkdown.default, ~children) => { - let router = Next.Router.useRouter() - let route = router.route - - // Gather data for the CollapsibleSection - let headers = { - open Option - Dict.get(indexData, route) - ->map(data => data["headers"]->Array.map(header => (header["name"], "#" ++ header["href"]))) - ->getOr([]) - } - - let moduleName = { - open Option - Dict.get(indexData, route)->map(data => data["moduleName"])->getOr("?") - } - - let url = route->Url.parse - - let version = url->Url.getVersionString - - let prefix = { - open Url - {name: "API", href: "/docs/manual/" ++ (version ++ "/api")} - } - - let breadcrumbs = ApiLayout.makeBreadcrumbs(~prefix, route) - - let activeToc = { - open SidebarLayout.Toc - { - title: moduleName, - entries: Array.map(headers, ((name, href)) => {header: name, href}), - } - } - - let title = "JS Module" - let version = "v10.0.0" - - children - } -} - -module Prose = { - @react.component - let make = (~children) => children -} diff --git a/src/layouts/JsDocsLayout10_0_0.resi b/src/layouts/JsDocsLayout10_0_0.resi deleted file mode 100644 index 8e4b9eb04..000000000 --- a/src/layouts/JsDocsLayout10_0_0.resi +++ /dev/null @@ -1,9 +0,0 @@ -module Docs: { - @react.component - let make: (~components: MarkdownComponents.t=?, ~children: React.element) => React.element -} - -module Prose: { - @react.component - let make: (~children: React.element) => React.element -} diff --git a/src/layouts/JsDocsLayout8_0_0.res b/src/layouts/JsDocsLayout8_0_0.res deleted file mode 100644 index 31681f9bc..000000000 --- a/src/layouts/JsDocsLayout8_0_0.res +++ /dev/null @@ -1,206 +0,0 @@ -// Structure defined by `scripts/extract-indices.js` -@module("index_data/v800_js_api_index.json") -external indexData: Dict.t<{ - "moduleName": string, - "headers": array<{ - "name": string, - "href": string, - }>, -}> = "default" - -module Category = SidebarLayout.Sidebar.Category -module NavItem = SidebarLayout.Sidebar.NavItem - -let overviewNavs = [ - { - open NavItem - {name: "JS", href: "/docs/manual/v8.0.0/api/js"} - }, -] - -let apiNavs = [ - { - open NavItem - {name: "Array2", href: "/docs/manual/v8.0.0/api/js/array-2"} - }, - {name: "Array", href: "/docs/manual/v8.0.0/api/js/array"}, - {name: "Console", href: "/docs/manual/v8.0.0/api/js/console"}, - {name: "Date", href: "/docs/manual/v8.0.0/api/js/date"}, - {name: "Dict", href: "/docs/manual/v8.0.0/api/js/dict"}, - {name: "Exn", href: "/docs/manual/v8.0.0/api/js/exn"}, - {name: "Float", href: "/docs/manual/v8.0.0/api/js/float"}, - {name: "Global", href: "/docs/manual/v8.0.0/api/js/global"}, - {name: "Int", href: "/docs/manual/v8.0.0/api/js/int"}, - {name: "Json", href: "/docs/manual/v8.0.0/api/js/json"}, - {name: "List", href: "/docs/manual/v8.0.0/api/js/list"}, - {name: "Math", href: "/docs/manual/v8.0.0/api/js/math"}, - {name: "NullUndefined", href: "/docs/manual/v8.0.0/api/js/null-undefined"}, - {name: "Null", href: "/docs/manual/v8.0.0/api/js/null"}, - {name: "Nullable", href: "/docs/manual/v8.0.0/api/js/nullable"}, - {name: "Obj", href: "/docs/manual/v8.0.0/api/js/obj"}, - {name: "Option", href: "/docs/manual/v8.0.0/api/js/option"}, - {name: "Promise", href: "/docs/manual/v8.0.0/api/js/promise"}, - {name: "Re", href: "/docs/manual/v8.0.0/api/js/re"}, - {name: "Result", href: "/docs/manual/v8.0.0/api/js/result"}, - {name: "String2", href: "/docs/manual/v8.0.0/api/js/string-2"}, - {name: "String", href: "/docs/manual/v8.0.0/api/js/string"}, - { - name: "TypedArrayArrayBuffer", - href: "/docs/manual/v8.0.0/api/js/typed-array_array-buffer", - }, - { - name: "TypedArrayDataView", - href: "/docs/manual/v8.0.0/api/js/typed-array_data-view", - }, - { - name: "TypedArrayFloat32Array", - href: "/docs/manual/v8.0.0/api/js/typed-array_float-32-array", - }, - { - name: "TypedArrayFloat64Array", - href: "/docs/manual/v8.0.0/api/js/typed-array_float-64-array", - }, - { - name: "TypedArrayInt8Array", - href: "/docs/manual/v8.0.0/api/js/typed-array_int-8-array", - }, - { - name: "TypedArrayInt16Array", - href: "/docs/manual/v8.0.0/api/js/typed-array_int-16-array", - }, - { - name: "TypedArrayInt32Array", - href: "/docs/manual/v8.0.0/api/js/typed-array_int-32-array", - }, - { - name: "TypedArrayTypeS", - href: "/docs/manual/v8.0.0/api/js/typed-array_type-s", - }, - { - name: "TypedArrayUint8Array", - href: "/docs/manual/v8.0.0/api/js/typed-array_uint-8-array", - }, - { - name: "TypedArrayUint8ClampedArray", - href: "/docs/manual/v8.0.0/api/js/typed-array_uint-8-clamped-array", - }, - { - name: "TypedArrayUint16Array", - href: "/docs/manual/v8.0.0/api/js/typed-array_uint-16-array", - }, - { - name: "TypedArrayUint32Array", - href: "/docs/manual/v8.0.0/api/js/typed-array_uint-32-array", - }, - { - name: "TypedArray2ArrayBuffer", - href: "/docs/manual/v8.0.0/api/js/typed-array-2_array-buffer", - }, - { - name: "TypedArray2DataView", - href: "/docs/manual/v8.0.0/api/js/typed-array-2_data-view", - }, - { - name: "TypedArray2Float32Array", - href: "/docs/manual/v8.0.0/api/js/typed-array-2_float-32-array", - }, - { - name: "TypedArray2Float64Array", - href: "/docs/manual/v8.0.0/api/js/typed-array-2_float-64-array", - }, - { - name: "TypedArray2Int8Array", - href: "/docs/manual/v8.0.0/api/js/typed-array-2_int-8-array", - }, - { - name: "TypedArray2Int16Array", - href: "/docs/manual/v8.0.0/api/js/typed-array-2_int-16-array", - }, - { - name: "TypedArray2Int32Array", - href: "/docs/manual/v8.0.0/api/js/typed-array-2_int-32-array", - }, - { - name: "TypedArray2Uint8Array", - href: "/docs/manual/v8.0.0/api/js/typed-array-2_uint-8-array", - }, - { - name: "TypedArray2Uint8ClampedArray", - href: "/docs/manual/v8.0.0/api/js/typed-array-2_uint-8-clamped-array", - }, - { - name: "TypedArray2Uint16Array", - href: "/docs/manual/v8.0.0/api/js/typed-array-2_uint-16-array", - }, - { - name: "TypedArray2Uint32Array", - href: "/docs/manual/v8.0.0/api/js/typed-array-2_uint-32-array", - }, - {name: "TypedArray2", href: "/docs/manual/v8.0.0/api/js/typed-array-2"}, - {name: "TypedArray", href: "/docs/manual/v8.0.0/api/js/typed-array"}, - {name: "Types", href: "/docs/manual/v8.0.0/api/js/types"}, - {name: "Undefined", href: "/docs/manual/v8.0.0/api/js/undefined"}, - {name: "Vector", href: "/docs/manual/v8.0.0/api/js/vector"}, -] - -let categories = [ - { - open Category - {name: "Overview", items: overviewNavs} - }, - {name: "Submodules", items: apiNavs}, -] - -module Docs = { - @react.component - let make = (~components=ApiMarkdown.default, ~children) => { - let router = Next.Router.useRouter() - let route = router.route - - // Gather data for the CollapsibleSection - let headers = { - open Option - Dict.get(indexData, route) - ->map(data => data["headers"]->Array.map(header => (header["name"], "#" ++ header["href"]))) - ->getOr([]) - } - - let moduleName = { - open Option - Dict.get(indexData, route)->map(data => data["moduleName"])->getOr("?") - } - - let url = route->Url.parse - - let version = url->Url.getVersionString - - let prefix = { - open Url - {name: "API", href: "/docs/manual/" ++ (version ++ "/api")} - } - - let breadcrumbs = ApiLayout.makeBreadcrumbs(~prefix, route) - let activeToc = { - open SidebarLayout.Toc - { - title: moduleName, - entries: Array.map(headers, ((name, href)) => {header: name, href}), - } - } - - let title = "JS Module" - let version = "v8.0.0" - - let warnBanner = - - - warnBanner - children - - } -} - -module Prose = { - @react.component - let make = (~children) => children -} diff --git a/src/layouts/JsDocsLayout8_0_0.resi b/src/layouts/JsDocsLayout8_0_0.resi deleted file mode 100644 index 8e4b9eb04..000000000 --- a/src/layouts/JsDocsLayout8_0_0.resi +++ /dev/null @@ -1,9 +0,0 @@ -module Docs: { - @react.component - let make: (~components: MarkdownComponents.t=?, ~children: React.element) => React.element -} - -module Prose: { - @react.component - let make: (~children: React.element) => React.element -} diff --git a/src/layouts/JsDocsLayout9_0_0.res b/src/layouts/JsDocsLayout9_0_0.res deleted file mode 100644 index cb766f6e9..000000000 --- a/src/layouts/JsDocsLayout9_0_0.res +++ /dev/null @@ -1,206 +0,0 @@ -// Structure defined by `scripts/extract-indices.js` -@module("index_data/v900_js_api_index.json") -external indexData: Dict.t<{ - "moduleName": string, - "headers": array<{ - "name": string, - "href": string, - }>, -}> = "default" - -module Category = SidebarLayout.Sidebar.Category -module NavItem = SidebarLayout.Sidebar.NavItem - -let overviewNavs = [ - { - open NavItem - {name: "JS", href: "/docs/manual/v9.0.0/api/js"} - }, -] - -let apiNavs = [ - { - open NavItem - {name: "Array2", href: "/docs/manual/v9.0.0/api/js/array-2"} - }, - {name: "Array", href: "/docs/manual/v9.0.0/api/js/array"}, - {name: "Console", href: "/docs/manual/v9.0.0/api/js/console"}, - {name: "Date", href: "/docs/manual/v9.0.0/api/js/date"}, - {name: "Dict", href: "/docs/manual/v9.0.0/api/js/dict"}, - {name: "Exn", href: "/docs/manual/v9.0.0/api/js/exn"}, - {name: "Float", href: "/docs/manual/v9.0.0/api/js/float"}, - {name: "Global", href: "/docs/manual/v9.0.0/api/js/global"}, - {name: "Int", href: "/docs/manual/v9.0.0/api/js/int"}, - {name: "Json", href: "/docs/manual/v9.0.0/api/js/json"}, - {name: "List", href: "/docs/manual/v9.0.0/api/js/list"}, - {name: "Math", href: "/docs/manual/v9.0.0/api/js/math"}, - {name: "NullUndefined", href: "/docs/manual/v9.0.0/api/js/null-undefined"}, - {name: "Null", href: "/docs/manual/v9.0.0/api/js/null"}, - {name: "Nullable", href: "/docs/manual/v9.0.0/api/js/nullable"}, - {name: "Obj", href: "/docs/manual/v9.0.0/api/js/obj"}, - {name: "Option", href: "/docs/manual/v9.0.0/api/js/option"}, - {name: "Promise", href: "/docs/manual/v9.0.0/api/js/promise"}, - {name: "Re", href: "/docs/manual/v9.0.0/api/js/re"}, - {name: "Result", href: "/docs/manual/v9.0.0/api/js/result"}, - {name: "String2", href: "/docs/manual/v9.0.0/api/js/string-2"}, - {name: "String", href: "/docs/manual/v9.0.0/api/js/string"}, - { - name: "TypedArrayArrayBuffer", - href: "/docs/manual/v9.0.0/api/js/typed-array_array-buffer", - }, - { - name: "TypedArrayDataView", - href: "/docs/manual/v9.0.0/api/js/typed-array_data-view", - }, - { - name: "TypedArrayFloat32Array", - href: "/docs/manual/v9.0.0/api/js/typed-array_float-32-array", - }, - { - name: "TypedArrayFloat64Array", - href: "/docs/manual/v9.0.0/api/js/typed-array_float-64-array", - }, - { - name: "TypedArrayInt8Array", - href: "/docs/manual/v9.0.0/api/js/typed-array_int-8-array", - }, - { - name: "TypedArrayInt16Array", - href: "/docs/manual/v9.0.0/api/js/typed-array_int-16-array", - }, - { - name: "TypedArrayInt32Array", - href: "/docs/manual/v9.0.0/api/js/typed-array_int-32-array", - }, - { - name: "TypedArrayTypeS", - href: "/docs/manual/v9.0.0/api/js/typed-array_type-s", - }, - { - name: "TypedArrayUint8Array", - href: "/docs/manual/v9.0.0/api/js/typed-array_uint-8-array", - }, - { - name: "TypedArrayUint8ClampedArray", - href: "/docs/manual/v9.0.0/api/js/typed-array_uint-8-clamped-array", - }, - { - name: "TypedArrayUint16Array", - href: "/docs/manual/v9.0.0/api/js/typed-array_uint-16-array", - }, - { - name: "TypedArrayUint32Array", - href: "/docs/manual/v9.0.0/api/js/typed-array_uint-32-array", - }, - { - name: "TypedArray2ArrayBuffer", - href: "/docs/manual/v9.0.0/api/js/typed-array-2_array-buffer", - }, - { - name: "TypedArray2DataView", - href: "/docs/manual/v9.0.0/api/js/typed-array-2_data-view", - }, - { - name: "TypedArray2Float32Array", - href: "/docs/manual/v9.0.0/api/js/typed-array-2_float-32-array", - }, - { - name: "TypedArray2Float64Array", - href: "/docs/manual/v9.0.0/api/js/typed-array-2_float-64-array", - }, - { - name: "TypedArray2Int8Array", - href: "/docs/manual/v9.0.0/api/js/typed-array-2_int-8-array", - }, - { - name: "TypedArray2Int16Array", - href: "/docs/manual/v9.0.0/api/js/typed-array-2_int-16-array", - }, - { - name: "TypedArray2Int32Array", - href: "/docs/manual/v9.0.0/api/js/typed-array-2_int-32-array", - }, - { - name: "TypedArray2Uint8Array", - href: "/docs/manual/v9.0.0/api/js/typed-array-2_uint-8-array", - }, - { - name: "TypedArray2Uint8ClampedArray", - href: "/docs/manual/v9.0.0/api/js/typed-array-2_uint-8-clamped-array", - }, - { - name: "TypedArray2Uint16Array", - href: "/docs/manual/v9.0.0/api/js/typed-array-2_uint-16-array", - }, - { - name: "TypedArray2Uint32Array", - href: "/docs/manual/v9.0.0/api/js/typed-array-2_uint-32-array", - }, - {name: "TypedArray2", href: "/docs/manual/v9.0.0/api/js/typed-array-2"}, - {name: "TypedArray", href: "/docs/manual/v9.0.0/api/js/typed-array"}, - {name: "Types", href: "/docs/manual/v9.0.0/api/js/types"}, - {name: "Undefined", href: "/docs/manual/v9.0.0/api/js/undefined"}, - {name: "Vector", href: "/docs/manual/v9.0.0/api/js/vector"}, -] - -let categories = [ - { - open Category - {name: "Overview", items: overviewNavs} - }, - {name: "Submodules", items: apiNavs}, -] - -module Docs = { - @react.component - let make = (~components=ApiMarkdown.default, ~children) => { - let router = Next.Router.useRouter() - let route = router.route - - // Gather data for the CollapsibleSection - let headers = { - open Option - Dict.get(indexData, route) - ->map(data => data["headers"]->Array.map(header => (header["name"], "#" ++ header["href"]))) - ->getOr([]) - } - - let moduleName = { - open Option - Dict.get(indexData, route)->map(data => data["moduleName"])->getOr("?") - } - - let url = route->Url.parse - - let version = url->Url.getVersionString - - let prefix = { - open Url - {name: "API", href: "/docs/manual/" ++ (version ++ "/api")} - } - - let breadcrumbs = ApiLayout.makeBreadcrumbs(~prefix, route) - let activeToc = { - open SidebarLayout.Toc - { - title: moduleName, - entries: Array.map(headers, ((name, href)) => {header: name, href}), - } - } - - let title = "JS Module" - let version = "v9.0.0" - - let warnBanner = - - - warnBanner - children - - } -} - -module Prose = { - @react.component - let make = (~children) => children -}