A tool to generate a website from an OPAM repository
OCaml CSS HTML Standard ML Makefile JavaScript
Latest commit e9330dd Nov 24, 2016 @samoht samoht committed on GitHub Merge pull request #147 from Chris00/master
Be compatible with Cow ≥ 2.0.0
Failed to load latest commit information.
ext Tiny js to make anchors clickable Jul 27, 2015
src Be compatible with Cow ≥ 2.2.0 Nov 21, 2016
.gitignore Update .gitignore and README.md Sep 19, 2013
.gitmodules Fixed old links to github/OCamlPro instead of github/ocaml Feb 21, 2014
.merlin .merlin: don't forget apalog Aug 10, 2014
.travis.yml Update Travis CI scripts to ocaml-travisci-skeleton ones Jan 10, 2015
CHANGES Correct release date and include version in opam Jan 22, 2015
LICENSE Including LICENSE, and switching headers to LGPL Sep 23, 2013
Makefile Fix search.js creation Jan 22, 2015
README.md README: mention that opam2web is published via opam. Mar 8, 2014
opam Be compatible with Cow ≥ 2.2.0 Nov 21, 2016



A tool to generate a website from an OPAM universe

This utility creates a static website from an OPAM universe, listing all available packages and their details. A homepage and OPAM documentation is included as well.

The latest release of opam2web is available via opam. To install, simply run:

opam install opam2web


If you have opam installed:

opam install re uri opam-lib opamfu cow cmdliner js_of_ocaml


To build the opam2web utility, enter:


The binary will be located in src/_build/opam2web.native after compilation.

To generate the static website corresponding to the default remote in the local OPAM installation, enter:

make -C src run


opam2web [options]* [repositories]*

Each repository is namespaced by its type:

  • path:* A repository at the following local file system path.
  • local:* The repository corresponding to a named opam remote.
  • opam: The current local opam universe.

The order of repositories determines their priority when generating the opam universe to use. Earlier repositories are higher priority.

If no repository is given, the current local opam universe is used.

Some available options are:

  • --output / -o [directory] The directory where to write the generated HTML files.
  • --content / -c [direcory] The directory where to find documentation and templates to use. Defaults to 'content'.
  • --where [comma-separated predicate list] A package's satisfaction of all of the predicates in any of the lists implies generation.
  • --index (all|where) Control which packages to include in the universe index.
  • --help / -help Display the list of options.

Some available predicates are:

  • tag:*
  • depopt
  • not:*
  • repo:*
  • pkg:*

For complete command-line configuration options, run

opam2web --help


opam2web -o website path:~/myrepo local:default

will generate the HTML files corresponding to the repository located in ~/myrepo and the remote named default in the local OPAM installation. Resulting files will be located in the website directory.


  • More complex news system (one page per news, Markdown...)
  • More complex statistics (graphics over time...)