@@ -375,68 +375,6 @@ func CreateRelationshipsMetadata(model ModelCSV, relationships []RelationshipCSV
375375
376376}
377377
378- // CreateRelationshipsMetadataAndCreateSVGsForMDXStyle creates relationship metadata and writes SVGs for MDX style docs
379- func CreateRelationshipsMetadataAndCreateSVGsForMDXStyle (model ModelCSV , relationships []RelationshipCSV , path , svgDir string ) (string , error ) {
380- err := os .MkdirAll (filepath .Join (path , svgDir ), 0777 )
381- if err != nil {
382- return "" , err
383- }
384- relationshipMetadata := `[`
385- for idx , relnship := range relationships {
386- relationshipTemplate := `
387- {
388- "type": "%s",
389- "kind": "%s",
390- "colorIcon": "%s",
391- "whiteIcon": "%s",
392- "description": "%s"
393- }`
394-
395- // add comma if not last relationship
396- if idx != len (relationships )- 1 {
397- relationshipTemplate += ","
398- }
399-
400- relnshipName := utils .FormatName (manifests .FormatToReadableString (fmt .Sprintf ("%s-%s" , relnship .KIND , relnship .SubType )))
401- colorIconDir := filepath .Join (svgDir , relnshipName , "icons" , "color" )
402- whiteIconDir := filepath .Join (svgDir , relnshipName , "icons" , "white" )
403-
404- relationshipMetadata += fmt .Sprintf (relationshipTemplate , relnship .Type , relnship .KIND , fmt .Sprintf ("%s/%s-color.svg" , colorIconDir , relnshipName ), fmt .Sprintf ("%s/%s-white.svg" , whiteIconDir , relnshipName ), relnship .Description )
405-
406- // Get SVGs for relationship
407- colorSVG , whiteSVG := getSVGForRelationship (model , relnship )
408-
409- // Only create directories and write SVGs if they exist
410- if colorSVG != "" {
411- // create color svg dir
412- err = os .MkdirAll (filepath .Join (path , colorIconDir ), 0777 )
413- if err != nil {
414- return "" , err
415- }
416- err = utils .WriteToFile (filepath .Join (path , colorIconDir , relnshipName + "-color.svg" ), colorSVG )
417- if err != nil {
418- return "" , err
419- }
420- }
421-
422- if whiteSVG != "" {
423- // create white svg dir
424- err = os .MkdirAll (filepath .Join (path , whiteIconDir ), 0777 )
425- if err != nil {
426- return "" , err
427- }
428- err = utils .WriteToFile (filepath .Join (path , whiteIconDir , relnshipName + "-white.svg" ), whiteSVG )
429- if err != nil {
430- return "" , err
431- }
432- }
433- }
434-
435- relationshipMetadata += `]`
436-
437- return relationshipMetadata , nil
438- }
439-
440378// CreateRelationshipsMetadataAndCreateSVGsForMDStyle creates relationship metadata and writes SVGs for MD style docs
441379func CreateRelationshipsMetadataAndCreateSVGsForMDStyle (model ModelCSV , relationships []RelationshipCSV , path , svgDir string ) (string , error ) {
442380 err := os .MkdirAll (filepath .Join (path ), 0777 )
0 commit comments