Skip to content

Writing Documentation

This page outlines how to write documentation for VM Operator.

Go Docs

// TODO (

Project Docs

The project documentation lives in the ./docs directory and is written in Markdown. This section reviews the project documentation structure and examples for writing high-quality documentation.


The project documentation adheres to a specific structure under the docs directory:

|   |-- SECTION1/
|   |-- SECTION1/
|   |-- SECTION1/
    |-- SECTION2/
    |-- SECTION2/
  • The docs directory represents the root section

  • The file layout is based on sections, with each section getting its own directory.

  • Do not modify the top-level sections unless you have cleared it with the project leadership. These are: Getting Started, Concepts, Tutorials, and Reference.

  • Every section should have a that summarizes the contents of the section. It does not matter if the section has a single topic in it, if there's a section, then it must have a Besides good organization, there is another reason this is important that will be reviewed later.

  • The documentation will not appear unless added to the nav section in the project's mkdocs.yml file, ex.:

    - Home:
    - Getting Started:
      - start/
      - Quickstart: start/
      - Talk to Us: start/
      - Contribute:
        - start/contrib/
        - Suggest a Change: start/contrib/
        - Report an Issue: start/contrib/
        - Submit a Change: start/contrib/
      - About:
        - start/about/
        - Roadmap: start/about/
        - Release Notes: start/about/
        - License: start/about/
    - Concepts:
      - concepts/
      - Workloads:
        - concepts/workloads/
        - VirtualMachine: concepts/workloads/
        - VirtualMachineClass: concepts/workloads/
        - WebConsoleRequest: concepts/workloads/
        - Guest Customization: concepts/workloads/
      - Images:
        - concepts/images/
        - VirtualMachineImage: concepts/images/
        - Publish a VM Image: concepts/images/
      - Services & Networking:
        - concepts/services-networking/
        - VirtualMachineService: concepts/services-networking/
        - Guest Network Config: concepts/services-networking/
    - Tutorials:
      - tutorials/
      - Deploy VM:
        - tutorials/deploy-vm/
        - With Cloud-Init: tutorials/deploy-vm/
        - With vAppConfig: tutorials/deploy-vm/
      - Troubleshooting:
        - tutorials/troubleshooting/
        - Get a Console Session: tutorials/troubleshooting/
    - Reference:
      - ref/
      - API:
        - ref/api/
        - v1alpha1: ref/api/
      - Configuration:
        - ref/config/
        - Manager Pod: ref/config/
      - Project:
        - ref/proj/
        - Build from Source: ref/proj/
        - Create a Release: ref/proj/
        - Writing Documentation: ref/proj/


The guidelines for writing project documentation are as follows:

Preview Changes

Once documentation is written, it is important to see how it looks in order to review it. There are a few ways to preview the VM Operator project documentation:

Preview with Pull Request

First, and perhaps the simplest way to preview documentation is by opening a pull request. If any changes are detected under the ./docs folder, a link is automatically added at the bottom of a pull request's description that points to a temporary, public URL that hosts the documentation from the pull request. For example, at the bottom of the description of pull request that added this section, vmware-tanzu/vm-operator/pull#190, the following was added automatically:

📚 Documentation preview 📚:

This option makes it trivial for pull request reviewers to verify doc updates. Additionally, because the process used to build documentation for a pull request is the same as the one for main, this option is a great way to assert that changes to files such as mkdocs.yml or .readthedocs.yaml, have not broken the ability to build the documentation.

Preview Locally

Understandably, some people would like to preview changes prior to opening a pull request. There are two ways to build and preview the documentation locally:

  • With Python3

    make docs-serve-python
  • With Docker

    make docs-server-docker

Both of the above options have their strengths and weaknesses. Using Python3 is faster, but adds the complexity of knowing how to debug issues with a local Python3 installation if any should arise. The Docker option is more portable, but only if Docker is already installed. After choosing a command and running it:

Docker and

If the Docker option is selected to preview the documentation locally, the last line of the output will be Serving on However, the site is still accessed via So what gives with the

The IP address instructs the web server to bind the port over which the content is accessed to all, available IP addresses. Normally mkdocs just binds the web server port to, but if that was used inside of the container, the web server would not be accessible via the web browser on the system where Docker is running.