Pagination
Created by: leowzukw
It would be interesting to be able to put paginations in pages. Instead of a long, not very clear page, it could be cut into several pages.
It could be done with a special tag to put were we would like to cut such as <page-cut>
.
/install.html
like this
For instance, a page
<page title="Installation"
>
<prepare-toc depth="2">
<toc></toc>
<section id="opam" title="Quick install with Opam">
<p>
The easiest way to install is to use <ext-a href="http://opam.ocaml.org">OPAM</ext-a>.
Install Opam, then, as a regular user, fetch and install an OCaml version and install Stog.
The whole can be done with the following opam commands:
</p>
<command-line>
$ opam init --comp=4.02.1 # or 4.02.2
$ opam update
$ opam install stog
</command-line>
</section>
<page-cut/>
<section id="deps" title="Dependencies">
<p>
To build Stog, you will need:
</p>
<ul>
<li><ext-a href="http://caml.inria.fr/">OCaml >= 4.02.1</ext-a>,</li>
<li><ext-a href="http://zoggy.github.io/ocf/">Ocf >= 0.3.0</ext-a>.</li>
<li><ext-a href="http://erratique.ch/software/xmlm">Xmlm >= 1.1.0</ext-a>,</li>
<li><ext-a href="http://projects.camlcity.org/projects/ocamlnet.html">OCamlnet >= 3.6</ext-a>.</li>
<li><ext-a href="https://github.com/johnwhitington/ppx_blob">ppx_blob >= 0.1</ext-a>,</li>
<li><ext-a href="http://zoggy.github.io/xtmpl/">Xtmpl >= 0.12</ext-a>,</li>
<li><ext-a href="http://zoggy.github.io/higlo/">Higlo >= 0.4</ext-a>.</li>
</ul>
<p>
</subsection>
</section>
</prepare-toc>
</page>
Would be translated in to files like this /install/1
and /install/2
with this content:
/install/1
<page title="Installation - 1"
>
<prepare-toc depth="2">
<toc></toc>
<section id="opam" title="Quick install with Opam">
<p>
The easiest way to install is to use <ext-a href="http://opam.ocaml.org">OPAM</ext-a>.
Install Opam, then, as a regular user, fetch and install an OCaml version and install Stog.
The whole can be done with the following opam commands:
</p>
<command-line>
$ opam init --comp=4.02.1 # or 4.02.2
$ opam update
$ opam install stog
</command-line>
</section>
<page-cut/>
</prepare-toc>
</page>
/install/2
<page title="Installation - 2"
>
<prepare-toc depth="2">
<toc></toc>
<section id="deps" title="Dependencies">
<p>
To build Stog, you will need:
</p>
<ul>
<li><ext-a href="http://caml.inria.fr/">OCaml >= 4.02.1</ext-a>,</li>
<li><ext-a href="http://zoggy.github.io/ocf/">Ocf >= 0.3.0</ext-a>.</li>
<li><ext-a href="http://erratique.ch/software/xmlm">Xmlm >= 1.1.0</ext-a>,</li>
<li><ext-a href="http://projects.camlcity.org/projects/ocamlnet.html">OCamlnet >= 3.6</ext-a>.</li>
<li><ext-a href="https://github.com/johnwhitington/ppx_blob">ppx_blob >= 0.1</ext-a>,</li>
<li><ext-a href="http://zoggy.github.io/xtmpl/">Xtmpl >= 0.12</ext-a>,</li>
<li><ext-a href="http://zoggy.github.io/higlo/">Higlo >= 0.4</ext-a>.</li>
</ul>
<p>
</subsection>
</section>
</prepare-toc>
</page>
The text on the page would of course be longer when paginating, but here I cut for clarity.
Ideas to do this
- Generalize the multi-doc module.
- Allow to template it with variable like page-number, total-number-of-page
- The way Hugo does that may be quite interesting
- There could be an option to cut automatically on certain tags such as
<section>