Permalink
Browse files

Slight template change for "centered" pages

Alleviate #313
(but is not completely satisfactory).
  • Loading branch information...
Chris00 committed Dec 17, 2013
1 parent f1ebcd1 commit 95035ca83a4405354e6075b9c60aa6916babee0a
@@ -1,5 +1,6 @@
<!-- ((! set title The Basics !)) ((! set learn !)) -->
+*Table of contents*
# The Basics
@@ -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
@@ -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
@@ -1,5 +1,7 @@
<!-- ((! set title Camlp4 3.10 !)) ((! set learn !)) -->
+*Table of contents*
+
# Camlp4 3.10
## Camlp4 3.10
@@ -1,4 +1,5 @@
<!-- ((! set title Camlp4 3.10 !)) ((! set learn !)) -->
+<!-- ((! set center !)) -->
# Camlp4 3.10 dynamic_functor_example.ml
dynamic_functor_example.ml:
@@ -1,4 +1,5 @@
<!-- ((! set title Camlp4 3.10 !)) ((! set learn !)) -->
+<!-- ((! set center !)) -->
# Camlp4 3.10 dynamic_old_syntax.ml
dynamic_old_syntax.ml:
@@ -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
@@ -1,4 +1,5 @@
<!-- ((! set title Camlp4 3.10 !)) ((! set learn !)) -->
+<!-- ((! set center !)) -->
# Camlp4 3.10: static functor example
static_functor_example.ml
@@ -1,4 +1,5 @@
<!-- ((! set title Camlp4 3.10 !)) ((! set learn !)) -->
+<!-- ((! set center !)) -->
# Camlp4 3.10: static old syntax
static_old_syntax.ml:
@@ -1,4 +1,5 @@
<!-- ((! set title Camlp5 !)) ((! set learn !)) -->
+<!-- ((! set center !)) -->
# Camlp5
@@ -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
@@ -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
@@ -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
@@ -1,5 +1,7 @@
<!-- ((! set title Development Tools !)) ((! set learn !)) -->
+*Table of contents*
+
# Development Tools
![Under Construction](img/under_construction_icon.gif "")
@@ -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.
@@ -1,4 +1,5 @@
<!-- ((! set title Filenames !)) ((! set learn !)) -->
+<!-- ((! set center !)) -->
# Filenames
This is a reference to the standard **filenames** and extensions used by
@@ -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
@@ -1,4 +1,5 @@
<!-- ((! set title Hash Tables !)) ((! set learn !)) -->
+<!-- ((! set center !)) -->
# Hashtbl
@@ -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)
@@ -1,4 +1,5 @@
<!-- ((! set title Map !)) ((! set learn !)) -->
+<!-- ((! set center !)) -->
# Map
@@ -1,5 +1,7 @@
<!-- ((! set title Modules !)) ((! set learn !)) -->
+*Table of contents*
+
# Modules
## Basic usage
@@ -1,4 +1,5 @@
<!-- ((! set title OCaml and the Web !)) ((! set learn !)) -->
+<!-- ((! set center !)) -->
# OCaml and the Web
## Advantages and Disadvantages
@@ -1,5 +1,7 @@
<!-- ((! set title Performance and Profiling !)) ((! set learn !)) -->
+*Table of contents*
+
# Performance and Profiling
## ObQuote...
@@ -1,4 +1,5 @@
<!-- ((! set title Set !)) ((! set learn !)) -->
+<!-- ((! set center !)) -->
# Set
View
@@ -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>

0 comments on commit 95035ca

Please sign in to comment.