Documentation Generation

Setting Up MkDocs

< >

2. Configuring MkDocs

The mkdocs.yml file is the configuration file for your MkDocs project. This file defines the structure, theme, and other settings for your documentation site.

Practical Exercise

  1. Modify the mkdocs.yml File:

    • Open the mkdocs.yml file in a text editor and make changes such as:
      • Setting the site name:
        site_name: My Project Documentation
        
      • Adding a theme, for example:
        theme:
          name: material
        
      • Adding pages to the documentation structure:
        nav:
          - Home: index.md
          - About: about.md
        
  2. Create Additional Markdown Files:

    • Create a new file in the docs/ directory named about.md and add some content:
      # About This Project
      
      This project is aimed at demonstrating how to use MkDocs with GitLab CI/CD.
      
  3. Build the Documentation:

    • Once you’ve modified the configuration and added new content, run the following command to build the static site:
      mkdocs build