10
1
mirror of https://gitlab.com/scemama/QCaml.git synced 2024-12-22 20:33:36 +01:00

Improved documentation

This commit is contained in:
Anthony Scemama 2021-01-01 18:35:37 +01:00
parent fccf76180e
commit 5f3c514c79
6 changed files with 85 additions and 37 deletions

View File

@ -5,18 +5,18 @@ MAKEFLAGS += --no-builtin-rules
.SUFFIXES: .SUFFIXES:
DIRS=$(shell ls */README.org | sed "s|/README.org||g") DIRS=$(shell ls */README.org | sed "s|/README.org||g")
DOCS=$(patsubst %, docs/%.html, $(DIRS)) DOCS=$(patsubst %, docs/%.html, $(DIRS)) docs/index.html
.PHONY: default build install uninstall test clean doc .PHONY: default build install uninstall test clean doc
default: build default: doc build
docs/index.html: docs/index.org
- ./bin/build_doc.sh docs
docs/%.html: %/README.org %/lib/*.ml %/lib/*.mli %/test/*.ml docs/%.html: %/*.org %/lib/*.ml %/lib/*.mli %/test/*.ml
- echo $^
- ./bin/tangle.sh $* - ./bin/tangle.sh $*
- ./bin/build_doc.sh $* - ./bin/build_doc.sh $*
- ./bin/build_doc.sh docs
doc: $(DOCS) doc: $(DOCS)

View File

@ -3,7 +3,7 @@
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" lang="en" xml:lang="en"> <html xmlns="http://www.w3.org/1999/xhtml" lang="en" xml:lang="en">
<head> <head>
<!-- 2021-01-01 Fri 18:06 --> <!-- 2021-01-01 Fri 18:35 -->
<meta http-equiv="Content-Type" content="text/html;charset=utf-8" /> <meta http-equiv="Content-Type" content="text/html;charset=utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1" /> <meta name="viewport" content="width=device-width, initial-scale=1" />
<title>QCaml documentation</title> <title>QCaml documentation</title>
@ -225,6 +225,37 @@
<body> <body>
<div id="content"> <div id="content">
<h1 class="title">QCaml documentation</h1> <h1 class="title">QCaml documentation</h1>
<div id="table-of-contents">
<h2>Table of Contents</h2>
<div id="text-table-of-contents">
<ul>
<li><a href="#org010d4f6">1. Documentation of Modules</a></li>
</ul>
</div>
</div>
<p>
QCaml is an OCaml library for writing quantum chemistry codes.
It is written using literate programming with org-mode.
</p>
<p>
To use it interactively in the top level or in a Jupyter or org-mode
notebook, use
</p>
<div class="org-src-container">
<pre class="src src-ocaml"><span class="org-tuareg-font-lock-operator">#</span>require <span class="org-string">"qcaml.top"</span> <span class="org-tuareg-font-double-colon">;;</span>
</pre>
</div>
<p>
This loads all the sub-libraries provided with QCaml, and installs
the pretty printers.
</p>
<div id="outline-container-org010d4f6" class="outline-2">
<h2 id="org010d4f6"><span class="section-number-2">1</span> Documentation of Modules</h2>
<div class="outline-text-2" id="text-1">
<div class="org-src-container"> <div class="org-src-container">
<pre class="src src-org">- <span class="org-org-link"><a href="./ao.html">Ao</a></span> <pre class="src src-org">- <span class="org-org-link"><a href="./ao.html">Ao</a></span>
- <span class="org-org-link"><a href="./common.html">Common</a></span> - <span class="org-org-link"><a href="./common.html">Common</a></span>
@ -241,9 +272,11 @@
</pre> </pre>
</div> </div>
</div> </div>
</div>
</div>
<div id="postamble" class="status"> <div id="postamble" class="status">
<p class="author">Author: Anthony Scemama</p> <p class="author">Author: Anthony Scemama</p>
<p class="date">Created: 2021-01-01 Fri 18:06</p> <p class="date">Created: 2021-01-01 Fri 18:35</p>
<p class="validation"><a href="https://validator.w3.org/check?uri=referer">Validate</a></p> <p class="validation"><a href="https://validator.w3.org/check?uri=referer">Validate</a></p>
</div> </div>
</body> </body>

View File

@ -1,6 +1,22 @@
#+TITLE: QCaml documentation #+TITLE: QCaml documentation
#+SETUPFILE: ../docs/org-html-themes/org/theme-readtheorg.setup #+SETUPFILE: ../docs/org-html-themes/org/theme-readtheorg.setup
QCaml is an OCaml library for writing quantum chemistry codes.
It is written using literate programming with org-mode.
To use it interactively in the top level or in a Jupyter or org-mode
notebook, use
#+begin_src ocaml
#require "qcaml.top" ;;
#+end_src
This loads all the sub-libraries provided with QCaml, and installs
the pretty printers.
* Documentation of Modules
#+NAME: list #+NAME: list
#+begin_src sh :exports results :results org #+begin_src sh :exports results :results org
ls ../*/README.org \ ls ../*/README.org \

View File

@ -3,7 +3,7 @@
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" lang="en" xml:lang="en"> <html xmlns="http://www.w3.org/1999/xhtml" lang="en" xml:lang="en">
<head> <head>
<!-- 2021-01-01 Fri 17:56 --> <!-- 2021-01-01 Fri 18:28 -->
<meta http-equiv="Content-Type" content="text/html;charset=utf-8" /> <meta http-equiv="Content-Type" content="text/html;charset=utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1" /> <meta name="viewport" content="width=device-width, initial-scale=1" />
<title>Perturbation</title> <title>Perturbation</title>
@ -229,31 +229,31 @@
<h2>Table of Contents</h2> <h2>Table of Contents</h2>
<div id="text-table-of-contents"> <div id="text-table-of-contents">
<ul> <ul>
<li><a href="#orgffe8c93">1. MP2</a> <li><a href="#org310738f">1. MP2</a>
<ul> <ul>
<li><a href="#org0cc26b9">1.1. Type</a></li> <li><a href="#org791d8b4">1.1. Type</a></li>
<li><a href="#orga1885fd">1.2. Creation</a></li> <li><a href="#org3d234e6">1.2. Creation</a></li>
<li><a href="#orgb32fd6a">1.3. Access</a></li> <li><a href="#org6f96dbb">1.3. Access</a></li>
<li><a href="#org881137e">1.4. Printers</a></li> <li><a href="#org30b589c">1.4. Printers</a></li>
<li><a href="#org05c8b3e">1.5. Tests</a></li> <li><a href="#org107076b">1.5. Tests</a></li>
</ul> </ul>
</li> </li>
</ul> </ul>
</div> </div>
</div> </div>
<div class="org-src-container"> <div class="org-src-container">
<pre class="src src-ocaml" id="org9a4447a"><span class="org-string">"Perturbation theory"</span> <pre class="src src-ocaml" id="org2a31920"><span class="org-string">"Perturbation theory"</span>
</pre> </pre>
</div> </div>
<div id="outline-container-orgffe8c93" class="outline-2"> <div id="outline-container-org310738f" class="outline-2">
<h2 id="orgffe8c93"><span class="section-number-2">1</span> MP2</h2> <h2 id="org310738f"><span class="section-number-2">1</span> MP2</h2>
<div class="outline-text-2" id="text-1"> <div class="outline-text-2" id="text-1">
</div> </div>
<div id="outline-container-org0cc26b9" class="outline-3"> <div id="outline-container-org791d8b4" class="outline-3">
<h3 id="org0cc26b9"><span class="section-number-3">1.1</span> Type</h3> <h3 id="org791d8b4"><span class="section-number-3">1.1</span> Type</h3>
<div class="outline-text-3" id="text-1-1"> <div class="outline-text-3" id="text-1-1">
<div class="org-src-container"> <div class="org-src-container">
<pre class="src src-ocaml"><span class="org-tuareg-font-lock-governing">type</span> <span class="org-type">t</span> <pre class="src src-ocaml"><span class="org-tuareg-font-lock-governing">type</span> <span class="org-type">t</span>
@ -262,8 +262,8 @@
</div> </div>
</div> </div>
<div id="outline-container-orga1885fd" class="outline-3"> <div id="outline-container-org3d234e6" class="outline-3">
<h3 id="orga1885fd"><span class="section-number-3">1.2</span> Creation</h3> <h3 id="org3d234e6"><span class="section-number-3">1.2</span> Creation</h3>
<div class="outline-text-3" id="text-1-2"> <div class="outline-text-3" id="text-1-2">
<div class="org-src-container"> <div class="org-src-container">
<pre class="src src-ocaml"><span class="org-tuareg-font-lock-governing">val</span> <span class="org-function-name">make</span> <span class="org-tuareg-font-lock-operator">:</span> <span class="org-tuareg-font-lock-label">frozen_core</span><span class="org-tuareg-font-lock-operator">:</span><span class="org-tuareg-font-lock-module">Mo.Frozen_core.</span>t <span class="org-tuareg-font-lock-operator">-&gt;</span> <span class="org-tuareg-font-lock-module">Mo.Basis.</span>t <span class="org-tuareg-font-lock-operator">-&gt;</span> t <pre class="src src-ocaml"><span class="org-tuareg-font-lock-governing">val</span> <span class="org-function-name">make</span> <span class="org-tuareg-font-lock-operator">:</span> <span class="org-tuareg-font-lock-label">frozen_core</span><span class="org-tuareg-font-lock-operator">:</span><span class="org-tuareg-font-lock-module">Mo.Frozen_core.</span>t <span class="org-tuareg-font-lock-operator">-&gt;</span> <span class="org-tuareg-font-lock-module">Mo.Basis.</span>t <span class="org-tuareg-font-lock-operator">-&gt;</span> t
@ -286,17 +286,17 @@
</tbody> </tbody>
</table> </table>
<pre class="example" id="org620c2dc"> <pre class="example" id="org7915b05">
let mp2 = let mp2 =
Mp2.make ~frozen_core:(Mo.Frozen_core.(make Small molecule)) mo_basis Perturbation.Mp2.make ~frozen_core:(Mo.Frozen_core.(make Small nuclei)) mo_basis
;; ;;
- : Mp2.t : &lt;abstr&gt; val mp2 : Perturbation.Mp2.t = E(MP2)=-0.185523
</pre> </pre>
</div> </div>
</div> </div>
<div id="outline-container-orgb32fd6a" class="outline-3"> <div id="outline-container-org6f96dbb" class="outline-3">
<h3 id="orgb32fd6a"><span class="section-number-3">1.3</span> Access</h3> <h3 id="org6f96dbb"><span class="section-number-3">1.3</span> Access</h3>
<div class="outline-text-3" id="text-1-3"> <div class="outline-text-3" id="text-1-3">
<div class="org-src-container"> <div class="org-src-container">
<pre class="src src-ocaml"><span class="org-tuareg-font-lock-governing">val</span> <span class="org-function-name">energy</span> <span class="org-tuareg-font-lock-operator">:</span> t <span class="org-tuareg-font-lock-operator">-&gt;</span> float <pre class="src src-ocaml"><span class="org-tuareg-font-lock-governing">val</span> <span class="org-function-name">energy</span> <span class="org-tuareg-font-lock-operator">:</span> t <span class="org-tuareg-font-lock-operator">-&gt;</span> float
@ -331,14 +331,14 @@ let mp2 =
</tbody> </tbody>
</table> </table>
<pre class="example" id="orgb6a963d"> <pre class="example" id="org1aeb8fb">
</pre> </pre>
</div> </div>
</div> </div>
<div id="outline-container-org881137e" class="outline-3"> <div id="outline-container-org30b589c" class="outline-3">
<h3 id="org881137e"><span class="section-number-3">1.4</span> Printers</h3> <h3 id="org30b589c"><span class="section-number-3">1.4</span> Printers</h3>
<div class="outline-text-3" id="text-1-4"> <div class="outline-text-3" id="text-1-4">
<div class="org-src-container"> <div class="org-src-container">
<pre class="src src-ocaml"><span class="org-tuareg-font-lock-governing">val</span> <span class="org-function-name">pp</span> <span class="org-tuareg-font-lock-operator">:</span> <span class="org-tuareg-font-lock-module">Format.</span>formatter <span class="org-tuareg-font-lock-operator">-&gt;</span> t <span class="org-tuareg-font-lock-operator">-&gt;</span> unit <pre class="src src-ocaml"><span class="org-tuareg-font-lock-governing">val</span> <span class="org-function-name">pp</span> <span class="org-tuareg-font-lock-operator">:</span> <span class="org-tuareg-font-lock-module">Format.</span>formatter <span class="org-tuareg-font-lock-operator">-&gt;</span> t <span class="org-tuareg-font-lock-operator">-&gt;</span> unit
@ -347,14 +347,14 @@ let mp2 =
</div> </div>
</div> </div>
<div id="outline-container-org05c8b3e" class="outline-3"> <div id="outline-container-org107076b" class="outline-3">
<h3 id="org05c8b3e"><span class="section-number-3">1.5</span> Tests</h3> <h3 id="org107076b"><span class="section-number-3">1.5</span> Tests</h3>
</div> </div>
</div> </div>
</div> </div>
<div id="postamble" class="status"> <div id="postamble" class="status">
<p class="author">Author: Anthony Scemama</p> <p class="author">Author: Anthony Scemama</p>
<p class="date">Created: 2021-01-01 Fri 17:56</p> <p class="date">Created: 2021-01-01 Fri 18:28</p>
<p class="validation"><a href="https://validator.w3.org/check?uri=referer">Validate</a></p> <p class="validation"><a href="https://validator.w3.org/check?uri=referer">Validate</a></p>
</div> </div>
</body> </body>

View File

@ -12,9 +12,9 @@ type t = {
* *
* #+begin_example * #+begin_example
* let mp2 = * let mp2 =
* Mp2.make ~frozen_core:(Mo.Frozen_core.(make Small molecule)) mo_basis * Perturbation.Mp2.make ~frozen_core:(Mo.Frozen_core.(make Small nuclei)) mo_basis
* ;; * ;;
* - : Mp2.t : <abstr> * val mp2 : Perturbation.Mp2.t = E(MP2)=-0.185523
* #+end_example *) * #+end_example *)

View File

@ -38,9 +38,9 @@ val make : frozen_core:Mo.Frozen_core.t -> Mo.Basis.t -> t
#+begin_example #+begin_example
let mp2 = let mp2 =
Mp2.make ~frozen_core:(Mo.Frozen_core.(make Small molecule)) mo_basis Perturbation.Mp2.make ~frozen_core:(Mo.Frozen_core.(make Small nuclei)) mo_basis
;; ;;
- : Mp2.t : <abstr> val mp2 : Perturbation.Mp2.t = E(MP2)=-0.185523
#+end_example #+end_example
#+begin_src ocaml :tangle (eval ml) :exports none #+begin_src ocaml :tangle (eval ml) :exports none
@ -127,7 +127,6 @@ let mo_basis t = t.mo_basis
let frozen_core t = t.frozen_core let frozen_core t = t.frozen_core
#+end_src #+end_src
** Printers ** Printers
#+begin_src ocaml :tangle (eval mli) #+begin_src ocaml :tangle (eval mli)