Reason Website

Reason 的文档网站。Reason 是一种由 OCaml 的强大类型系统支持的编程语言,其语法设计让来自 JavaScript 或 C 系列语言的用户感到熟悉。「Reason's documentation site. Reason is a programming language powered by OCaml's strong type system, and has a syntax designed to feel familiar to people coming from JavaScript or C-family languages.」

  • 所有者: reasonml/reasonml.github.io
  • 平台: Windows,Linux,Mac
  • 許可證: MIT License
  • 分類:
  • 主題:
  • 喜歡:
    0
      比較:

Github星跟蹤圖

Reason Website

This code is used to generate https://reasonml.github.io. It pulls in files from docs/ and website/ to generate html files served on the site.

website/ contains the JS, CSS, images and other files (and blog, which contains some markdown files too, these are separated from docs/, not too important).

cd website && yarn && yarn start to start the development server & watcher.

Don't use yarn build. It's mostly for debugging.

In the end, we spit out normal HTML, with all the JS dependencies (barring a few critical ones) removed, including ReactJS itself. It's a full, static website, super lightweight, portable, unfancy but good looking. Works with JS turned off too.

Two special files:

  • sidebars.json: lists the sections.
  • siteConfig.json: some header and i18n configs.

During your development, most changes will be picked up at each browser refresh. If you touch these two files or blog/, however, you'll have to restart the server to see the changes.

Translations

The entire site can be translated via the Crowdin project. This repo only has the canonical english documentation. Don't manually edit things in i18n/.

Debugging

console.logs appear in your terminal! Since the site itself is React-free.

Building and Deploying

Changes from source branch are automatically picked into master branch by CI, then published.

Build the Playground

cd website && yarn

For modifying the actual try playground source code, run yarn bundle-try-playground:dev to start a watcher. Once you're done, run yarn bundle-try-playground:prod once.

Building with custom BuckleScript/etc

To build the actual bsReasonReact.js, refmt.js, stdlibBundle.js, reasonReactBundle.js:

You'll need to have this repository and the BuckleScript repository cloned. These will likely be next to each other in the directory structure.

  1. Inside the BuckleScript repository, follow the Setup guide.

  2. Follow the Contributing to the BS Playground Bundle guide.

  3. Run BS_PLAYGROUND=../../reasonml.github.io/website/playground/bs node scripts/repl.js

  4. Inside the reasonml.github.io repository, run cd website && yarn

  5. Then run, yarn prepare in the same place.

  6. Finally, run node setupSomeArtifacts.js

If this command fails, ping @chenglou in Discord.

主要指標

概覽
名稱與所有者reasonml/reasonml.github.io
主編程語言HTML
編程語言JavaScript (語言數: 4)
平台
許可證MIT License
所有者活动
創建於2017-06-13 23:10:29
推送於2025-03-25 17:37:59
最后一次提交2021-01-07 00:35:05
發布數0
用户参与
星數333
關注者數18
派生數398
提交數1.1k
已啟用問題?
問題數189
打開的問題數37
拉請求數381
打開的拉請求數15
關閉的拉請求數204
项目设置
已啟用Wiki?
已存檔?
是復刻?
已鎖定?
是鏡像?
是私有?