Documenting Projects with Wikis, Markdown and Mermaid
This lesson compares wiki options, and shows how to write Markdown and Mermaid diagrams.
Learning outcomes
After completing this lesson, you will be able to:
- Distinguish project wikis from code wikis.
- Describe documentation options in GitHub.
- Write common Markdown syntax.
- Write a Mermaid diagram for each platform.
Wiki options in Azure DevOps
Azure DevOps offers two kinds of wiki, and the difference is a common exam point.
Project wiki
A project wiki is provisioned once for a project. Its pages are stored in a hidden Git repository, and people edit them in the web interface. It suits general team knowledge, such as onboarding guides and meeting notes, and people who do not use Git can contribute. A project has one project wiki.
Code wiki
A code wiki publishes a folder of Markdown files from an ordinary repository branch. A project can have several. Pages change through normal commits and pull requests, so documentation can be reviewed with the code that it describes, and a branch can be published for each version of a product. This suits technical and API documentation that must match a release.
The following comparison summarizes when to use each kind.
The following diagram compares a code wiki with a project wiki for installation steps that differ by product version.

Project wiki or code wiki?
Documentation in GitHub
Every GitHub repository can show Markdown files directly, and README.md appears on the repository's main page. Teams often keep a docs folder, which goes through pull requests like code. A repository can also have a wiki, which is a separate Git repository with its own history, and GitHub Pages publishes a static site from a branch or an Actions workflow. For public documentation, Pages combined with a static site generator is common.
Community health files, such as CONTRIBUTING.md and SECURITY.md, are another form of project documentation. They tell contributors how to work with a repository.
Where GitHub documentation lives
Markdown essentials
Markdown is a plain-text format. Both platforms support the common syntax, including headings, lists, links, images, tables and code blocks. The following example shows the most used elements.
# Deployment guide
## Prerequisites
- An Azure subscription
- **Contributor** access to the resource group
Run the following command:
```bash
az group create --name rg-app --location westeurope
```
| Environment | Region |
|-------------|---------------|
| Test | West Europe |
| Production | North Europe |
See the [runbook](./runbook.md) for details.Each platform also has its own extensions. Azure DevOps wikis offer [[_TOC_]] for a table of contents, #123 to link a work item and @ mentions. GitHub offers task lists with - [ ], automatic links to issues with #123, and alert blocks such as [!NOTE].
Which platform's Markdown extension?
Mermaid process diagrams
A diagram stored as an image soon falls out of date, since few people can edit the original, and a change cannot be reviewed line by line. Mermaid solves this by describing a diagram as text. It supports flowcharts, sequence diagrams, Gantt charts, class diagrams and more. Because the source is text, it lives in Git and appears clearly in a pull request.
The syntax for embedding it depends on the platform. An Azure DevOps wiki page uses a block fenced with three colons. GitHub uses a fenced code block with the language set to mermaid. The following example shows a release process in an Azure DevOps wiki.
::: mermaid
flowchart LR
A[Pull request] --> B{Checks pass?}
B -- Yes --> C[Merge to main]
B -- No --> A
C --> D[Deploy to test]
D --> E{Approved?}
E -- Yes --> F[Deploy to production]
:::The first line declares the diagram type and its direction, with LR meaning left to right and TD meaning top down. Square brackets draw a rectangle, curly braces draw a decision, and arrows connect the nodes, with optional labels. The same diagram in GitHub Markdown would be placed in a fenced block, as follows.
```mermaid
sequenceDiagram
participant Dev
participant Pipeline
participant Azure
Dev->>Pipeline: Push commit
Pipeline->>Azure: Deploy
Azure-->>Pipeline: Health check result
```Reading Mermaid syntax
Choosing where documentation lives
A team maintains two supported versions of a product in Azure Repos. Each version has different installation steps. Documentation changes must be approved by a technical lead, and readers must be able to see the correct steps for each version. What should you recommend?
A code wiki meets all three requirements. It can publish one branch per version, so readers see the correct steps. Because changes go through pull requests, a branch policy can require the technical lead's approval. A project wiki has a single current version and no pull request step, and a Word document in a shared folder cannot be reviewed alongside the code.
How does the Mermaid syntax differ between an Azure DevOps wiki and GitHub?
Show answer
An Azure DevOps wiki uses a ::: mermaid block, and GitHub uses a fenced code block with the language set to mermaid.
Exam Tips
Remember for the exam
- A project wiki is edited in the web interface; a code wiki is published from a repository.
- Use a code wiki when documentation needs pull request review or versions.
- Azure DevOps uses ::: mermaid blocks; GitHub uses a fenced mermaid block.
- Text-based diagrams can be reviewed and changed like code.
- [[_TOC_]] adds a table of contents to an Azure DevOps wiki page.