From 27e2b5acaf93e68c67a1be4046da4c8fbfbff8b1 Mon Sep 17 00:00:00 2001 From: Nicolas Stalder Date: Wed, 17 Feb 2021 02:08:37 +0100 Subject: [PATCH] Add toplevel index.html --- .github/workflows/docs.yml | 2 +- scripts/make-toplevel-index.sh | 101 +++++++++++++++++++++++++++++++++ 2 files changed, 102 insertions(+), 1 deletion(-) create mode 100755 scripts/make-toplevel-index.sh diff --git a/.github/workflows/docs.yml b/.github/workflows/docs.yml index d4a1f97..b4c143a 100644 --- a/.github/workflows/docs.yml +++ b/.github/workflows/docs.yml @@ -17,7 +17,7 @@ jobs: profile: minimal - name: Build Documentation - run: cargo doc --no-deps + run: cargo doc --no-deps && scripts/make-toplevel-index.sh - name: Deploy Docs uses: peaceiris/actions-gh-pages@v3 diff --git a/scripts/make-toplevel-index.sh b/scripts/make-toplevel-index.sh new file mode 100755 index 0000000..334708a --- /dev/null +++ b/scripts/make-toplevel-index.sh @@ -0,0 +1,101 @@ +#!/usr/bin/env bash + +# Copyright Materialize, Inc. All rights reserved. +# +# Use of this software is governed by the Business Source License +# included in the LICENSE file at the root of this repository. +# +# As of the Change Date specified in that file, in accordance with +# the Business Source License, use of this software will be governed +# by the Apache License, Version 2.0. +# +# doc — renders API documentation. + +set -euo pipefail + +crate=$(basename $(pwd)) + +# Create a nice homepage for the docs. It's awful that we have to copy the +# HTML template like this, but the upstream issue [0] that would resolve this is +# now five years old and doesn't look close to resolution. +# [0]: https://github.com/rust-lang/cargo/issues/739 +cat > target/doc/index.html < + + + + + $crate + + + + + + + + + + + + + +
+ +
+
+ + +
+

+ $crate documentation +

+

This is the home of $crate's internal API documentation.

+
+ + + + + + + + + +EOF + +# Make the logo link to the nice homepage we just created. Otherwise it just +# links to the root of whatever crate you happen to be looking at. +cat >> target/doc/main.js <