From 625b90067a5d7759a7325989f0f61f24347f7f78 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mikl=C3=B3s=20T=C3=B3th?= <tothmiklostibor@gmail.com> Date: Mon, 1 Mar 2021 13:15:18 +0100 Subject: [PATCH] skipdep --- plab/classdiag.go | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/plab/classdiag.go b/plab/classdiag.go index c1f6003..67de95c 100644 --- a/plab/classdiag.go +++ b/plab/classdiag.go @@ -54,6 +54,8 @@ func genPlantUMLStr(classes map[string]*Class) { output.WriteString(fmt.Sprintln("skinparam classAttributeIconSize 0")) output.WriteString(fmt.Sprintln("set namespaceSeparator none")) + skipDep := make(map[string][]string) + for _, c := range classes { after := "" if c.Superclass.realClass != nil { @@ -117,10 +119,18 @@ func genPlantUMLStr(classes map[string]*Class) { for _, a := range c.Annotations { if a.TypeName == "Docs" { for _, e := range a.Elements { + e.Value = unescape(e.Value) switch e.QualifiedName { case "projlab.Docs.uml": - e.Value = unescape(e.Value) output.WriteString(fmt.Sprintln(e.Value)) + case "projlab.Docs.skipdep": + prevDep := skipDep[c.Name] + parts := strings.Split(e.Value, ",") + for _, p := range parts { + p = strings.TrimSpace(p) + prevDep = append(prevDep, p) + } + skipDep[c.Name] = prevDep } } } @@ -144,6 +154,9 @@ func genPlantUMLStr(classes map[string]*Class) { for _, c := range classes { deps := make([]string, 0) + for _, d := range skipDep[c.Name] { + skip[d] = append(skip[d], c.Name) + } hasdep := func(dep string) bool { for _, d := range deps { if d == dep { -- GitLab