Skip to content

Commit d7ff0e4

Browse files
kartbendanieldegrasse
authored andcommitted
doc: develop: gsg: have west init use pinned Zephyr version for releases
When building the docs for a release, the section of the getting started that lets the user `west init` their workspace now has them check out the version matchin the release. Fixes #92163 Signed-off-by: Benjamin Cabé <benjamin@zephyrproject.org>
1 parent 792e3c2 commit d7ff0e4

File tree

2 files changed

+21
-4
lines changed

2 files changed

+21
-4
lines changed

doc/conf.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -143,6 +143,9 @@
143143
rst_epilog = f"""
144144
.. include:: /substitutions.txt
145145
146+
.. |zephyr-version| replace:: ``{version}``
147+
.. |zephyr-version-ltrim| unicode:: {version}
148+
:ltrim:
146149
.. |sdk-version-literal| replace:: ``{sdk_version}``
147150
.. |sdk-version-trim| unicode:: {sdk_version}
148151
:trim:

doc/develop/getting_started/index.rst

Lines changed: 18 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -252,11 +252,25 @@ chosen. You'll also install Zephyr's additional Python dependencies in a
252252
253253
#. Get the Zephyr source code:
254254

255-
.. code-block:: bash
255+
.. only:: not release
256+
257+
.. code-block:: bash
258+
259+
west init ~/zephyrproject
260+
cd ~/zephyrproject
261+
west update
262+
263+
.. only:: release
264+
265+
.. We need to use a parsed-literal here because substitutions do not work in code
266+
blocks. This means users can't copy-paste these lines as easily as other blocks but
267+
should be good enough still :)
268+
269+
.. parsed-literal::
256270
257-
west init ~/zephyrproject
258-
cd ~/zephyrproject
259-
west update
271+
west init ~/zephyrproject --mr v |zephyr-version-ltrim|
272+
cd ~/zephyrproject
273+
west update
260274
261275
#. Export a :ref:`Zephyr CMake package <cmake_pkg>`. This allows CMake to
262276
automatically load boilerplate code required for building Zephyr

0 commit comments

Comments
 (0)