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): ...@@ -47,7 +47,7 @@ class vmod(object):
return r[rev]["url_vcc"] return r[rev]["url_vcc"]
g = self.j.get("github") g = self.j.get("github")
if g != None: if g != None:
s = "https://raw.githubusercontent.com/" s = "https://raw.githubusercontent.com/"
s += g["user"] + "/" s += g["user"] + "/"
s += g["project"] + "/" s += g["project"] + "/"
s += g["branches"][rev] + "/" s += g["branches"][rev] + "/"
...@@ -55,10 +55,34 @@ class vmod(object): ...@@ -55,10 +55,34 @@ class vmod(object):
return s return s
return None 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): def www_table(self):
l = [] l = []
l.append(self.j.get("name")) l.append(self.j.get("name"))
l.append(self.j.get("desc")) 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("license"))
l.append(self.j.get("status")) l.append(self.j.get("status"))
...@@ -109,7 +133,7 @@ def make_www_table(): ...@@ -109,7 +133,7 @@ def make_www_table():
####################################################################### #######################################################################
# Size columns # Size columns
h = ["VMOD", "Description", "License", "Status", "Link", "VCC", "Support"] h = ["VMOD", "Description", "Docs", "License", "Status", "Link", "VCC", "Support"]
w = [0] * len(h) w = [0] * len(h)
for i in nms: for i in nms:
...@@ -136,7 +160,7 @@ Varnish Modules ...@@ -136,7 +160,7 @@ Varnish Modules
VMODs are extensions written for Varnish Cache. This page serves as a VMODs are extensions written for Varnish Cache. This page serves as a
directory of maintained VMODs. 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 to `this github repo <https://github.com/varnishcache/homepage/>`__ and
we will be happy to include it. we will be happy to include it.
......
...@@ -41,7 +41,8 @@ desc ...@@ -41,7 +41,8 @@ desc
~~~~ ~~~~
Description, compact one-line description of what the VMOD does. 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 license
~~~~~~~ ~~~~~~~
...@@ -100,6 +101,11 @@ vcc_path ...@@ -100,6 +101,11 @@ vcc_path
Relative path to the VCC file for the VMOD Relative path to the VCC file for the VMOD
doc_path
~~~~~~~~
Relative path of the file documenting the VMOD (default: the VCC file)
branches branches
~~~~~~~~ ~~~~~~~~
...@@ -131,16 +137,24 @@ repos ...@@ -131,16 +137,24 @@ repos
URL of the repository URL of the repository
rev 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: For instance:
"rev": { "rev": {
"3.0": "http://myvmod.example.com/source/3.0/vmod.vcc", "3.0": {
"4.1": "http://myvmod.example.com/source/4.1/vmod.vcc" "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 Examples
...@@ -159,6 +173,7 @@ A github project:: ...@@ -159,6 +173,7 @@ A github project::
"project": "libvmod-murphy-cal", "project": "libvmod-murphy-cal",
"user": "ACME engineering", "user": "ACME engineering",
"vcc_path": "src/vmod_murphy.vcc" "vcc_path": "src/vmod_murphy.vcc"
"doc_path": "doc/vmod_murphy.rst"
}, },
"license": "FreeBSD", "license": "FreeBSD",
"name": "murphy", "name": "murphy",
...@@ -175,9 +190,11 @@ A VMOD not on github:: ...@@ -175,9 +190,11 @@ A VMOD not on github::
"license": "BeerWare", "license": "BeerWare",
"name": "Y2K", "name": "Y2K",
"repos": "https://example.com/we/are/so/hosed", "repos": "https://example.com/we/are/so/hosed",
"url_doc": "https://sales.example.com/QuantumMurphyCompensator",
"rev": { "rev": {
"4.1": { "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" "status": "prototype"
......
...@@ -5,8 +5,9 @@ ...@@ -5,8 +5,9 @@
"branches": { "branches": {
"4.1": "master" "4.1": "master"
}, },
"project": "libvmod-cookie", "doc_path": "docs/cookie.rst",
"user": "lkarsten", "project": "varnish-modules",
"user": "varnish",
"vcc_path": "src/vmod_cookie.vcc" "vcc_path": "src/vmod_cookie.vcc"
}, },
"license": "FreeBSD", "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