GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — GitHub - reasonml/reason-tools: Adds Reason to the browser

BranchesTags
Open more actions menu

Latest commit

 

History

248 Commits
248 Commits

Folders and files

NameName
Last commit message
Last commit date
assets
assets
 
 
deploy
deploy
 
 
docs
docs
 
 
src
src
 
 
.gitattributes
.gitattributes
 
 
.gitignore
.gitignore
 
 
.screenrc
.screenrc
 
 
LICENSE
LICENSE
 
 
README.md
README.md
 
 
bsconfig.json
bsconfig.json
 
 
circle.yml
circle.yml
 
 
package.json
package.json
 
 
webpack.config.js
webpack.config.js
 
 
webpack.production.config.js
webpack.production.config.js
 
 
yarn.lock
yarn.lock
 
 

Repository files navigation

Reason Tools

Adds Reason to the browser.

Getting started

Directly in the browser: https://reasonml.github.io/reason-tools/popup.html

Or, browser extensions: Chrome | Firefox

demo of reason-tools

When you trigger the extension, it will copy the text you have highlighted and put it into an editor. The text is then translated into the corresponding Reason/OCaml text. Reason Tools will automatically convert between .re, .ml, .rei, and .mli text. In browsers that support it (currently just Chrome), a shortcut is added to open the extension with the highlighted text: Alt+D.

before and after of auto conversion

OCaml Documentation

Reason Tools tries to detect OCaml documentation pages and automatically convert between Reason and OCaml syntaxes. It provides an escape hatch for use if there is a false positive detection, or if you prefer the default OCamlDoc styles.

Github Integration

Reason Tools adds a shortcut from interface to implementation files (.re <=> .rei, .ml <=> .mli) on Github when it's detected. Triggered by Alt+I by default (> v0.0.19).

Contribute

To get started contributing you can clone and build the extension:

git clone https://github.com/rickyvetter/reason-tools.git
cd reason-tools
npm install # this will take a few minutes

npm run build to build the project. You also have the granular steps build:self and build:js for faster iteration.

To load in Chrome, go to chrome://extensions/ and turn on Developer Mode. From there you should be able to select "Load unpacked extension..." and choose reason-tools/_build/extension.

Build Systems

This project is a bit unconventional in nature (compiling a compiler and a parser/printer to web), so it uses a few build systems currently.

  • A custom shell.sh is used to compile Reason and the compiler to JavaScript.
  • Bsb is used to build its Reason logic. Nothing special.
  • Webpack is used to bundle the whole js output into a single pack.

Thanks

The foundation of the project is, without a doubt, refmt-web. This is an awesome project by @Schmavery which does the same refmt in a web page.

reason-web-toplevel, by @Engil was also an awesome project where a lot of the work in this project came from.

Also huge thanks to the js_of_ocaml team for building a compiler that pretty effortlessly builds Reason and refmt utils in JS.

About

Adds Reason to the browser

Topics

browser-extensionchromeocamlreasonreasonmlrefmt

Resources

Readme
MIT license
Activity
Custom properties

Stars

373 stars

Watchers

8 watching

Forks

14 forks
Report repository

Releases

Packages

Used by

Contributors

Languages

You are visitor 01402503 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.