Commit 98ed635c authored by Poul-Henning Kamp's avatar Poul-Henning Kamp

Add a Documentation column

parent 208c6d8c
......@@ -47,7 +47,7 @@ class vmod(object):
return r[rev]["url_vcc"]
g = self.j.get("github")
if g != None:
s = "https://raw.githubusercontent.com/"
s = "https://raw.githubusercontent.com/"
s += g["user"] + "/"
s += g["project"] + "/"
s += g["branches"][rev] + "/"
......@@ -55,10 +55,34 @@ class vmod(object):
return s
return None
def url_doc(self, rev):
r = self.j.get("rev")
if r != None and "url_doc" in r[rev]:
return r[rev]["url_doc"]
g = self.j.get("github")
if g != None and "doc_path" in g:
s = "https://github.com/"
s += g["user"] + "/"
s += g["project"] + "/"
s += "blob/"
s += g["branches"][rev] + "/"
s += g["doc_path"]
return s
return None
def www_table(self):
l = []
l.append(self.j.get("name"))
l.append(self.j.get("desc"))
s = ""
for r in self.versions():
doc = self.url_doc(r)
if doc != None:
s += " `%s <%s>`_ " % (r, doc)
else:
vcc = self.url_vcc(r)
s += " `%s <%s>`_ " % (r, vcc)
l.append(s)
l.append(self.j.get("license"))
l.append(self.j.get("status"))
......@@ -109,7 +133,7 @@ def make_www_table():
#######################################################################
# Size columns
h = ["VMOD", "Description", "License", "Status", "Link", "VCC", "Support"]
h = ["VMOD", "Description", "Docs", "License", "Status", "Link", "VCC", "Support"]
w = [0] * len(h)
for i in nms:
......@@ -136,7 +160,7 @@ Varnish Modules
VMODs are extensions written for Varnish Cache. This page serves as a
directory of maintained VMODs.
If you have written a VMOD and want it listed here please send a PR
If you have written a VMOD and want it listed here please send a PR
to `this github repo <https://github.com/varnishcache/homepage/>`__ and
we will be happy to include it.
......
......@@ -41,7 +41,8 @@ desc
~~~~
Description, compact one-line description of what the VMOD does.
(Don't repeat the VMOD name here)
(Don't repeat the VMOD name here, it looks silly in the table.)
license
~~~~~~~
......@@ -100,6 +101,11 @@ vcc_path
Relative path to the VCC file for the VMOD
doc_path
~~~~~~~~
Relative path of the file documenting the VMOD (default: the VCC file)
branches
~~~~~~~~
......@@ -131,16 +137,24 @@ repos
URL of the repository
rev
~~~
An object mapping Varnish version to URL where the VCC file can be found.
An object mapping Varnish version to URL where the VCC and documentation
files can be found.
For instance:
"rev": {
"3.0": "http://myvmod.example.com/source/3.0/vmod.vcc",
"4.1": "http://myvmod.example.com/source/4.1/vmod.vcc"
"3.0": {
"url_vcc": "http://myvmod.example.com/source/3.0/vmod.vcc",
"url_doc": "http://myvmod.example.com/docs/3.0/vmod.txt"
},
"4.1": {
"url_vcc": "http://myvmod.example.com/source/4.1/vmod.vcc",
"url_doc": "http://myvmod.example.com/docs/4.1/vmod.txt"
}
}
Examples
......@@ -159,6 +173,7 @@ A github project::
"project": "libvmod-murphy-cal",
"user": "ACME engineering",
"vcc_path": "src/vmod_murphy.vcc"
"doc_path": "doc/vmod_murphy.rst"
},
"license": "FreeBSD",
"name": "murphy",
......@@ -175,9 +190,11 @@ A VMOD not on github::
"license": "BeerWare",
"name": "Y2K",
"repos": "https://example.com/we/are/so/hosed",
"url_doc": "https://sales.example.com/QuantumMurphyCompensator",
"rev": {
"4.1": {
"url_vcc": "https://example.com/we/are/so/hosed/vmod.vcc"
"url_vcc": "https://example.com/we/are/so/hosed/vmod.vcc",
"url_doc": "https://example.com/we/are/so/hosed/README"
}
},
"status": "prototype"
......
......@@ -5,8 +5,9 @@
"branches": {
"4.1": "master"
},
"project": "libvmod-cookie",
"user": "lkarsten",
"doc_path": "docs/cookie.rst",
"project": "varnish-modules",
"user": "varnish",
"vcc_path": "src/vmod_cookie.vcc"
},
"license": "FreeBSD",
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment