#!/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 <