Skip to content

Commit

Permalink
add pages
Browse files Browse the repository at this point in the history
  • Loading branch information
aspeddro committed Oct 5, 2023
1 parent b7efb67 commit ec4d44b
Show file tree
Hide file tree
Showing 7 changed files with 86 additions and 9 deletions.
33 changes: 33 additions & 0 deletions community/brand.mdx
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
---
title: "Brand Assets"
description: "ReScript Logo"
canonical: "/community/brand"
---

# Brand Assets

## Logo

<img className="h-24 w-24 mt-10" src="/static/brand/rescript-brandmark.svg" />

<div className="mt-4">

[svg](/static/brand/rescript-brandmark.svg) | [png](/static/brand/rescript-brandmark.png)

</div>

## Brandmark

<img className="h-24 mt-10" src="/static/brand/rescript-logo.svg" />
<div className="p-4">
</div>

<div className="bg-gray-90 p-4">
<img className="h-24" src="/static/brand/rescript-logo-white.svg" />
</div>

<div className="mt-4">

[white.svg](/static/brand/rescript-logo-white.svg) | [white.png](/static/brand/rescript-logo-white.png) | [red.svg](/static/brand/rescript-logo.svg) | [red.png](/static/brand/rescript-logo.png)

</div>
3 changes: 2 additions & 1 deletion data/sidebar_community.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
"overview",
"roadmap",
"code-of-conduct",
"translations"
"translations",
"brand"
]
}
6 changes: 6 additions & 0 deletions docs/manual/latest/build-configuration-schema.mdx
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
---
title: "Configuration Schema"
metaTitle: "Build System Configuration Schema"
description: "Schema exploration widget for the ReScript configuration file"
canonical: "/docs/manual/latest/build-configuration-schema"
---
11 changes: 11 additions & 0 deletions docs/manual/latest/warning-numbers.mdx
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
---
title: "Warning Numbers"
description: "Available compiler warning numbers in ReScript"
canonical: "/docs/manual/latest/warning-numbers"
---

# Warning Numbers

You can configure which warnings the ReScript compiler generates
[in the build configuration](/docs/manual/latest/build-configuration#warnings) or
using the [`@warning()`](/syntax-lookup#expression-warning-decorator) or the [`@@warning()`](/syntax-lookup#module-warning-decorator) decorator.
6 changes: 6 additions & 0 deletions docs/manual/v9.0.0/build-configuration-schema.mdx
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
---
title: "Configuration Schema"
metaTitle: "Build System Configuration Schema"
description: "Schema exploration widget for the ReScript configuration file"
canonical: "/docs/manual/latest/build-configuration-schema"
---
6 changes: 3 additions & 3 deletions scripts/extract-tocs.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -141,7 +141,7 @@ const createLatestManualToc = () => {

const FILE_ORDER = Object.values(sidebarJson).reduce((acc, items) => {
return acc.concat(items)
}, []).filter(section => section !== "build-configuration-schema" && section !== "warning-numbers");
}, [])

const files = glob.sync(`${MD_DIR}/*.?(js|md?(x))`);
const ordered = orderFiles(files, FILE_ORDER);
Expand Down Expand Up @@ -172,7 +172,7 @@ const createV900ManualToc = () => {

const FILE_ORDER = Object.values(sidebarJson).reduce((acc, items) => {
return acc.concat(items)
}, []).filter(section => section !== "build-configuration-schema" && section !== "warning-numbers");
}, [])

const files = glob.sync(`${MD_DIR}/*.?(js|md?(x))`);
const ordered = orderFiles(files, FILE_ORDER);
Expand All @@ -192,7 +192,7 @@ const createV800ManualToc = () => {

const FILE_ORDER = Object.values(sidebarJson).reduce((acc, items) => {
return acc.concat(items)
}, []).filter(section => section !== "build-configuration-schema" && section !== "warning-numbers");
}, [])

const files = glob.sync(`${MD_DIR}/*.?(js|md?(x))`);
const ordered = orderFiles(files, FILE_ORDER);
Expand Down
30 changes: 25 additions & 5 deletions src/Docs.res
Original file line number Diff line number Diff line change
@@ -1,13 +1,32 @@
type params = {slug: array<string>}

type props = {mdxSource: Mdx.Remote.output}
type props = {mdxSource: Mdx.Remote.output, slug: array<string>}

let default = (props: props) => {
let {mdxSource} = props

let {mdxSource, slug} = props
let frontmatter = mdxSource.frontmatter

let content = MdxUtils.createElement(mdxSource)
let otherElement = switch slug->Belt.List.fromArray {
| list{"manual", version, rest} =>
switch rest {
| "warning-numbers" => <WarningTable />
| "build-configuration-schema" =>
switch version {
| "latest" => <Docson tag="master" />
| "v9.0.0" => <Docson tag="9.0.0" />
| _ => React.null
}
| _ => React.null
}
| _ => React.null
}

let content =
<>
{MdxUtils.createElement(mdxSource)}
otherElement
</>

let router = Next.Router.useRouter()

let url = router.asPath->Url.parse
Expand Down Expand Up @@ -88,7 +107,8 @@ let getStaticProps: Next.GetStaticProps.t<props, params> = async ctx => {
let mdxSource = await MdxUtils.serialize(source)

let props = {
mdxSource: mdxSource,
mdxSource,
slug: params.slug,
}

{"props": props}
Expand Down

0 comments on commit ec4d44b

Please sign in to comment.