Documentation hosting
The canonical kLLM documentation is published at
docs.agentnetwork.org.cn/kllm/en/latest/,
on the documentation host of Agent Network, next to the ANet documentation at
https://docs.agentnetwork.org.cn/docs/en/latest/. This page describes how the
documentation is built and published.
Address layout
Address |
Content |
|---|---|
|
The English documentation built from the main branch. |
|
Redirects to |
docs/conf.py sets html_baseurl to the published address, so that every page carries
a canonical link to it. All links inside the built HTML, including the theme’s static files
and the search index, are relative; the output can therefore be served under the
/kllm/en/latest/ prefix without changes. Links from other kLLM sources (the README, the
website and the key-application service) point to pages under this address.
Building
The documentation is a Sphinx project in docs/ with the Read the Docs theme. The pinned
build requirements are in docs/requirements.txt. From the repository root:
$ python -m pip install -r docs/requirements.txt
$ python -m sphinx -n -W --keep-going -b html docs docs/_build/html
Warnings are errors, as in continuous integration: the docs workflow
(.github/workflows/docs.yml) runs the same command on every change to docs/ and keeps
the result as the docs-html build artifact. .readthedocs.yaml describes the same build
for Read the Docs, with fail_on_warning set, and is kept so that the project can also be
built there.
Publishing
The built HTML in docs/_build/html is copied to the documentation host under
kllm/en/latest/, replacing the previous contents:
$ rsync -a --delete docs/_build/html/ <docs host>:<docs root>/kllm/en/latest/
<docs root> is the directory from which the documentation host serves
https://docs.agentnetwork.org.cn/. The docs workflow artifact can be published in the
same way instead of a local build. The web server serves the directory as static files: a
request for a directory serves its index.html, and /kllm/ redirects to
/kllm/en/latest/. For nginx:
location = /kllm/ {
return 301 /kllm/en/latest/;
}
location /kllm/ {
try_files $uri $uri/ =404;
}
After publishing, check that the start page, a page in a subdirectory (for example Claims) and the search page load, and that the theme’s style sheets are served.
See also
The kLLM website for the kLLM website at
https://kllm.agentnetwork.org.cn.Contributing to kLLM for the documentation style rules.