Edit the documentation

This documentation is created with Sphinx. Sphinx uses the reStructuredText (RST) markup format and adds some features like cross-referencing.

In this tutorial we will teach you how to edit the documentation locally on your PC. For that we will use Visual Studio Code with the reStructuredText extension, that will give you a (somewhat) live preview.

Hint

For small changes you can click the Edit on GitHub button in the top right corner. GitHub however will only render the files as plain RST and miss all features that Sphinx adds.

  1. Checkout the eCAL git repository:

    git clone https://github.com/continental/ecal.git
    
  2. Download and install Visual Studio Code on your PC (it is available for Windows, Linux and macOS).

    https://code.visualstudio.com/

  3. Download and install Python 3.5 or newer (Python 3.8 recommended) and make sure it is added to the PATH

  4. Navigate to the eCAL directory and install the python requirements with pip:

    Note

    Python virtual environments are not supported

    • Windows:

      pip install wheel
      pip install -r requirements.txt
      pip install sphinx-autobuild
      
    • Ubuntu:

      sudo pip3 install -r requirements.txt
      sudo pip3 install sphinx-autobuild
      
  5. Install the VS Code Extensions:

    • Python by Microsoft

    • reStructuredText by LeXStudio Inc.

      VS Code reStructuredText extension
  6. Open the doc/rst/ directory in VS Code. Open an .rst file of your choice and click the preview button in the upper right corner. If VS Code asks you how to create the preview, select Sphinx

    VS Code Preview button

After a short time you should have a beautiful preview of the documentation. The preview will be updated every time you save the .rst file.

VS Code Preview