# How is the drop-down menu created after the CMake Docs is built from the Help directory?

**URL:** https://discourse.cmake.org/t/how-is-the-drop-down-menu-created-after-the-cmake-docs-is-built-from-the-help-directory/7882
**Category:** Development
**Created:** [April 12, 2023, 7:14am UTC](https://discourse.cmake.org/t/how-is-the-drop-down-menu-created-after-the-cmake-docs-is-built-from-the-help-directory/7882 "2023-04-12T07:14:52Z")
**Posts on this page:** 5
**Page:** 1

<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 12, 2023, 7:14am UTC](https://discourse.cmake.org/t/how-is-the-drop-down-menu-created-after-the-cmake-docs-is-built-from-the-help-directory/7882/1 "2023-04-12T07:14:52Z")

</div>

As we can see, there is a drop-down menu in the navigation bar of CMake Documentation so that we can toggle different versions:

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

However, there isn’t such a thing by default after we build the html from the Help directory.

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

I wondered how this thing is created automatically? Is there any script file like [python/docsbuild-script](https://github.com/python/docsbuild-scripts) provided?

---

<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 13, 2023, 4:40pm UTC](https://discourse.cmake.org/t/how-is-the-drop-down-menu-created-after-the-cmake-docs-is-built-from-the-help-directory/7882/2 "2023-04-13T16:40:29Z")

</div>

cc: @craig.scott @brad.king

---

<div class="post-metadata">

### Author: ![craig.scott](https://discourse.cmake.org/user_avatar/discourse.cmake.org/craig.scott/32/20_2.png) [@craig.scott](https://discourse.cmake.org/u/craig.scott)
#### Post date: [April 14, 2023, 2:21am UTC](https://discourse.cmake.org/t/how-is-the-drop-down-menu-created-after-the-cmake-docs-is-built-from-the-help-directory/7882/3 "2023-04-14T02:21:40Z")

</div>

I’ve no idea how that’s handled. It’s done only for the official hosted docs, you don’t get it if building locally or in CI. Might have to wait for Brad to provide further info, unless @ben.boeckel happens to know.

---

<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 19, 2023, 4:23am UTC](https://discourse.cmake.org/t/how-is-the-drop-down-menu-created-after-the-cmake-docs-is-built-from-the-help-directory/7882/4 "2023-04-19T04:23:24Z")

</div>

So…May I know who is the CMake team member responsible for publishing the CMake Documentation?

---

<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 21, 2023, 1:26pm UTC](https://discourse.cmake.org/t/how-is-the-drop-down-menu-created-after-the-cmake-docs-is-built-from-the-help-directory/7882/5 "2023-04-21T13:26:18Z")

</div>

I thinks this topic is related to this comment by @brad.king:

> [@Doc versioning mechanism](https://discourse.cmake.org/t/doc-versioning-mechanism/4814/3):
>
> We configure sphinx with a custom template directory [here](https://gitlab.kitware.com/cmake/cmake/-/blob/v3.22.1/Utilities/Sphinx/conf.py.in#L29). That directory contains a custom layout template, which has [special version switch code](https://gitlab.kitware.com/cmake/cmake/-/blob/v3.22.1/Utilities/Sphinx/templates/layout.html#L20-25) activated by passing -A versionswitch=1 when [running sphinx](https://gitlab.kitware.com/cmake/cmake/-/blob/v3.22.1/.gitlab/os-linux.yml#L492). The version switch code loads version\_switch.js, which we publish on the web host [here](https://cmake.org/cmake/help/version_switch.js). The addition of the “This documents an old version of” and “Click here to see the latest release” is done by internal infrastructure we use to prepare the documentation for publication on cmake.org. B…
