ostree/docs/prep-docs.sh
Dan Nicholson e19840a252 docs: Copy in API docs and add link
Make a copy of `apidoc/html` to `docs/reference` and then tell Jekyll to
include it verbatim. This will include the gtk-doc API docs on the
static site. A link is added to the main index.

A script is added to do the copy (a symlink won't do) and is setup to
run before Jekyll in the GitHub workflow. Ideally this would be a local
Jekyll plugin to make the process automatic, but the github-pages gem
doesn't allow that.
2021-05-21 10:46:49 -06:00

24 lines
596 B
Bash
Executable File

#!/bin/sh
# Prepare docs directory for running jekyll. This would be better as a
# local Jekyll plugin, but those aren't allowed by the github-pages gem.
set -e
docsdir=$(dirname "$0")
topdir="$docsdir/.."
# Make sure the API docs have been generated and copy them to the
# reference directory.
apidocs="$topdir/apidoc/html"
refdir="$docsdir/reference"
if [ ! -d "$apidocs" ]; then
echo "error: API docs $apidocs have not been generated" >&2
echo "Rebuild with --enable-gtk-doc option" >&2
exit 1
fi
echo "Copying $apidocs to $refdir"
rm -rf "$refdir"
cp -r "$apidocs" "$refdir"