Skip to content

Commit 2a482e3

Browse files
authored
Merge pull request #91 from nao1215/feature/mermaid-kanban
feat: kanban
2 parents 97ab731 + b7f286e commit 2a482e3

File tree

13 files changed

+1505
-7
lines changed

13 files changed

+1505
-7
lines changed

README.md

Lines changed: 79 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
# What is markdown package
1313
The Package markdown is a simple markdown builder in golang. The markdown package assembles Markdown using method chaining, not uses a template engine like [html/template](https://pkg.go.dev/html/template). The syntax of Markdown follows **GitHub Markdown**.
1414

15-
The markdown package was initially developed to save test results in [nao1215/spectest](https://github.com/nao1215/spectest). Therefore, the markdown package implements the features required by spectest. For example, the markdown package supports **mermaid diagrams (entity relationship diagram, sequence diagram, user journey diagram, git graph diagram, mindmap diagram, requirement diagram, xy chart, packet diagram, block diagram, flowchart, pie chart, quadrant chart, state diagram, class diagram, Gantt chart, architecture diagram)**, which was a necessary feature in spectest.
15+
The markdown package was initially developed to save test results in [nao1215/spectest](https://github.com/nao1215/spectest). Therefore, the markdown package implements the features required by spectest. For example, the markdown package supports **mermaid diagrams (entity relationship diagram, sequence diagram, user journey diagram, git graph diagram, mindmap diagram, requirement diagram, xy chart, packet diagram, block diagram, kanban diagram, flowchart, pie chart, quadrant chart, state diagram, class diagram, Gantt chart, architecture diagram)**, which was a necessary feature in spectest.
1616

1717
Additionally, complex code that increases the complexity of the library, such as generating nested lists, will not be added. I want to keep this library as simple as possible.
1818

@@ -46,6 +46,7 @@ Additionally, complex code that increases the complexity of the library, such as
4646
- [x] mermaid xy chart
4747
- [x] mermaid packet diagram
4848
- [x] mermaid block diagram
49+
- [x] mermaid kanban diagram
4950
- [x] mermaid entity relationship diagram
5051
- [x] mermaid flowchart
5152
- [x] mermaid pie chart
@@ -894,6 +895,83 @@ block
894895
Backend -- "reads from" --> Cache
895896
```
896897

898+
### Mermaid kanban syntax
899+
900+
```go
901+
package main
902+
903+
import (
904+
"io"
905+
"os"
906+
907+
"github.com/nao1215/markdown"
908+
"github.com/nao1215/markdown/mermaid/kanban"
909+
)
910+
911+
//go:generate go run main.go
912+
913+
func main() {
914+
diagram := kanban.NewDiagram(
915+
io.Discard,
916+
kanban.WithTitle("Sprint Board"),
917+
kanban.WithTicketBaseURL("https://example.com/tickets/"),
918+
).
919+
Column("Todo").
920+
Task("Define scope").
921+
Task(
922+
"Create login page",
923+
kanban.WithTaskTicket("MB-101"),
924+
kanban.WithTaskAssigned("Alice"),
925+
kanban.WithTaskPriority(kanban.PriorityHigh),
926+
).
927+
Column("In Progress").
928+
Task("Review API", kanban.WithTaskPriority(kanban.PriorityVeryHigh)).
929+
String()
930+
931+
if err := markdown.NewMarkdown(os.Stdout).
932+
H2("Kanban Diagram").
933+
CodeBlocks(markdown.SyntaxHighlightMermaid, diagram).
934+
Build(); err != nil {
935+
panic(err)
936+
}
937+
}
938+
```
939+
940+
Plain text output: [markdown is here](./doc/kanban/generated.md)
941+
````text
942+
## Kanban Diagram
943+
```mermaid
944+
---
945+
title: Sprint Board
946+
config:
947+
kanban:
948+
ticketBaseUrl: 'https://example.com/tickets/'
949+
---
950+
kanban
951+
[Todo]
952+
[Define scope]
953+
[Create login page]@{ ticket: 'MB-101', assigned: 'Alice', priority: 'High' }
954+
[In Progress]
955+
[Review API]@{ priority: 'Very High' }
956+
```
957+
````
958+
959+
Mermaid output:
960+
```mermaid
961+
---
962+
title: Sprint Board
963+
config:
964+
kanban:
965+
ticketBaseUrl: 'https://example.com/tickets/'
966+
---
967+
kanban
968+
[Todo]
969+
[Define scope]
970+
[Create login page]@{ ticket: 'MB-101', assigned: 'Alice', priority: 'High' }
971+
[In Progress]
972+
[Review API]@{ priority: 'Very High' }
973+
```
974+
897975
### Entity Relationship Diagram syntax
898976

899977
```go

doc/es/README.md

Lines changed: 79 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
# ¿Qué es el paquete markdown?
1313
El paquete markdown es un constructor de markdown simple en Golang. El paquete markdown ensambla Markdown usando encadenamiento de métodos, no utiliza un motor de plantillas como [html/template](https://pkg.go.dev/html/template). La sintaxis de Markdown sigue **GitHub Markdown**.
1414

15-
El paquete markdown fue inicialmente desarrollado para guardar resultados de pruebas en [nao1215/spectest](https://github.com/nao1215/spectest). Por lo tanto, el paquete markdown implementa las características requeridas por spectest. Por ejemplo, el paquete markdown soporta **diagramas de secuencia mermaid (diagrama de relación de entidad, diagrama de secuencia, diagrama de recorrido del usuario, diagrama git graph, diagrama de mapa mental, diagrama de requisitos, gráfico XY, diagrama Packet, diagrama Block, diagrama de flujo, gráfico circular, gráfico de cuadrantes, diagrama de estado, diagrama de clases, diagrama de Gantt, diagrama de arquitectura)**, que era una característica necesaria en spectest.
15+
El paquete markdown fue inicialmente desarrollado para guardar resultados de pruebas en [nao1215/spectest](https://github.com/nao1215/spectest). Por lo tanto, el paquete markdown implementa las características requeridas por spectest. Por ejemplo, el paquete markdown soporta **diagramas de secuencia mermaid (diagrama de relación de entidad, diagrama de secuencia, diagrama de recorrido del usuario, diagrama git graph, diagrama de mapa mental, diagrama de requisitos, gráfico XY, diagrama Packet, diagrama Block, diagrama Kanban, diagrama de flujo, gráfico circular, gráfico de cuadrantes, diagrama de estado, diagrama de clases, diagrama de Gantt, diagrama de arquitectura)**, que era una característica necesaria en spectest.
1616

1717
Además, no se añadirá código complejo que aumente la complejidad de la biblioteca, como generar listas anidadas. Quiero mantener esta biblioteca lo más simple posible.
1818

@@ -43,6 +43,7 @@ Además, no se añadirá código complejo que aumente la complejidad de la bibli
4343
- [x] gráfico XY mermaid
4444
- [x] diagrama Packet mermaid
4545
- [x] diagrama Block mermaid
46+
- [x] diagrama Kanban mermaid
4647
- [x] diagrama de relación de entidad mermaid
4748
- [x] diagrama de flujo mermaid
4849
- [x] gráfico circular mermaid
@@ -891,6 +892,83 @@ block
891892
Backend -- "reads from" --> Cache
892893
```
893894

895+
### Sintaxis del diagrama Kanban de Mermaid
896+
897+
```go
898+
package main
899+
900+
import (
901+
"io"
902+
"os"
903+
904+
"github.com/nao1215/markdown"
905+
"github.com/nao1215/markdown/mermaid/kanban"
906+
)
907+
908+
//go:generate go run main.go
909+
910+
func main() {
911+
diagram := kanban.NewDiagram(
912+
io.Discard,
913+
kanban.WithTitle("Sprint Board"),
914+
kanban.WithTicketBaseURL("https://example.com/tickets/"),
915+
).
916+
Column("Todo").
917+
Task("Define scope").
918+
Task(
919+
"Create login page",
920+
kanban.WithTaskTicket("MB-101"),
921+
kanban.WithTaskAssigned("Alice"),
922+
kanban.WithTaskPriority(kanban.PriorityHigh),
923+
).
924+
Column("In Progress").
925+
Task("Review API", kanban.WithTaskPriority(kanban.PriorityVeryHigh)).
926+
String()
927+
928+
if err := markdown.NewMarkdown(os.Stdout).
929+
H2("Kanban Diagram").
930+
CodeBlocks(markdown.SyntaxHighlightMermaid, diagram).
931+
Build(); err != nil {
932+
panic(err)
933+
}
934+
}
935+
```
936+
937+
Salida de texto plano: [markdown está aquí](../kanban/generated.md)
938+
````text
939+
## Kanban Diagram
940+
```mermaid
941+
---
942+
title: Sprint Board
943+
config:
944+
kanban:
945+
ticketBaseUrl: 'https://example.com/tickets/'
946+
---
947+
kanban
948+
[Todo]
949+
[Define scope]
950+
[Create login page]@{ ticket: 'MB-101', assigned: 'Alice', priority: 'High' }
951+
[In Progress]
952+
[Review API]@{ priority: 'Very High' }
953+
```
954+
````
955+
956+
Salida Mermaid:
957+
```mermaid
958+
---
959+
title: Sprint Board
960+
config:
961+
kanban:
962+
ticketBaseUrl: 'https://example.com/tickets/'
963+
---
964+
kanban
965+
[Todo]
966+
[Define scope]
967+
[Create login page]@{ ticket: 'MB-101', assigned: 'Alice', priority: 'High' }
968+
[In Progress]
969+
[Review API]@{ priority: 'Very High' }
970+
```
971+
894972
### Sintaxis del diagrama de relación de entidad
895973

896974
```go

doc/fr/README.md

Lines changed: 79 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
# Qu'est-ce que le package markdown
1313
Le package markdown est un constructeur de markdown simple en Golang. Le package markdown assemble le Markdown en utilisant le chaînage de méthodes, n'utilise pas un moteur de modèles comme [html/template](https://pkg.go.dev/html/template). La syntaxe de Markdown suit **GitHub Markdown**.
1414

15-
Le package markdown a été initialement développé pour sauvegarder les résultats de tests dans [nao1215/spectest](https://github.com/nao1215/spectest). Par conséquent, le package markdown implémente les fonctionnalités requises par spectest. Par exemple, le package markdown prend en charge **les diagrammes de séquence mermaid (diagramme de relation d'entité, diagramme de séquence, diagramme de parcours utilisateur, diagramme git graph, diagramme de carte mentale, diagramme d'exigences, graphique XY, diagramme Packet, diagramme Block, organigramme, graphique en secteurs, graphique à quadrants, diagramme d'état, diagramme de classes, diagramme de Gantt, diagramme d'architecture)**, ce qui était une fonctionnalité nécessaire dans spectest.
15+
Le package markdown a été initialement développé pour sauvegarder les résultats de tests dans [nao1215/spectest](https://github.com/nao1215/spectest). Par conséquent, le package markdown implémente les fonctionnalités requises par spectest. Par exemple, le package markdown prend en charge **les diagrammes de séquence mermaid (diagramme de relation d'entité, diagramme de séquence, diagramme de parcours utilisateur, diagramme git graph, diagramme de carte mentale, diagramme d'exigences, graphique XY, diagramme Packet, diagramme Block, diagramme Kanban, organigramme, graphique en secteurs, graphique à quadrants, diagramme d'état, diagramme de classes, diagramme de Gantt, diagramme d'architecture)**, ce qui était une fonctionnalité nécessaire dans spectest.
1616

1717
De plus, le code complexe qui augmente la complexité de la bibliothèque, tel que la génération de listes imbriquées, ne sera pas ajouté. Je veux garder cette bibliothèque aussi simple que possible.
1818

@@ -43,6 +43,7 @@ De plus, le code complexe qui augmente la complexité de la bibliothèque, tel q
4343
- [x] graphique XY mermaid
4444
- [x] diagramme Packet mermaid
4545
- [x] diagramme Block mermaid
46+
- [x] diagramme Kanban mermaid
4647
- [x] diagramme de relation d'entité mermaid
4748
- [x] organigramme mermaid
4849
- [x] graphique en secteurs mermaid
@@ -891,6 +892,83 @@ block
891892
Backend -- "reads from" --> Cache
892893
```
893894

895+
### Syntaxe du diagramme Kanban Mermaid
896+
897+
```go
898+
package main
899+
900+
import (
901+
"io"
902+
"os"
903+
904+
"github.com/nao1215/markdown"
905+
"github.com/nao1215/markdown/mermaid/kanban"
906+
)
907+
908+
//go:generate go run main.go
909+
910+
func main() {
911+
diagram := kanban.NewDiagram(
912+
io.Discard,
913+
kanban.WithTitle("Sprint Board"),
914+
kanban.WithTicketBaseURL("https://example.com/tickets/"),
915+
).
916+
Column("Todo").
917+
Task("Define scope").
918+
Task(
919+
"Create login page",
920+
kanban.WithTaskTicket("MB-101"),
921+
kanban.WithTaskAssigned("Alice"),
922+
kanban.WithTaskPriority(kanban.PriorityHigh),
923+
).
924+
Column("In Progress").
925+
Task("Review API", kanban.WithTaskPriority(kanban.PriorityVeryHigh)).
926+
String()
927+
928+
if err := markdown.NewMarkdown(os.Stdout).
929+
H2("Kanban Diagram").
930+
CodeBlocks(markdown.SyntaxHighlightMermaid, diagram).
931+
Build(); err != nil {
932+
panic(err)
933+
}
934+
}
935+
```
936+
937+
Sortie de texte brut : [markdown est ici](../kanban/generated.md)
938+
````text
939+
## Kanban Diagram
940+
```mermaid
941+
---
942+
title: Sprint Board
943+
config:
944+
kanban:
945+
ticketBaseUrl: 'https://example.com/tickets/'
946+
---
947+
kanban
948+
[Todo]
949+
[Define scope]
950+
[Create login page]@{ ticket: 'MB-101', assigned: 'Alice', priority: 'High' }
951+
[In Progress]
952+
[Review API]@{ priority: 'Very High' }
953+
```
954+
````
955+
956+
Sortie Mermaid :
957+
```mermaid
958+
---
959+
title: Sprint Board
960+
config:
961+
kanban:
962+
ticketBaseUrl: 'https://example.com/tickets/'
963+
---
964+
kanban
965+
[Todo]
966+
[Define scope]
967+
[Create login page]@{ ticket: 'MB-101', assigned: 'Alice', priority: 'High' }
968+
[In Progress]
969+
[Review API]@{ priority: 'Very High' }
970+
```
971+
894972
### Syntaxe du diagramme de relation d'entité
895973

896974
```go

0 commit comments

Comments
 (0)