Skip to content

Commit

Permalink
Remove obsolete files.
Browse files Browse the repository at this point in the history
The opam/www/index.html webpage is now dynamically updated on client side
from the content of the coq-packages.json file. So, Makefile's only role
is now to refresh the Opam index on server side. As for coq-packages.json,
it is generated by the CI.
  • Loading branch information
silene committed Jan 12, 2021
1 parent 8b8ef19 commit 3aadbba
Show file tree
Hide file tree
Showing 9 changed files with 15 additions and 464 deletions.
10 changes: 3 additions & 7 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -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
29 changes: 4 additions & 25 deletions Makefile
Original file line number Diff line number Diff line change
@@ -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)
Expand Down
26 changes: 8 additions & 18 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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 `<tr>` 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`
Expand All @@ -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/).
Expand Down
165 changes: 0 additions & 165 deletions scripts/archive2web

This file was deleted.

Loading

0 comments on commit 3aadbba

Please sign in to comment.