主题
Mermaid 看板图文档
🌐 Mermaid Kanban Diagram Documentation
Mermaid 的看板图允许你创建任务在工作流程不同阶段流转的可视化表示。此指南解释了如何使用看板图语法,基于提供的示例。
🌐 Mermaid’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.
概览
🌐 Overview
Mermaid 中的看板图以 kanban 关键字开头,然后定义列(阶段)以及这些列中的任务。
🌐 A Kanban diagram in Mermaid starts with the kanban keyword, followed by the definition of columns (stages) and tasks within those columns.
定义列
🌐 Defining Columns
列表示工作流程中的不同阶段,例如“待办”、“进行中”、“已完成”等。每一列都使用唯一标识符和方括号中的标题来定义。
🌐 Columns 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.
语法:
columnId[Column Title]- columnId:列的唯一标识符。
- [列标题]:显示在列头的标题。
像这样 id1[Todo]
🌐 Like this id1[Todo]
向列中添加任务
🌐 Adding Tasks to Columns
任务按各自的列列出,并带有缩进。每个任务还有一个唯一标识符和用方括号括起来的描述。
🌐 Tasks are listed under their respective columns with an indentation. Each task also has a unique identifier and a description enclosed in square brackets.
语法:
taskId[Task Description]• taskId:任务的唯一标识符。• [任务描述]:任务的描述。
示例:
docs[Create Documentation]向任务添加元数据
🌐 Adding Metadata to Tasks
你可以使用 @{ ... } 语法为每个任务添加额外的元数据。元数据可以包含诸如 assigned、ticket、priority 等键值对。这将在节点的渲染中显示出来。
🌐 You 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.
支持的元数据键
🌐 Supported Metadata Keys
• 分配给:指定谁负责该任务。• 工单:将任务链接到工单或问题编号。 • 优先级:表示任务的紧急程度。允许的值:'非常高','高','低' 和 '非常低'
配置选项
🌐 Configuration Options
你可以在 Markdown 文件开头使用配置块自定义看板图表。这对于设置全局设置非常有用,例如工单的基础 URL。目前看板图表有一个配置选项 ticketBaseUrl。可以按以下示例进行设置:
🌐 You 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:
yaml
---
config:
kanban:
ticketBaseUrl: 'https://yourproject.atlassian.net/browse/#TICKET#'
---当看板条目有指定的工单号码时,图中的工单号码将包含一个指向定义该工单的外部系统的链接。ticketBaseUrl 设置指向外部系统的基础 URL,而 #TICKET# 会被任务元数据中的工单值替换,以创建有效的链接。
🌐 When 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.
完整示例
🌐 Full Example
下面是基于所提供示例的完整看板图:
🌐 Below is the full Kanban diagram based on the provided example:
总之,在 Mermaid 中创建看板图是一个简单的过程,能够有效地可视化你的工作流程。首先使用 kanban 关键字来启动图表。用唯一标识符和标题定义列,以表示项目的不同阶段。在每一列下列出你的任务 - 也要有唯一标识符 - 并根据需要提供详细描述。请记住,正确的缩进非常重要;任务必须缩进到它们所属的父列下,以保持正确的结构。
🌐 In 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.
你可以通过使用 @{ ... } 语法向任务添加可选元数据,从而增强你的图表,该语法允许你包含额外的上下文信息,如负责人、工单编号和优先级。对于进一步的自定义,请使用文件顶部的配置块来设置全局选项,例如 ticketBaseUrl,以便直接从图表中链接工单。
🌐 You 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.
通过遵循这些指南 - 确保唯一标识符、正确缩进,并利用元数据和配置选项 - 你可以创建一个全面且定制化的看板,使用 Mermaid 有效地映射项目的工作流程。
🌐 By 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.