|
1 | 1 | let render () =
|
2 | 2 | Layout.render
|
3 | 3 | ~use_swiper:true
|
| 4 | +~banner:true |
4 | 5 | ~title:"Welcome to a World of OCaml"
|
5 | 6 | ~description:"OCaml is a general-purpose, industrial-strength programming language with an emphasis on expressiveness and safety."
|
6 | 7 | ~canonical:"" @@
|
@@ -36,17 +37,17 @@ Layout.render
|
36 | 37 | <div style="flex: 1 1 50%" class="py-2 px-6 text-white text-opacity-50 overflow-auto">
|
37 | 38 | <div class="text-left overflow-auto">
|
38 | 39 | <pre id="output" class="flex flex-col w-full code-preview text-white text-sm space-y-1 font-medium">
|
39 |
| - <span><span class="text-blue-500 ">let</span> <span class="text-code-yellow ">square</span> x = x * x</span> |
40 |
| - <span><i class="text-gray-400 ">val square : int -> int = < fun ></i></span> |
41 |
| - <span>square 3</span> |
42 |
| - <span><i class="text-gray-400 ">- : int = 9</i></span> |
43 |
| - <span><span class="text-blue-500 ">let rec</span> <span class="text-code-yellow ">fac</span> x =</span> |
44 |
| - <span><span class="text-blue-500 ml-4">if</span> x <= 1 <span class="text-blue-500 ">then</span> 1 <span class="text-blue-500">else</span> x * fac (x - 1)</span></span> |
45 |
| - <span><i class="text-gray-400">val fac : int -> int = < fun ></i></span> |
46 |
| - <span>fac 5</span> |
47 |
| - <span><i class="text-gray-400 ">- : int = 120</i></span> |
48 |
| - <span>square 120</span> |
49 |
| - <span><i class="text-gray-400">- : int = 14400</i></span> |
| 40 | +<code><span><span class="text-blue-500 ">let</span> <span class="text-code-yellow ">square</span> x = x * x</span> |
| 41 | +<span><i class="text-gray-400 ">val square : int -> int = < fun ></i></span> |
| 42 | +<span>square 3</span> |
| 43 | +<span><i class="text-gray-400 ">- : int = 9</i></span> |
| 44 | +<span><span class="text-blue-500 ">let rec</span> <span class="text-code-yellow ">fac</span> x =</span> |
| 45 | +<span><span class="text-blue-500 ml-4">if</span> x <= 1 <span class="text-blue-500 ">then</span> 1 <span class="text-blue-500">else</span> x * fac (x - 1)</span></span> |
| 46 | +<span><i class="text-gray-400">val fac : int -> int = < fun ></i></span> |
| 47 | +<span>fac 5</span> |
| 48 | +<span><i class="text-gray-400 ">- : int = 120</i></span> |
| 49 | +<span>square 120</span> |
| 50 | +<span><i class="text-gray-400">- : int = 14400</i></span></code> |
50 | 51 | </pre>
|
51 | 52 | </div>
|
52 | 53 | </div>
|
|
0 commit comments