zlib1g-dev \
python3-yaml
+ - name: Build API docs
+ run: |
+ ./autogen.sh --enable-gtk-doc
+ make -C apidoc
+
- name: Build and publish jekyll docs
uses: helaili/jekyll-action@v2
with:
# Only publish when pushing to main.
# XXX: Maybe this should only run on the release event?
build_only: ${{ github.ref == 'refs/heads/main' && 'false' || 'true' }}
+ # Run the prep script to put the API docs in place.
+ pre_build_commands: ./docs/prep-docs.sh
docs/.bundle/ \
docs/Gemfile.lock \
docs/_site/ \
+ docs/reference/ \
docs/vendor/ \
$(NULL)
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
```
- 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
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 %}).
--- /dev/null
+#!/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"