diff --git a/doc/conf.py b/doc/conf.py index 16a7c9e958d..60e91d0dd0b 100644 --- a/doc/conf.py +++ b/doc/conf.py @@ -143,6 +143,9 @@ SDK_URL_BASE="https://github.com/zephyrproject-rtos/sdk-ng/releases/download" rst_epilog = f""" .. include:: /substitutions.txt +.. |zephyr-version| replace:: ``{version}`` +.. |zephyr-version-ltrim| unicode:: {version} + :ltrim: .. |sdk-version-literal| replace:: ``{sdk_version}`` .. |sdk-version-trim| unicode:: {sdk_version} :trim: diff --git a/doc/develop/getting_started/index.rst b/doc/develop/getting_started/index.rst index 78f43e70b5f..cda955a3374 100644 --- a/doc/develop/getting_started/index.rst +++ b/doc/develop/getting_started/index.rst @@ -252,11 +252,25 @@ chosen. You'll also install Zephyr's additional Python dependencies in a #. Get the Zephyr source code: - .. code-block:: bash + .. only:: not release + + .. code-block:: bash + + west init ~/zephyrproject + cd ~/zephyrproject + west update + + .. only:: release + + .. We need to use a parsed-literal here because substitutions do not work in code + blocks. This means users can't copy-paste these lines as easily as other blocks but + should be good enough still :) + + .. parsed-literal:: - west init ~/zephyrproject - cd ~/zephyrproject - west update + west init ~/zephyrproject --mr v |zephyr-version-ltrim| + cd ~/zephyrproject + west update #. Export a :ref:`Zephyr CMake package `. This allows CMake to automatically load boilerplate code required for building Zephyr