feat(arch): implemented node labels

This commit is contained in:
NicolasNewman
2024-05-06 09:59:33 -05:00
parent cabb7b65e9
commit 734bde3877
8 changed files with 64 additions and 11 deletions

View File

@@ -26,7 +26,7 @@ Group:
;
Service:
'service' id=ARCH_ID icon=ARCH_ICON? title=ARCH_TITLE? ('in' in=ARCH_ID)? EOL
'service' id=ARCH_ID (iconText=ARCH_TEXT_ICON | icon=ARCH_ICON)? title=ARCH_TITLE? ('in' in=ARCH_ID)? EOL
;
Edge:
@@ -35,6 +35,7 @@ Edge:
terminal ARROW_DIRECTION: 'L' | 'R' | 'T' | 'B';
terminal ARCH_ID: /[\w]+/;
terminal ARCH_TEXT_ICON: /\("[^"]+"\)/;
terminal ARCH_ICON: /\([\w]+\)/;
terminal ARCH_TITLE: /\[[\w ]+\]/;
terminal ARROW_INTO: /\(|\)/;

View File

@@ -11,6 +11,8 @@ export class ArchitectureValueConverter extends AbstractMermaidValueConverter {
): ValueType | undefined {
if (rule.name === 'ARCH_ICON') {
return input.replace(/[()]/g, '').trim();
} else if (rule.name === 'ARCH_TEXT_ICON') {
return input.replace(/[()"]/g, '');
} else if (rule.name === 'ARCH_TITLE') {
return input.replace(/[[\]]/g, '').trim();
}