主题
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.
语法:
¥Syntax:
columnId[Column Title]
columnId:列的唯一标识符。
¥columnId: A unique identifier for the column.
[列标题]:列标题上显示的标题。
¥[Column Title]: The title displayed on the column header.
像这样 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.
语法:
¥Syntax:
taskId[Task Description]
• taskId: A unique identifier for the task.
• [Task Description]: The description of the task.
示例:
¥Example:
docs[Create Documentation]
向任务添加元数据
¥Adding Metadata to Tasks
你可以使用 @{ ... } 语法为每个任务包含其他元数据。元数据可以包含键值对,如分配、票证、优先级等。这将被添加到节点的渲染中。
¥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
• assigned: Specifies who is responsible for the task.
• ticket: Links the task to a ticket or issue number.
• priority: Indicates the urgency of the task. Allowed values: 'Very High', 'High', 'Low' and 'Very Low'
配置选项
¥Configuration Options
你可以使用 markdown 文件开头的配置块自定义看板图。这对于设置全局设置(如票证的基本 URL)很有用。目前,看板图 tacketBaseUrl 有一个配置选项。这可以按照以下示例进行设置:
¥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 tacketBaseUrl. This can be set as in the 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.