Skip to content

Commit da736d4

Browse files
committed
Merge pull request #387 from chenglou/gitbook
[Docs] Try Gitbook!
2 parents 746024e + 96bd413 commit da736d4

9 files changed

+62
-144
lines changed

docs/.gitignore

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,4 @@
1+
.*
12
node_modules
2-
dist/*.html
3+
dist/*.html
4+
_book

docs/Create-a-simple-example-with-NPM.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -10,21 +10,21 @@ echo "{}" > package.json
1010

1111
First, Install BuckleScript.
1212
(For more advacned settings, please read
13-
[Installation](./Installation))
13+
[Installation](./Installation.md))
1414

1515

1616

1717
```sh
18-
npm install bs-platform --save
18+
npm install bs-platform --save
1919
```
2020

21-
Second, create a file called `hello.ml`,
21+
Second, create a file called `hello.ml`,
2222

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

27-
Third, build and run
27+
Third, build and run
2828

2929
```
3030
`npm bin`/bsc -c hello.ml

docs/Installation.md

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2,18 +2,18 @@
22

33
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.
44

5-
## Default installation procedure (using package managers)
5+
## Default installation procedure (using package managers)
66

7-
### 1. OCaml compiler from opam (optional)
7+
### 1. OCaml compiler from opam (optional)
88

9-
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.
9+
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.
1010

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

1313
```sh
1414
opam update
1515
opam switch 4.02.3+buckle-1
16-
eval `opam config env`
16+
eval `opam config env`
1717
```
1818

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

29-
## Advanced installation procedure (from source)
29+
## Advanced installation procedure (from source)
3030

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

@@ -71,4 +71,4 @@ MODULE_FLAGS='-js-module commonjs' make world
7171
MODULE_FLAGS='-js-module goog:buckle' make world
7272
```
7373

74-
Also see [Create a simple example with npm](./Create-a-simple-example-with-npm.md)
74+
Also see [Create a simple example with npm](./Create-a-simple-example-with-NPM.md)
File renamed without changes.

docs/SUMMARY.md

Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
* [Home](./README.md)
2+
3+
* [Playground](https://bloomberg.github.io/bucklescript/js-demo)
4+
5+
* Get Started
6+
* [Installation](./Installation.md)
7+
* [Create a simple example with NPM](./Create-a-simple-example-with-NPM.md)
8+
* [NPM Support](./NPM-Support.md)
9+
10+
* BuckleScript Basics
11+
* [FAQ](./FAQ.md)
12+
* [About OCaml](https://ocaml.org/)
13+
* [Compiler options](./Compiler-options.md)
14+
* [How to adapt your build system](./How-to-adapt-your-build-system.md)
15+
* [Extensions to OCaml Language](./Extensions-to-OCaml-Language.md)
16+
* [Semantic differences from other backends](./Semantic-differences-from-other-backends.md)
17+
* [JavaScript target versions](./JavaScript-target-versions.md)
18+
19+
20+
* BuckleScript Overview
21+
* [Compiler overview](./Compiler-overview.md)
22+
23+
* BuckleScript FFI
24+
* [Runtime representation](./Runtime-representation.md)
25+
* [Curry and Uncurry functions](./Curry-and-Uncurry-functions.md)
26+
* [JS call OCaml](./JS-call-OCaml.md)
27+
* [OCaml call JS](./OCaml-call-JS.md)
28+
* [Experimental support of typescript](./Experimental-support-of-typescript.md)
29+
* [Unsupported IO primitives](./Unsupported-IO-primitives.md)
30+
31+
* Contributions
32+
* [Github Link](https://github.com/bloomberg/bucklescript)
33+
* [Dev mode How to](./Dev-mode-How-to.md)
34+
* [Help move runtime functions from OCaml to Javascript](./Help-move-runtime-functions-from-OCaml-to-Javascript.md)
35+
36+
* Roadmap
37+
* [Roadmap](./Roadmap.md)
38+
39+
* Comparisons
40+
* [Differences from js_of_ocaml](./Differences-from-js_of_ocaml.md)

docs/Why-bucklescript-matters-for-Javascript-platform.md

Lines changed: 5 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -37,18 +37,18 @@ libraries into small pieces like as done in [lodash](https://github.com/lodash/l
3737

3838
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.
3939

40-
[images/compile-time.png](./images/compile-time.png)
41-
40+
![./dist/images/compile-time.png](./dist/images/compile-time.png)
41+
4242
The above picture compares OCaml compilation-times with
4343
other languages: S for Scala, K for Koltin, TS for TypeScript.
44-
44+
4545
Bucklescript reuses most of the OCaml compiler (parsing/type
4646
checking and pattern match compilation), its type checker
4747
[was well engineered](http://okmij.org/ftp/ML/generalization.html)
4848
and written in an imperative style to make it fast.
4949

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

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

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

docs/_Sidebar.md

Lines changed: 0 additions & 40 deletions
This file was deleted.

docs/_template.html.tpl

Lines changed: 0 additions & 79 deletions
This file was deleted.

docs/package.json

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,9 @@
11
{
2-
"dependencies": {
3-
"marked": "^0.3.5"
2+
"scripts": {
3+
"build": "gitbook install && gitbook build",
4+
"watch": "gitbook install && gitbook serve"
45
},
56
"devDependencies": {
6-
"glob": "^7.0.3",
7-
"handlebars": "^4.0.5",
8-
"marked": "^0.3.5"
7+
"gitbook-cli": "^2.1.3"
98
}
109
}

0 commit comments

Comments
 (0)