# Doc versioning mechanism

**URL:** https://discourse.cmake.org/t/doc-versioning-mechanism/4814
**Category:** Development
**Created:** [January 11, 2022, 8:18am UTC](https://discourse.cmake.org/t/doc-versioning-mechanism/4814 "2022-01-11T08:18:21Z")
**Posts on this page:** 1
**Showing post:** 8

<div class="post-metadata">

### Author: ![hwhsu1231](https://discourse.cmake.org/user_avatar/discourse.cmake.org/hwhsu1231/32/5358_2.png) [@hwhsu1231](https://discourse.cmake.org/u/hwhsu1231)
#### Post date: [April 30, 2023, 9:26am UTC](https://discourse.cmake.org/t/doc-versioning-mechanism/4814/8 "2023-04-30T09:26:06Z")

</div>

@brad.king

Execuse me. I wondered how is the “Version Switcher” added into the HTML page after using `-A versionswitch=1` in the command-line?

The following commands are what I use to build the CMake Docs locally:

```plaintext
sphinx-build --version
git clone --depth 1 --no-single-branch https://github.com/Kitware/CMake.git
cd CMake
git checkout v3.25.1 --quiet
git describe --tag
mkdir build && cd build
cmake ../Utilities/Sphinx -GNinja -DSPHINX_HTML=ON -DSPHINX_FLAGS="-A versionswitch=1"
cmake --build .

```

And the following is the code snippet of its HTML code:

 ![image](https://discourse.cmake.org/uploads/default/original/2X/2/2e3c3df4b5b55a5c6f79cf9a674b8e9a4b7be048.png)

Compared to the HTML downloaded from `cmake.org`, we can see that there are lots of stuff inside the `<span class="version_switch"></span>` label:

 ![image](https://discourse.cmake.org/uploads/default/original/2X/7/7ac3998d902c8b004b64e611e9d5d385445d13bc.png)

How does CMake Team modify this snippet in every HTML file when publishing and hosting on `cmake.org`?

---

_[View the full topic](https://discourse.cmake.org/t/doc-versioning-mechanism/4814)._
