From ddb62e13fe486dde3ea24046d5032aa94c7ef0fd Mon Sep 17 00:00:00 2001
From: David Robillard <d@drobilla.net>
Date: Thu, 25 Jul 2019 21:00:32 +0200
Subject: Build documentation and coverage index page

---
 doc/index.html.in | 35 +++++++++++++++++++++++++++++++++++
 wscript           |  9 ++++++++-
 2 files changed, 43 insertions(+), 1 deletion(-)
 create mode 100644 doc/index.html.in

diff --git a/doc/index.html.in b/doc/index.html.in
new file mode 100644
index 00000000..55d2d1e7
--- /dev/null
+++ b/doc/index.html.in
@@ -0,0 +1,35 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml">
+  <head>
+    <meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
+    <title>Serd</title>
+    <link href="doc/html/style.css" rel="stylesheet" type="text/css" />
+  </head>
+  <body>
+    <div id="top">
+      <div id="titlearea">
+        <div id="header">
+          <div id="titlebox">
+            <h1 id="title">Serd</h1>
+            <div id="shortdesc">A lightweight library for RDF storage and serialisation</div>
+          </div>
+          <div id="metabox">
+            <table id="meta">
+              <tr><th>Version</th><td>@SERD_VERSION@</td></tr>
+            </table>
+          </div>
+        </div>
+      </div>
+
+      <div id="navrow1" class="tabs" />
+        <ul class="tablist" />
+      </div>
+
+      <ul>
+        <li><a href="doc/html/index.html">API Documentation</a></li>
+        <li><a href="coverage/index.html">Test Coverage</a></li>
+      </ul>
+
+      <div id="footer" />
+  </body>
+</html>
diff --git a/wscript b/wscript
index fafa76b3..088ea0bc 100644
--- a/wscript
+++ b/wscript
@@ -161,7 +161,14 @@ def build(bld):
             obj.linkflags        = ['-static']
 
     # Documentation
-    autowaf.build_dox(bld, 'SERD', SERD_VERSION, top, out)
+    if bld.env.DOCS:
+        autowaf.build_dox(bld, 'SERD', SERD_VERSION, top, out)
+        bld(features='subst',
+            source='doc/index.html.in',
+            target='doc/index.html',
+            install_path='',
+            name='index',
+            SERD_VERSION=SERD_VERSION)
 
     # Man page
     bld.install_files('${MANDIR}/man1', 'doc/serdi.1')
-- 
cgit v1.2.1