Giter VIP home page Giter VIP logo

reasonml.github.io's Introduction

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 or jsoo_reactjs_jsx_ppx_v2.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. Navigate to the jscomp directory in the BuckleScript repository.

  3. Install or switch to js_of_ocaml 3.0 using:

opam switch 4.02.3
eval `opam config env`
opam install js_of_ocaml.3.0
which js_of_ocaml # use this absolute path for the task above or symlink this into your $PATH, maybe /usr/local/bin or something
# switch back now
opam switch 4.02.3+buckle-master
opam install ocp-ocamlres
eval `opam config env`
  1. Inside jscomp, either modify repl.js's occurrences of js_of_ocaml to an absolute path that points to it or symlink js_of_ocaml into your $PATH.

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

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

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

  5. Finally, run node setupSomeArtifacts.js

If this command fails, ping @chenglou in Discord.

reasonml.github.io's People

Contributors

af avatar anmonteiro avatar arecvlohe avatar arnarthor avatar aweary avatar behrends avatar chenglou avatar cristianoc avatar cullophid avatar glennsl avatar gregoirevda avatar huxpro avatar jameshfisher avatar jaredly avatar johann-sonntagbauer avatar jordwalke avatar jsdf avatar kevinsimper avatar lpalmes avatar moox avatar nikgraf avatar philraj avatar rickyvetter avatar ryyppy avatar shrynx avatar tmarty avatar yangshun avatar yawaramin avatar zielonybuszmen avatar zploskey avatar

Stargazers

 avatar

Watchers

 avatar  avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.