diff --git a/docs/source/conf.py b/docs/source/conf.py index fd105a6cf..44975c02c 100644 --- a/docs/source/conf.py +++ b/docs/source/conf.py @@ -13,6 +13,13 @@ # https://www.sphinx-doc.org/en/master/usage/configuration.html#project-information from docutils import nodes +import tomli # Import tomli for TOML parsing +from pathlib import Path + +# Read version from pyproject.toml +with Path(__file__).parent.parent.parent.joinpath("pyproject.toml").open("rb") as f: + pyproject = tomli.load(f) + llama_stack_version = pyproject["project"]["version"] project = "llama-stack" copyright = "2025, Meta" @@ -66,6 +73,7 @@ myst_enable_extensions = [ myst_substitutions = { "docker_hub": "https://hub.docker.com/repository/docker/llamastack", + "llama_stack_version": llama_stack_version, } suppress_warnings = ['myst.header'] diff --git a/docs/source/index.md b/docs/source/index.md index 48e1e7124..8234e1a9a 100644 --- a/docs/source/index.md +++ b/docs/source/index.md @@ -1,8 +1,7 @@ - ```{admonition} News :class: tip -Llama Stack 0.1.4 is now available! See the [release notes](https://github.com/meta-llama/llama-stack/releases/tag/v0.1.4) for more details. +Llama Stack {{ llama_stack_version }} is now available! See the [release notes](https://github.com/meta-llama/llama-stack/releases/tag/v{{ llama_stack_version }}) for more details. ``` # Llama Stack diff --git a/pyproject.toml b/pyproject.toml index 2ed2c4fa9..dc5659f06 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -74,6 +74,7 @@ docs = [ "sphinxcontrib.redoc", "sphinxcontrib.video", "sphinxcontrib.mermaid", + "tomli", ] [project.urls]