Skip to content

[Docs] Try Gitbook! #387

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
May 20, 2016
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion docs/.gitignore
Original file line number Diff line number Diff line change
@@ -1,2 +1,4 @@
.*
node_modules
dist/*.html
dist/*.html
_book
8 changes: 4 additions & 4 deletions docs/Create-a-simple-example-with-NPM.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,21 +10,21 @@ echo "{}" > package.json

First, Install BuckleScript.
(For more advacned settings, please read
[Installation](./Installation))
[Installation](./Installation.md))



```sh
npm install bs-platform --save
npm install bs-platform --save
Copy link
Member Author

@chenglou chenglou May 19, 2016

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sorry, a bit of noise here introduced by my editor's setting of trimming dangling whitespace. Whitespace-less diff view: https://github.com/bloomberg/bucklescript/pull/387/files?w=1

```

Second, create a file called `hello.ml`,
Second, create a file called `hello.ml`,

```js
echo 'let _ = Js.log "hello bucklescript!"' > hello.ml
```

Third, build and run
Third, build and run

```
`npm bin`/bsc -c hello.ml
Expand Down
12 changes: 6 additions & 6 deletions docs/Installation.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,18 +2,18 @@

To use BuckleScript, you need both, a specific version of the OCaml compiler (tweaked to make BuckleScript possible), and the BuckleScript software itself. The instructions below show how to install both of these using standard package managers as well as how to build from source for Unix/Linux systems. Build directions will be updated once Windows systems are supported.

## Default installation procedure (using package managers)
## Default installation procedure (using package managers)

### 1. OCaml compiler from opam (optional)
### 1. OCaml compiler from opam (optional)

When working with OCaml we recommend using [opam](https://opam.ocaml.org) package manager, available [here](https://opam.ocaml.org/doc/Install.html). You will benefit from the existing OCaml ecosystem.
When working with OCaml we recommend using [opam](https://opam.ocaml.org) package manager, available [here](https://opam.ocaml.org/doc/Install.html). You will benefit from the existing OCaml ecosystem.

Once you have `opam` installed, ask `opam` to switch to using our version of the compiler:

```sh
opam update
opam switch 4.02.3+buckle-1
eval `opam config env`
eval `opam config env`
```

> This step is optional. npm installation will build the compiler from source if not installed from opam
Expand All @@ -26,7 +26,7 @@ The standard npm package management tool can be used to install BuckleScript. If
npm install --save bs-platform
```

## Advanced installation procedure (from source)
## Advanced installation procedure (from source)

BuckleScript has very little dependencies and building from source can easily be done.

Expand Down Expand Up @@ -71,4 +71,4 @@ MODULE_FLAGS='-js-module commonjs' make world
MODULE_FLAGS='-js-module goog:buckle' make world
```

Also see [Create a simple example with npm](./Create-a-simple-example-with-npm.md)
Also see [Create a simple example with npm](./Create-a-simple-example-with-NPM.md)
File renamed without changes.
40 changes: 40 additions & 0 deletions docs/SUMMARY.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
* [Home](./README.md)
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is just moved and indented from _Sidebar.md


* [Playground](https://bloomberg.github.io/bucklescript/js-demo)

* Get Started
* [Installation](./Installation.md)
* [Create a simple example with NPM](./Create-a-simple-example-with-NPM.md)
* [NPM Support](./NPM-Support.md)

* BuckleScript Basics
* [FAQ](./FAQ.md)
* [About OCaml](https://ocaml.org/)
* [Compiler options](./Compiler-options.md)
* [How to adapt your build system](./How-to-adapt-your-build-system.md)
* [Extensions to OCaml Language](./Extensions-to-OCaml-Language.md)
* [Semantic differences from other backends](./Semantic-differences-from-other-backends.md)
* [JavaScript target versions](./JavaScript-target-versions.md)


* BuckleScript Overview
* [Compiler overview](./Compiler-overview.md)

* BuckleScript FFI
* [Runtime representation](./Runtime-representation.md)
* [Curry and Uncurry functions](./Curry-and-Uncurry-functions.md)
* [JS call OCaml](./JS-call-OCaml.md)
* [OCaml call JS](./OCaml-call-JS.md)
* [Experimental support of typescript](./Experimental-support-of-typescript.md)
* [Unsupported IO primitives](./Unsupported-IO-primitives.md)

* Contributions
* [Github Link](https://github.com/bloomberg/bucklescript)
* [Dev mode How to](./Dev-mode-How-to.md)
* [Help move runtime functions from OCaml to Javascript](./Help-move-runtime-functions-from-OCaml-to-Javascript.md)

* Roadmap
* [Roadmap](./Roadmap.md)

* Comparisons
* [Differences from js_of_ocaml](./Differences-from-js_of_ocaml.md)
14 changes: 5 additions & 9 deletions docs/Why-bucklescript-matters-for-Javascript-platform.md
Original file line number Diff line number Diff line change
Expand Up @@ -37,18 +37,18 @@ libraries into small pieces like as done in [lodash](https://github.com/lodash/l

The OCaml compiler implementation(s) are famous for blazing fast compile times, and as programmer, we think compile times really matter and are a very important feature of a compiled language.

[images/compile-time.png](./images/compile-time.png)
![./dist/images/compile-time.png](./dist/images/compile-time.png)

The above picture compares OCaml compilation-times with
other languages: S for Scala, K for Koltin, TS for TypeScript.

Bucklescript reuses most of the OCaml compiler (parsing/type
checking and pattern match compilation), its type checker
[was well engineered](http://okmij.org/ftp/ML/generalization.html)
and written in an imperative style to make it fast.

Before BuckleScript, there already existed an
[OCaml to JS compiler](./Difference-from-js_of_ocaml.md). BuckleScript
[OCaml to JS compiler](./Differences-from-js_of_ocaml.md). BuckleScript
stands on the shoulders of such excellent tools. For example, from the very beginning, much like Js_of_ocaml,
BuckleScript has an assembly backend, which we use for the best performance in our development
environment and our
Expand Down Expand Up @@ -131,7 +131,7 @@ We also compare code Size:

### How is it faster than hand-written JS code?

It's hard to explain JS performances in general, however, we will
It's hard to explain JS performances in general, however, we will
explain some of the optimizations we've done. For example, in OCaml, `Map`
is like C++ templates, i.e. it will be instantiated by a comparison
function, like below:
Expand Down Expand Up @@ -177,7 +177,3 @@ There are other factors count, mostly code organized in functional
style are much easier to do the tree shaking while harder to remove
for OO style, OCaml's standard library and runtime are organized in an
independent style, which also helps dead code removal.




40 changes: 0 additions & 40 deletions docs/_Sidebar.md

This file was deleted.

79 changes: 0 additions & 79 deletions docs/_template.html.tpl

This file was deleted.

9 changes: 4 additions & 5 deletions docs/package.json
Original file line number Diff line number Diff line change
@@ -1,10 +1,9 @@
{
"dependencies": {
"marked": "^0.3.5"
"scripts": {
"build": "gitbook install && gitbook build",
"watch": "gitbook install && gitbook serve"
},
"devDependencies": {
"glob": "^7.0.3",
"handlebars": "^4.0.5",
"marked": "^0.3.5"
"gitbook-cli": "^2.1.3"
}
}