Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Slight template change for "centered" pages

Alleviate #313
(but is not completely satisfactory).
  • Loading branch information...
commit 95035ca83a4405354e6075b9c60aa6916babee0a 1 parent f1ebcd1
@Chris00 Chris00 authored
Showing with 60 additions and 9 deletions.
  1. +1 −0  site/learn/tutorials/basics.md
  2. +3 −1 site/learn/tutorials/calling_c_libraries.md
  3. +2 −0  site/learn/tutorials/calling_fortran_libraries.md
  4. +2 −0  site/learn/tutorials/camlp4_3.10.md
  5. +1 −0  site/learn/tutorials/camlp4_3.10/dynamic_functor_example.md
  6. +1 −0  site/learn/tutorials/camlp4_3.10/dynamic_old_syntax.md
  7. +1 −0  site/learn/tutorials/camlp4_3.10/quick_non_extensible_example.md
  8. +1 −0  site/learn/tutorials/camlp4_3.10/static_functor_example.md
  9. +1 −0  site/learn/tutorials/camlp4_3.10/static_old_syntax.md
  10. +1 −0  site/learn/tutorials/camlp5.md
  11. +1 −0  site/learn/tutorials/command-line_arguments.md
  12. +2 −0  site/learn/tutorials/compiling_ocaml_projects.md
  13. +1 −1  site/learn/tutorials/compiling_with_omake.md
  14. +2 −0  site/learn/tutorials/dev_tools.md
  15. +2 −0  site/learn/tutorials/file_manipulation.md
  16. +1 −0  site/learn/tutorials/filenames.md
  17. +7 −5 site/learn/tutorials/functional_programming.md
  18. +1 −0  site/learn/tutorials/hashtbl.md
  19. +2 −0  site/learn/tutorials/if_statements_loops_and_recursion.md
  20. +1 −0  site/learn/tutorials/map.md
  21. +2 −0  site/learn/tutorials/modules.md
  22. +1 −0  site/learn/tutorials/ocaml_and_the_web.md
  23. +2 −0  site/learn/tutorials/performance_and_profiling.md
  24. +1 −0  site/learn/tutorials/set.md
  25. +20 −2 template/core.mpp
View
1  site/learn/tutorials/basics.md
@@ -1,5 +1,6 @@
<!-- ((! set title The Basics !)) ((! set learn !)) -->
+*Table of contents*
# The Basics
View
4 site/learn/tutorials/calling_c_libraries.md
@@ -1,10 +1,12 @@
<!-- ((! set title Calling C libraries !)) ((! set learn !)) -->
+<!-- ((! set center !)) -->
# Calling C libraries
+
## Note from Rich
Chapters 12 and 13 really need to be rewritten from scratch.
-I've left them here - you can read them, but the formatting is screwy.
+I've left them here you can read them, but the formatting is screwy.
## MiniGtk
While the structure of lablgtk outlined in [Introduction to
View
2  site/learn/tutorials/calling_fortran_libraries.md
@@ -1,5 +1,7 @@
<!-- ((! set title Calling Fortran libraries !)) ((! set learn !)) -->
+*Table of contents*
+
# Calling Fortran libraries
Fortran isn't a language the many people write new codes in but it still
View
2  site/learn/tutorials/camlp4_3.10.md
@@ -1,5 +1,7 @@
<!-- ((! set title Camlp4 3.10 !)) ((! set learn !)) -->
+*Table of contents*
+
# Camlp4 3.10
## Camlp4 3.10
View
1  site/learn/tutorials/camlp4_3.10/dynamic_functor_example.md
@@ -1,4 +1,5 @@
<!-- ((! set title Camlp4 3.10 !)) ((! set learn !)) -->
+<!-- ((! set center !)) -->
# Camlp4 3.10 dynamic_functor_example.ml
dynamic_functor_example.ml:
View
1  site/learn/tutorials/camlp4_3.10/dynamic_old_syntax.md
@@ -1,4 +1,5 @@
<!-- ((! set title Camlp4 3.10 !)) ((! set learn !)) -->
+<!-- ((! set center !)) -->
# Camlp4 3.10 dynamic_old_syntax.ml
dynamic_old_syntax.ml:
View
1  site/learn/tutorials/camlp4_3.10/quick_non_extensible_example.md
@@ -1,4 +1,5 @@
<!-- ((! set title Camlp4 3.10 !)) ((! set learn !)) -->
+<!-- ((! set center !)) -->
# Camlp4 3.10: quick non extensible example
quick_non_extensible_example.ml
View
1  site/learn/tutorials/camlp4_3.10/static_functor_example.md
@@ -1,4 +1,5 @@
<!-- ((! set title Camlp4 3.10 !)) ((! set learn !)) -->
+<!-- ((! set center !)) -->
# Camlp4 3.10: static functor example
static_functor_example.ml
View
1  site/learn/tutorials/camlp4_3.10/static_old_syntax.md
@@ -1,4 +1,5 @@
<!-- ((! set title Camlp4 3.10 !)) ((! set learn !)) -->
+<!-- ((! set center !)) -->
# Camlp4 3.10: static old syntax
static_old_syntax.ml:
View
1  site/learn/tutorials/camlp5.md
@@ -1,4 +1,5 @@
<!-- ((! set title Camlp5 !)) ((! set learn !)) -->
+<!-- ((! set center !)) -->
# Camlp5
View
1  site/learn/tutorials/command-line_arguments.md
@@ -1,4 +1,5 @@
<!-- ((! set title Command-line arguments !)) ((! set learn !)) -->
+<!-- ((! set center !)) -->
# Command-line arguments
This is a short tutorial for those who are writing their first OCaml
View
2  site/learn/tutorials/compiling_ocaml_projects.md
@@ -1,5 +1,7 @@
<!-- ((! set title Compiling OCaml projects !)) ((! set learn !)) -->
+*Table of contents*
+
# Compiling OCaml projects
This tutorial describes the base compilation commands provided with
View
2  site/learn/tutorials/compiling_with_omake.md
@@ -1,4 +1,5 @@
<!-- ((! set title Compiling with OMake !)) ((! set learn !)) -->
+<!-- ((! set center !)) -->
# Compiling with OMake
@@ -18,7 +19,6 @@ findlib/ocamlfind:
or comment out the content of the automatically generated OMakefile,
and put the following:
-<!-- -->
```
# Program name (without extension)
PROGRAM = myprog
View
2  site/learn/tutorials/dev_tools.md
@@ -1,5 +1,7 @@
<!-- ((! set title Development Tools !)) ((! set learn !)) -->
+*Table of contents*
+
# Development Tools
![Under Construction](img/under_construction_icon.gif "")
View
2  site/learn/tutorials/file_manipulation.md
@@ -1,5 +1,7 @@
<!-- ((! set title File Manipulation !)) ((! set learn !)) -->
+*Table of contents*
+
# File manipulation
This is a guide to basic file manipulation in OCaml using only what the
standard library provides.
View
1  site/learn/tutorials/filenames.md
@@ -1,4 +1,5 @@
<!-- ((! set title Filenames !)) ((! set learn !)) -->
+<!-- ((! set center !)) -->
# Filenames
This is a reference to the standard **filenames** and extensions used by
View
12 site/learn/tutorials/functional_programming.md
@@ -1,5 +1,7 @@
<!-- ((! set title Functional Programming !)) ((! set learn !)) -->
+*Table of contents*
+
# Functional Programming
## What is functional programming?
@@ -108,7 +110,7 @@ that it's trying to save.
Now look at the definition of `receiver_fn`. This function is a closure
alright because it keeps a reference to `chan` from its environment.
-### Partial function applications and currying
+## Partial function applications and currying
Let's define a plus function which just adds two integers:
```ocamltop
@@ -232,7 +234,7 @@ Here's some more currying fun:
List.map (plus 2) [1; 2; 3];;
let list_of_functions = List.map plus [1; 2; 3];;
```
-### What is functional programming good for?
+## What is functional programming good for?
Functional programming, like any good programming technique, is a useful
tool in your armoury for solving some classes of problems. It's very
good for callbacks, which have multiple uses from GUIs through to
@@ -243,7 +245,7 @@ Certain types of numerical problems can be solved more quickly with
functional programming (for example, numerically calculating the
derivative of a mathematical function).
-### Pure and impure functional programming
+## Pure and impure functional programming
A **pure function** is one without any **side-effects**. A side-effect
really means that the function keeps some sort of hidden state inside
it. `strlen` is a good example of a pure function in C. If you call
@@ -288,7 +290,7 @@ you go along. The current fashion is for carefully planning your
programs using a top-down approach, but in the author's opinion this
often results in projects failing.
-### Strictness vs laziness
+## Strictness vs laziness
C-derived and ML-derived languages are strict. Haskell and Miranda are
non-strict, or lazy, languages. OCaml is strict by default but allows a
lazy style of programming where it is needed.
@@ -338,7 +340,7 @@ To evaluate a lazy expression, you must use the `Lazy.force` function:
```ocamltop
Lazy.force lazy_expr
```
-### Boxed vs. unboxed types
+## Boxed vs. unboxed types
One term which you'll hear a lot when discussing functional languages is
"boxed". I was very confused when I first heard this term, but in fact
the distinction between boxed and unboxed types is quite simple if
View
1  site/learn/tutorials/hashtbl.md
@@ -1,4 +1,5 @@
<!-- ((! set title Hash Tables !)) ((! set learn !)) -->
+<!-- ((! set center !)) -->
# Hashtbl
View
2  site/learn/tutorials/if_statements_loops_and_recursion.md
@@ -1,5 +1,7 @@
<!-- ((! set title If Statements, Loops and Recursion !)) ((! set learn !)) -->
+*Table of contents*
+
# If Statements, Loops and Recursion
## If statements (actually these are if expressions)
View
1  site/learn/tutorials/map.md
@@ -1,4 +1,5 @@
<!-- ((! set title Map !)) ((! set learn !)) -->
+<!-- ((! set center !)) -->
# Map
View
2  site/learn/tutorials/modules.md
@@ -1,5 +1,7 @@
<!-- ((! set title Modules !)) ((! set learn !)) -->
+*Table of contents*
+
# Modules
## Basic usage
View
1  site/learn/tutorials/ocaml_and_the_web.md
@@ -1,4 +1,5 @@
<!-- ((! set title OCaml and the Web !)) ((! set learn !)) -->
+<!-- ((! set center !)) -->
# OCaml and the Web
## Advantages and Disadvantages
View
2  site/learn/tutorials/performance_and_profiling.md
@@ -1,5 +1,7 @@
<!-- ((! set title Performance and Profiling !)) ((! set learn !)) -->
+*Table of contents*
+
# Performance and Profiling
## ObQuote...
View
1  site/learn/tutorials/set.md
@@ -1,4 +1,5 @@
<!-- ((! set title Set !)) ((! set learn !)) -->
+<!-- ((! set center !)) -->
# Set
View
22 template/core.mpp
@@ -9,13 +9,31 @@
</ul>
</nav>
</div>
- x!}}
-
<div id="content-primary" class="span8">
{{! cat template/tryocaml.html !}}
<div id='main-contents' class="content">
{{! get contents !}}
</div>
</div>
+ x!}}
+ {{!x ifdef center
+ <div class="span1"></div>
+ <div id="content-primary" class="span10">
+ {{! cat template/tryocaml.html !}}
+ <div id='main-contents' class="content">
+ {{! get contents !}}
+ </div>
+ </div>
+ x!}}
+ {{!x ifndef toc
+ {{!y ifndef center
+ <div id="content-primary" class="span12">
+ {{! cat template/tryocaml.html !}}
+ <div id='main-contents' class="content">
+ {{! get contents !}}
+ </div>
+ </div>
+ y!}}
+ x!}}
</div>
</div>
Please sign in to comment.
Something went wrong with that request. Please try again.