collab/mermaid/docs/syntax/kanban.mdblame
View source
6dd74de1> **Warning**
6dd74de2>
6dd74de3> ## THIS IS AN AUTOGENERATED FILE. DO NOT EDIT.
6dd74de4>
6dd74de5> ## Please edit the corresponding file in [/packages/mermaid/src/docs/syntax/kanban.md](../../packages/mermaid/src/docs/syntax/kanban.md).
6dd74de6
6dd74de7# Mermaid Kanban Diagram Documentation
6dd74de8
6dd74de9Mermaid’s Kanban diagram allows you to create visual representations of tasks moving through different stages of a workflow. This guide explains how to use the Kanban diagram syntax, based on the provided example.
6dd74de10
6dd74de11## Overview
6dd74de12
6dd74de13A Kanban diagram in Mermaid starts with the kanban keyword, followed by the definition of columns (stages) and tasks within those columns.
6dd74de14
6dd74de15```mermaid-example
6dd74de16kanban
6dd74de17 column1[Column Title]
6dd74de18 task1[Task Description]
6dd74de19```
6dd74de20
6dd74de21```mermaid
6dd74de22kanban
6dd74de23 column1[Column Title]
6dd74de24 task1[Task Description]
6dd74de25```
6dd74de26
6dd74de27## Defining Columns
6dd74de28
6dd74de29Columns represent the different stages in your workflow, such as “Todo,” “In Progress,” “Done,” etc. Each column is defined using a unique identifier and a title enclosed in square brackets.
6dd74de30
6dd74de31**Syntax:**
6dd74de32
6dd74de33```
6dd74de34columnId[Column Title]
6dd74de35```
6dd74de36
6dd74de37- columnId: A unique identifier for the column.
6dd74de38- \[Column Title]: The title displayed on the column header.
6dd74de39
6dd74de40Like this `id1[Todo]`
6dd74de41
6dd74de42## Adding Tasks to Columns
6dd74de43
6dd74de44Tasks are listed under their respective columns with an indentation. Each task also has a unique identifier and a description enclosed in square brackets.
6dd74de45
6dd74de46**Syntax:**
6dd74de47
6dd74de48```
6dd74de49taskId[Task Description]
6dd74de50```
6dd74de51
6dd74de52```
6dd74de53• taskId: A unique identifier for the task.
6dd74de54• [Task Description]: The description of the task.
6dd74de55```
6dd74de56
6dd74de57**Example:**
6dd74de58
6dd74de59```
6dd74de60docs[Create Documentation]
6dd74de61```
6dd74de62
6dd74de63## Adding Metadata to Tasks
6dd74de64
6dd74de65You can include additional metadata for each task using the @{ ... } syntax. Metadata can contain key-value pairs like assigned, ticket, priority, etc. This will be rendered added to the rendering of the node.
6dd74de66
6dd74de67## Supported Metadata Keys
6dd74de68
6dd74de69```
6dd74de70• assigned: Specifies who is responsible for the task.
6dd74de71• ticket: Links the task to a ticket or issue number.
6dd74de72• priority: Indicates the urgency of the task. Allowed values: 'Very High', 'High', 'Low' and 'Very Low'
6dd74de73```
6dd74de74
6dd74de75```mermaid-example
6dd74de76kanban
6dd74de77todo[Todo]
6dd74de78 id3[Update Database Function]@{ ticket: MC-2037, assigned: 'knsv', priority: 'High' }
6dd74de79```
6dd74de80
6dd74de81```mermaid
6dd74de82kanban
6dd74de83todo[Todo]
6dd74de84 id3[Update Database Function]@{ ticket: MC-2037, assigned: 'knsv', priority: 'High' }
6dd74de85```
6dd74de86
6dd74de87## Configuration Options
6dd74de88
6dd74de89You can customize the Kanban diagram using a configuration block at the beginning of your markdown file. This is useful for setting global settings like a base URL for tickets. Currently there is one configuration option for kanban diagrams `ticketBaseUrl`. This can be set as in the following example:
6dd74de90
6dd74de91```yaml
6dd74de92---
6dd74de93config:
6dd74de94 kanban:
6dd74de95 ticketBaseUrl: 'https://yourproject.atlassian.net/browse/#TICKET#'
6dd74de96---
6dd74de97```
6dd74de98
6dd74de99When the kanban item has an assigned ticket number the ticket number in the diagram will have a link to an external system where the ticket is defined. The `ticketBaseUrl` sets the base URL to the external system and #TICKET# is replaced with the ticket value from task metadata to create a valid link.
6dd74de100
6dd74de101## Full Example
6dd74de102
6dd74de103Below is the full Kanban diagram based on the provided example:
6dd74de104
6dd74de105```mermaid-example
6dd74de106---
6dd74de107config:
6dd74de108 kanban:
6dd74de109 ticketBaseUrl: 'https://mermaidchart.atlassian.net/browse/#TICKET#'
6dd74de110---
6dd74de111kanban
6dd74de112 Todo
6dd74de113 [Create Documentation]
6dd74de114 docs[Create Blog about the new diagram]
6dd74de115 [In progress]
6dd74de116 id6[Create renderer so that it works in all cases. We also add some extra text here for testing purposes. And some more just for the extra flare.]
6dd74de117 id9[Ready for deploy]
6dd74de118 id8[Design grammar]@{ assigned: 'knsv' }
6dd74de119 id10[Ready for test]
6dd74de120 id4[Create parsing tests]@{ ticket: MC-2038, assigned: 'K.Sveidqvist', priority: 'High' }
6dd74de121 id66[last item]@{ priority: 'Very Low', assigned: 'knsv' }
6dd74de122 id11[Done]
6dd74de123 id5[define getData]
6dd74de124 id2[Title of diagram is more than 100 chars when user duplicates diagram with 100 char]@{ ticket: MC-2036, priority: 'Very High'}
6dd74de125 id3[Update DB function]@{ ticket: MC-2037, assigned: knsv, priority: 'High' }
6dd74de126
6dd74de127 id12[Can't reproduce]
6dd74de128 id3[Weird flickering in Firefox]
6dd74de129```
6dd74de130
6dd74de131```mermaid
6dd74de132---
6dd74de133config:
6dd74de134 kanban:
6dd74de135 ticketBaseUrl: 'https://mermaidchart.atlassian.net/browse/#TICKET#'
6dd74de136---
6dd74de137kanban
6dd74de138 Todo
6dd74de139 [Create Documentation]
6dd74de140 docs[Create Blog about the new diagram]
6dd74de141 [In progress]
6dd74de142 id6[Create renderer so that it works in all cases. We also add some extra text here for testing purposes. And some more just for the extra flare.]
6dd74de143 id9[Ready for deploy]
6dd74de144 id8[Design grammar]@{ assigned: 'knsv' }
6dd74de145 id10[Ready for test]
6dd74de146 id4[Create parsing tests]@{ ticket: MC-2038, assigned: 'K.Sveidqvist', priority: 'High' }
6dd74de147 id66[last item]@{ priority: 'Very Low', assigned: 'knsv' }
6dd74de148 id11[Done]
6dd74de149 id5[define getData]
6dd74de150 id2[Title of diagram is more than 100 chars when user duplicates diagram with 100 char]@{ ticket: MC-2036, priority: 'Very High'}
6dd74de151 id3[Update DB function]@{ ticket: MC-2037, assigned: knsv, priority: 'High' }
6dd74de152
6dd74de153 id12[Can't reproduce]
6dd74de154 id3[Weird flickering in Firefox]
6dd74de155```
6dd74de156
6dd74de157In conclusion, creating a Kanban diagram in Mermaid is a straightforward process that effectively visualizes your workflow. Start by using the kanban keyword to initiate the diagram. Define your columns with unique identifiers and titles to represent different stages of your project. Under each column, list your tasks—also with unique identifiers—and provide detailed descriptions as needed. Remember that proper indentation is crucial; tasks must be indented under their parent columns to maintain the correct structure.
6dd74de158
6dd74de159You can enhance your diagram by adding optional metadata to tasks using the @{ ... } syntax, which allows you to include additional context such as assignee, ticket numbers, and priority levels. For further customization, utilize the configuration block at the top of your file to set global options like ticketBaseUrl for linking tickets directly from your diagram.
6dd74de160
6dd74de161By adhering to these guidelines—ensuring unique identifiers, proper indentation, and utilizing metadata and configuration options—you can create a comprehensive and customized Kanban board that effectively maps out your project’s workflow using Mermaid.