Skip to content

Commit cb65fd6

Browse files
committed
[ci skip] tweak docs and add ocaml syntax coloring support (#361)
* add docs back to master branch * remove unnecessary files * [ci skip] [doc] add highlight support for ocaml
1 parent 6bb8bed commit cb65fd6

File tree

6 files changed

+13
-4
lines changed

6 files changed

+13
-4
lines changed

docs/OCaml-call-JS.md

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -138,7 +138,8 @@ gives it a type and customized attributes
138138
let f = add 3 4
139139
```
140140
Will be compiled as
141-
```OCaml
141+
142+
```js
142143
var U = require("x")
143144
var f = U.add(3,4)
144145
```
@@ -173,7 +174,7 @@ On top of this we can write normal OCaml functions, for example:
173174

174175
The compiler would generate code as below:
175176

176-
```ocaml
177+
```js
177178
var Assert = require("assert");
178179
var List = require("../stdlib/list");
179180

docs/_Sidebar.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
**[Home](./index.md)**
22

3+
**[Playground](https://bloomberg.github.io/bucklescript/js-demo)**
4+
35
**Get Started**
46
* [Installation](./Installation.md)
57
* [Create a simple example with NPM](./Create-a-simple-example-with-NPM.md)

docs/_template.html.tpl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717
<!-- Optional theme -->
1818
<link rel="stylesheet" href="//maxcdn.bootstrapcdn.com/bootstrap/3.3.6/css/bootstrap-theme.min.css">
1919
<link rel="stylesheet" href="//cdnjs.cloudflare.com/ajax/libs/highlight.js/9.3.0/styles/default.min.css">
20-
<script src="//cdnjs.cloudflare.com/ajax/libs/highlight.js/9.3.0/highlight.min.js"></script>
20+
<script src="js/highlight.pack.js"></script>
2121

2222
<!-- Custom CSS -->
2323
<link href="css/simple-sidebar.css" rel="stylesheet">

docs/build-doc.sh

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
#!/bin/sh
2+
set -e
3+
node process.js
4+
cp -r dist/* $BUCKLESCRIPT_DOC

docs/dist/js/highlight.pack.js

Lines changed: 2 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

docs/process.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ var path = require('path')
88
var oldrender = new marked.Renderer()
99
renderer.link = function(href,title,text){
1010
var ext = path.extname(href)
11-
if(!title && (ext === ".md" || ext === "")){
11+
if(!title && (ext === ".md" )){
1212
return `<a href="${path.join(path.dirname(href),path.basename(href,".md"))+'.html'}">${text}</a>`
1313
} else{
1414
return oldrender.link(href,title,text);

0 commit comments

Comments
 (0)