Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Restructure docs #1010

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 10 commits into from
May 4, 2025
Merged
Show file tree
Hide file tree
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
60 changes: 28 additions & 32 deletions data/sidebar_manual_v1200.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,32 @@
"Overview": [
"introduction",
"installation",
"migrate-to-v11",
"editor-plugins",
"try"
"faq",
"llms"
],
"Guides": [
"converting-from-js",
"editor-code-analysis",
"newcomer-examples",
"project-structure"
],
"JavaScript Interop": [
"interop-cheatsheet",
"embed-raw-javascript",
"shared-data-types",
"external",
"bind-to-js-object",
"bind-to-js-function",
"import-from-export-to-js",
"bind-to-global-js-values",
"json",
"inlining-constants",
"use-illegal-identifier-names",
"generate-converters-accessors",
"browser-support-polyfills",
"libraries",
"typescript-integration"
],
"Language Features": [
"overview",
Expand Down Expand Up @@ -35,27 +58,6 @@
"reserved-keywords",
"equality-comparison"
],
"Advanced Features": [
"extensible-variant",
"scoped-polymorphic-types"
],
"JavaScript Interop": [
"interop-cheatsheet",
"embed-raw-javascript",
"shared-data-types",
"external",
"bind-to-js-object",
"bind-to-js-function",
"import-from-export-to-js",
"bind-to-global-js-values",
"json",
"inlining-constants",
"use-illegal-identifier-names",
"generate-converters-accessors",
"browser-support-polyfills",
"libraries",
"typescript-integration"
],
"Build System": [
"build-overview",
"build-configuration",
Expand All @@ -66,14 +68,8 @@
"build-performance",
"warning-numbers"
],
"Guides": [
"converting-from-js",
"editor-code-analysis"
],
"Extra": [
"newcomer-examples",
"project-structure",
"faq",
"llms"
"Advanced Features": [
"extensible-variant",
"scoped-polymorphic-types"
]
}
8 changes: 2 additions & 6 deletions pages/docs/manual/v12.0.0/api.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,5 @@ In ReScript 11, it is shipped as a separate npm package `@rescript/core` that is

ReScript ships with these two additional modules in its standard library:

- [Belt](api/belt): immutable collections and extra helpers not available in JavaScript / [Core](api/core).
- [Dom](api/dom): Dom related types and modules. Contains our standardized types used by various userland DOM bindings.

## Legacy Modules

The [Js](api/js) module is superseded by [Core](api/core).
- [Belt](api/belt): immutable collections and extra helpers not available in [Core](api/core).
- [Dom](api/dom): Dom related types and modules. Contains our standardized types used by various userland DOM bindings.
6 changes: 3 additions & 3 deletions pages/docs/manual/v12.0.0/editor-code-analysis.mdx
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
---
title: "Editor"
metaTitle: "Editor"
title: "Dead Code Analysis in ReScript"
metaTitle: "Dead Code Analysis in ReScript"
description: "Documentation about ReScript editor plugins and code analysis"
canonical: "/docs/manual/v12.0.0/editor-plugins"
---

# Guide: Dead Code Analysis in ReScript
# Dead Code Analysis in ReScript

This guide provides a detailed walkthrough on how to leverage ReScript’s powerful dead code analysis tools to maintain a clean, efficient, and distraction-free codebase.

Expand Down
40 changes: 17 additions & 23 deletions src/components/Navigation.res
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,10 @@ let linkOrActiveApiSubroute = (~route) => {
}
}

let isActiveLink = (~route: string, ~href: string) => {
route == href ? activeLink : link
}

module CollapsibleLink = {
// KeepOpen = Menu has been opened and should stay open
type state =
Expand Down Expand Up @@ -177,27 +181,6 @@ module DocsSection = {
}
},
},
{
imgSrc: "/static/[email protected]",
title: "GenType",
description: "Seamless TypeScript integration",
href: `/docs/manual/${version}/typescript-integration`,
isActive: url => {
switch url.fullpath {
| ["docs", "manual", _, "typescript-integration"] => true
| _ => false
}
},
},
{
imgSrc: "/static/[email protected]",
title: "Reanalyze",
description: "Dead Code & Termination analysis",
href: "https://github.com/rescript-lang/reanalyze",
isActive: _ => {
false
},
},
]

let languageManualColumn =
Expand Down Expand Up @@ -532,10 +515,21 @@ let make = (~fixed=true, ~isOverlayOpen: bool, ~setOverlayOpen: (bool => bool) =
<div
className="flex ml-10 space-x-5 w-full max-w-320"
style={ReactDOMStyle.make(~maxWidth="26rem", ())}>
{collapsibleElements->React.array}
<Link href={`/docs/manual/${version}/api`} className={linkOrActiveApiSubroute(~route)}>
<Link
href={`/docs/manual/${version}/introduction`}
className={isActiveLink(~route, ~href=`/docs/manual/${version}/introduction`)}>
{React.string("Docs")}
</Link>
<Link
href={`/docs/manual/${version}/api`}
className={isActiveLink(~route, ~href=`/docs/manual/${version}/api`)}>
{React.string("API")}
</Link>
<Link
href={`/docs/react/latest/introduction`}
className={isActiveLink(~route, ~href=`/docs/react/latest/introduction`)}>
{React.string("React")}
</Link>
<Link
href="/try"
className={"hidden xs:block " ++ linkOrActiveLink(~target="/try", ~route)}>
Expand Down
16 changes: 6 additions & 10 deletions src/layouts/ApiOverviewLayout.res
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,12 @@ module Sidebar = SidebarLayout.Sidebar

let makeCategories: string => array<Sidebar.Category.t> = version => [
{
name: "Introduction",
items: [{name: "Overview", href: `/docs/manual/${version}/api`}],
},
{
name: "Standard Library",
items: [{name: "Core", href: `/docs/manual/${version}/api/core`}],
name: "",
items: [
{name: "Overview", href: `/docs/manual/${version}/api`},
{name: "Core", href: `/docs/manual/${version}/api/core`},
{name: "Syntax Lookup", href: "/syntax-lookup"},
],
},
{
name: "Additional Libraries",
Expand All @@ -16,10 +16,6 @@ let makeCategories: string => array<Sidebar.Category.t> = version => [
{name: "Dom", href: `/docs/manual/${version}/api/dom`},
],
},
{
name: "Legacy Modules",
items: [{name: "Js", href: `/docs/manual/${version}/api/js`}],
},
]

/* Used for API docs (structured data) */
Expand Down