From 3132ebf128c53858bffcd107dd006570518acfd9 Mon Sep 17 00:00:00 2001 From: Josh Derocher-Vlk Date: Sun, 4 May 2025 10:53:33 +0200 Subject: [PATCH 1/2] remove reason docs --- scripts/extract-tocs.mjs | 15 --------------- 1 file changed, 15 deletions(-) diff --git a/scripts/extract-tocs.mjs b/scripts/extract-tocs.mjs index e0b74c5ad..00055a9f7 100644 --- a/scripts/extract-tocs.mjs +++ b/scripts/extract-tocs.mjs @@ -181,20 +181,6 @@ const createCommunityToc = () => { fs.writeFileSync(TARGET_FILE, JSON.stringify(toc), "utf8"); }; -const createReasonCompilerToc = () => { - const MD_DIR = path.join(__dirname, "../pages/docs/reason-compiler/latest"); - const TARGET_FILE = path.join( - __dirname, - "../index_data/reason_compiler_toc.json" - ); - - const files = glob.sync(`${MD_DIR}/*.md?(x)`); - const result = files.map(processFile); - const toc = createTOC(result); - - fs.writeFileSync(TARGET_FILE, JSON.stringify(toc), "utf8"); -}; - /* const debugToc = () => { const MD_DIR = path.join(__dirname, "../pages/docs/manual/latest"); @@ -216,4 +202,3 @@ let reactManualVersions = ["latest", "v0.10.0", "v0.11.0"]; manualVersions.forEach(createManualToc); reactManualVersions.forEach(createReactToc); createCommunityToc(); -createReasonCompilerToc(); From f418b6102df702c31ce97dbe2a392935de435aad Mon Sep 17 00:00:00 2001 From: Josh Derocher-Vlk Date: Sun, 4 May 2025 11:04:06 +0200 Subject: [PATCH 2/2] remove reasoncompiler components --- src/common/App.res | 4 - src/layouts/ReasonCompilerDocsLayout.res | 94 ----------------------- src/layouts/ReasonCompilerDocsLayout.resi | 2 - 3 files changed, 100 deletions(-) delete mode 100644 src/layouts/ReasonCompilerDocsLayout.res delete mode 100644 src/layouts/ReasonCompilerDocsLayout.resi diff --git a/src/common/App.res b/src/common/App.res index 192736df1..e08426c11 100644 --- a/src/common/App.res +++ b/src/common/App.res @@ -141,10 +141,6 @@ let make = (props: props): React.element => { | _ => React.null }} - | {base: ["docs", "reason-compiler"], version: Latest} => - - content - // common routes | {base} => switch List.fromArray(base) { diff --git a/src/layouts/ReasonCompilerDocsLayout.res b/src/layouts/ReasonCompilerDocsLayout.res deleted file mode 100644 index bea7038fb..000000000 --- a/src/layouts/ReasonCompilerDocsLayout.res +++ /dev/null @@ -1,94 +0,0 @@ -// Structure defined by `scripts/extract-tocs.js` -@module("index_data/reason_compiler_toc.json") -external tocData: Dict.t<{ - "title": string, - "headers": array<{ - "name": string, - "href": string, - }>, -}> = "default" - -module NavItem = SidebarLayout.Sidebar.NavItem -module Category = SidebarLayout.Sidebar.Category -module Toc = SidebarLayout.Toc - -let interopNavs = [ - { - NavItem.name: "Overview", - href: "/docs/reason-compiler/latest/interop-overview", - }, - { - name: "Better Data Structures Printing (Debug Mode)", - href: "/docs/reason-compiler/latest/better-data-structures-printing-debug-mode", - }, - {name: "Miscellaneous", href: "/docs/reason-compiler/latest/interop-misc"}, - {name: "Decorators", href: "/docs/reason-compiler/latest/decorators"}, -] - -let advancedNavs = [ - { - NavItem.name: "Conditional Compilation", - href: "/docs/reason-compiler/latest/conditional-compilation", - }, - { - name: "Extended Compiler Options", - href: "/docs/reason-compiler/latest/extended-compiler-options", - }, - { - name: "Compiler Architecture & Principles", - href: "/docs/reason-compiler/latest/compiler-architecture-principles", - }, - { - name: "Comparison to Js_of_ocaml", - href: "/docs/reason-compiler/latest/comparison-to-jsoo", - }, -] - -let categories = [ - {Category.name: "Interop", items: interopNavs}, - {name: "Advanced", items: advancedNavs}, -] - -@react.component -let make = (~components=MarkdownComponents.default, ~children) => { - let router = Next.Router.useRouter() - let route = router.route - - let activeToc: option = { - open Option - Dict.get(tocData, route)->map(data => { - let title = data["title"] - let entries = Array.map(data["headers"], header => { - Toc.header: header["name"], - href: "#" ++ header["href"], - }) - {Toc.title, entries} - }) - } - - let url = route->Url.parse - - let version = url->Url.getVersionString - - let prefix = list{ - {Url.name: "Docs", href: "/docs/" ++ version}, - {name: "Old Docs", href: "/docs/reason-compiler/" ++ (version ++ "/interop-overview")}, - } - - let breadcrumbs = List.concat( - prefix, - DocsLayout.makeBreadcrumbs(~basePath="/docs/manual/" ++ version, route), - ) - - let title = "Old Docs" - let version = "BS@8.2.0" - - - -
{"IMPORTANT!"->React.string}
- {`This section is still - about ReasonML & BuckleScript.\nIt will be rewritten to ReScript very soon.`->React.string} -
- children -
-} diff --git a/src/layouts/ReasonCompilerDocsLayout.resi b/src/layouts/ReasonCompilerDocsLayout.resi deleted file mode 100644 index e76a5ba10..000000000 --- a/src/layouts/ReasonCompilerDocsLayout.resi +++ /dev/null @@ -1,2 +0,0 @@ -@react.component -let make: (~components: MarkdownComponents.t=?, ~children: React.element) => React.element