diff --git a/.gitignore b/.gitignore
index 1a3e5eafb2..8ecb1e1dd8 100644
--- a/.gitignore
+++ b/.gitignore
@@ -2,13 +2,9 @@
.history
*~
.*.swp
-templates/*html
-www/policy.html
-www/index.html
-www/files
-www/styles
*/archives/*
*/index.tar.gz
*/urls.txt
-.DS_Store
-.history
+/coq-packages.json
+/_build
+/scripts/.merlin
diff --git a/Makefile b/Makefile
index 6ce8cb037f..3906b8822f 100644
--- a/Makefile
+++ b/Makefile
@@ -1,30 +1,9 @@
-COQWEB=~/COQ/www/
-SUITES_COQPKGIDX = released
-SUITES= $(SUITES_COQPKGIDX) core-dev extra-dev
+SUITES= released core-dev extra-dev
H=@
-COQV=8.8.2
-OCAMLV=4.02.3
-pp = (cd $(COQWEB); yamlpp-0.3/yamlpp -l en $(abspath $(1)) -o $(abspath $(2)))
-
-ifeq "$(shell test ! -z '$(COQWEB)' -a -d $(COQWEB) || echo false)" "false"
-$(error "Please use 'make COQWEB=path/to/coq/www'")
-endif
-
-# refresh opam indexes + generate website
-all: check-deps
- @./scripts/refresh-opam-indexes $(SUITES)
-
-run: all
- $(H)echo "Starting a local web server for test"
- $(H)echo "It is accessible at: http://localhost:8000"
- $(H)cd www && python -m SimpleHTTPServer 8000
-
-check-deps: \
- which-opam which-lua5.1 opam-config which-markdown yamlpp
-
-yamlpp:
- $(H)ls $(COQWEB)/yamlpp-0.3/yamlpp > /dev/null || (echo "Cannot find yamlpp. Please build the website first"; false)
+# refresh opam indexes
+all: which-opam opam-config
+ $(H)./scripts/refresh-opam-indexes $(SUITES)
which-%:
$(H)which $* > /dev/null || (echo "Please install $*"; false)
diff --git a/README.md b/README.md
index 520277ea52..13e86dc15b 100644
--- a/README.md
+++ b/README.md
@@ -24,26 +24,12 @@ To activate the repositories:
opam repo add coq-core-dev https://coq.inria.fr/opam/core-dev
```
-## Website preprocessor
-
-We follow the model of the Coq website.
-One should invoke `make COQWEB=path/to/coq/www` to generate the web pages
-using the same header, footer and `yamlpp` used by the Coq website (it is expected to be in `path/to/coq/www/yamlpp-0.3/yamlpp`. The
-destination folder is `www/`.
-
-The templates are in `templates/`. The file `index.html.in` is first
-processed by `scripts/archive2web` that fills in `
` entries, then
-`yamlpp` is used to insert the header and footer.
-
-The code in `www/filter.js` is used to interactively browse the contents
-of the packages table in `index.html`. The css file
-`www/index-style.css` is also part of the picture.
-
## Website and OPAM metadata
-The website is statically generated looking at the `opam` files.
+The `scripts/archive2web.ml` program generates a JSON file
+`coq-packages.json` by looking at the `opam` files.
-In particular we use the `tags` field of the `opam` file as follows:
+In particular, it uses the `tags` field of an `opam` file as follows:
1. strings beginning with `keyword:` are considered as `keywords`
2. strings beginning with `category:` are considered as `categories`
@@ -63,9 +49,13 @@ tags: [
]
```
-Finally the `homepage:`, `author:`, `maintainer:` and `doc:` fields are
+The `homepage:`, `author:`, `maintainer:`, and `doc:` fields are
also used to generate the package entry.
+This JSON file is generated during continuous integration and copied to
+the website. Some JavaScript code on the website then loads it to
+dynamically generate the content of the webpage on client side.
+
See also [CEP3](https://github.com/coq/ceps/blob/master/text/003-opam-metadata.md) and
the [deployed website](https://coq.inria.fr/opam/www/).
diff --git a/scripts/archive2web b/scripts/archive2web
deleted file mode 100755
index 87b225587a..0000000000
--- a/scripts/archive2web
+++ /dev/null
@@ -1,165 +0,0 @@
-#!/usr/bin/lua5.1
--- requires dpkg and lua-filesystem
-
-function add_uniq(set, e)
- if e and not(set[e]) then
- set[e]=true
- set[#set+1]=e
- end
-end
-
-require "lfs"
-
-function not_dot(x) return not(x:match("^%.")) end
-
-templ=arg[1] or error "1st argument: the template file"
-_=arg[2] or error "following arguments: the repo root path(s)"
-table.remove(arg,1)
-
-packages = {}
-
-function do_one_root(suite)
- root = suite .. '/packages/'
- for p in lfs.dir(root) do if not_dot(p) then
- local pn, v = p:match('^([^%.]*)%.(.*)$')
- if v then p = pn end
- packages[p] = packages[p] or {}
- local info = packages[p]
-
- info.suites = info.suites or {}
- add_uniq(info.suites, suite)
-
- local versions = info.versions or {}
- local curv
- if v then --simply a package
- curv = v
- add_uniq(versions, v)
- else -- a dir of packages
- for pv in lfs.dir(root .. p .. '/') do if not_dot(pv) then
- local v = assert(pv:match('^[^%.]*%.(.*)$'),
- root .. p .. '/' .. pv .. " not pkg.version")
- add_uniq(versions, v)
- curv = v
- end end
- assert(curv,"Directory "..root .. p .." is odd")
- end
- table.sort(versions,function(a,b)
- return 0 == os.execute('dpkg --compare-versions '..a..' gt '..b..
- ' 2>/dev/null')
- end)
- info.versions = versions
-
- local pkg
- if v then pkg = root..p..'.'..curv
- else pkg = root..p..'/'..p..'.'..curv end
-
- local opam = assert(io.open(pkg..'/opam')):read('*a')
- local tags = opam:match('tags:%s*(%b[])') or ""
-
- local keywords = info.keywords or {}
- local dates = info.dates or {}
- local categories = info.categories or {}
- for tag in tags:gmatch('(%b"")') do
- add_uniq(categories, tag:match('"category: *([^"]*)"'))
- add_uniq(keywords, tag:match('"keyword: *([^"]*)"'))
- add_uniq(dates, tag:match('"date: *([^"]*)"'))
- end
- info.categories = categories
- info.keywords = keywords
- info.dates = dates
- info.homepage = info.homepage or opam:match('homepage:%s*"([^"]*)"')
-
- local authors_txt = opam:match('authors:%s*(%b[])') or ""
- local authors = info.authors or {}
- for author in authors_txt:gmatch('(%b"")') do
- add_uniq(authors, author:match('"([^<"]*)'):gsub(' *$',''))
- end
- info.authors = authors
-
- info.description = info.description or
- opam:match('description:%s*"""%s*(.-)%s*"""') or
- opam:match('description:%s*"([^"]*)"') or
- opam:match('synopsis:%s*"([^"]*)"') or
- assert(io.open(pkg..'/descr')):read('*a')
-
- end end
-end
-
-for _, r in ipairs(arg) do
- do_one_root(r)
-end
-
-function plural(s,n,...)
- if n >= 2 then return string.format(s,"s",...)
- else return string.format(s,"",...) end
-end
-function pluraly(s,n,...)
- if n >= 2 then return string.format(s,"ies",...)
- else return string.format(s,"y",...) end
-end
-
-function print_pkg(name,info,print)
- print [[