Giter VIP home page Giter VIP logo

rescript-lang.org's Introduction

Contributor Covenant

rescript-lang.org

This is the official documentation platform for the ReScript programming language.

In case you want to report a technical issue, please refer to the appropriate repository:

Setup

# For first time clone / build (install dependencies)
yarn

# Initial build
yarn bs:build

# Build the index data
yarn run update-index

# In a new tab
yarn dev

# then open localhost:3000

In case you want to run BuckleScript in watchmode:

yarn run bs:start

Build Index Data

We are parsing our content for specific index data (such as, all interesting search terms we need for searching inside the Belt docs). You can create your index by running following command:

yarn run update-index

All the index data is stored in index_data, but will not be tracked by git. Make sure to build the index after a fresh clone, otherwise Next might not build specific pages (file index_data/x.json not found).

Run Tests

Markdown Codeblock Tests

We check the validity of our code examples marked with:

  • ```res example (ReScript code snippet)
  • ```res sig (signature)
  • ```res prelude (ReScript code snippet available for all subsequent code snippets)

Run the checks with:

node scripts/test-examples.js

Markdown Hyperlink Tests

We are also verifying markdown href links to relative resources (via [text](url) syntax) with our scripts/test-hrefs.js script. Here is a short explanation on how the href testing works:

Domain relative links, such as /docs/manual/latest, ./introduction, introduction, /docs/foo/introduction.md will be verified. That means the tester will check if given path exists in the pages directory.

If there are any anchor refs, such as /docs/manual#test, then the anchor will be ignored for the specific file path check. If there are any hrefs with .md, .mdx or .html file extension, then those will be stripped before the check happens (the markdown renderer drops file extensions on relative links as well).

External hrefs, such as https://www.hello.world, //www.hello.world will NOT be checked since they are assumed to be external resources.

Here is an example on how to run the tests:

# Tests all files
node scripts/test-hrefs.js

# Or just a subset (glob pattern)
node scripts/test-hrefs.js "pages/docs/manual/**/*.mdx"

Continous Integration

Always make sure to run npm test before pushing any content, otherwise our CI might trigger a failure warning. Failing branches are very unlikely to be merged.

Design / UX

Design mockups can be found here.

Be aware that some screen designs might still be work in progress, if you have any design / UX questions, either comment directly on the design tool as guest, or open an issue.

Useful commands

Build CSS seperately via npx postcss (useful for debugging)

# Devmode
npx postcss styles/main.css -o test.css

# Production
NODE_ENV=production npx postcss styles/main.css -o test.css

Writing Blog Posts

In case you are a blog author, please refer to our guide on writing blog posts.

Quick-takeaways:

  • Blogposts are located in _blogposts
  • Author metadata is located in index_data/blog_authors.json
  • Make sure to follow the file naming rules

Contributing

Check out our CONTRIBUTING.md for how to get started working on this project.

TLDR: Please read and comply to our Code of Conduct.

rescript-lang.org's People

Contributors

ryyppy avatar chenglou avatar nikgraf avatar bobzhang avatar jdeisenberg avatar lessp avatar fhammerschmidt avatar baransu avatar wontheone1 avatar cristianoc avatar sync avatar bodhish avatar johnridesabike avatar theqp avatar tsnobip avatar cknitt avatar yunti avatar itsjay26 avatar iwankaramazow avatar tatchi avatar theshortcut avatar chalkedgoose avatar bdunn313 avatar a-c-sreedhar-reddy avatar lesha1201 avatar marcagba avatar smlmrkhlms avatar believer avatar relekang avatar rudyweber avatar

Watchers

James Cloos 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.