diff options
author | Dan Nicholson <dbn@endlessos.org> | 2021-05-20 16:03:56 -0600 |
---|---|---|
committer | Dan Nicholson <dbn@endlessos.org> | 2021-05-21 10:46:49 -0600 |
commit | e19840a25220b399fb213407ec545c8262d1bc39 (patch) | |
tree | 3ccb10d15c8925e0304bb0f77ee500fcabe7a76f /docs | |
parent | 19a306ecefa6f1ef84e7e4c03cd533c30d070fbe (diff) | |
download | ostree-e19840a25220b399fb213407ec545c8262d1bc39.tar.gz |
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.
Diffstat (limited to 'docs')
-rw-r--r-- | docs/README.md | 5 | ||||
-rw-r--r-- | docs/_config.yml | 5 | ||||
-rw-r--r-- | docs/index.md | 4 | ||||
-rwxr-xr-x | docs/prep-docs.sh | 23 |
4 files changed, 36 insertions, 1 deletions
diff --git a/docs/README.md b/docs/README.md index 7963b04e..f1f89ecb 100644 --- a/docs/README.md +++ b/docs/README.md @@ -22,7 +22,10 @@ bundle config set --local path vendor/bundle bundle install ``` -Finally, render and serve the site locally with Jekyll: +Finally, run the `prep-docs.sh` script and then render and serve the +site locally with Jekyll: + ``` +./prep-docs.sh bundle exec jekyll serve ``` diff --git a/docs/_config.yml b/docs/_config.yml index abe17b88..44135c82 100644 --- a/docs/_config.yml +++ b/docs/_config.yml @@ -13,8 +13,13 @@ exclude: - README.md - Gemfile - Gemfile.lock + - prep-docs.sh - vendor/ +# This is a copy of the apidoc/html directory. Run prep-docs.sh before +# jekyll to put it in place. +include: [reference] + remote_theme: coreos/just-the-docs plugins: - jekyll-remote-theme diff --git a/docs/index.md b/docs/index.md index b6cdc663..5d925d6f 100644 --- a/docs/index.md +++ b/docs/index.md @@ -141,6 +141,10 @@ make make install DESTDIR=/path/to/dest ``` +## API Reference + +The libostree API documentation is available in [Reference](reference/). + ## Contributing See [Contributing]({{ site.baseurl }}{% link CONTRIBUTING.md %}). diff --git a/docs/prep-docs.sh b/docs/prep-docs.sh new file mode 100755 index 00000000..2ae15a74 --- /dev/null +++ b/docs/prep-docs.sh @@ -0,0 +1,23 @@ +#!/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" |