resolve conflicts

This commit is contained in:
Vojtěch Fošnár 2023-01-30 12:22:14 +01:00
commit aa019a9329
No known key found for this signature in database
GPG key ID: 657727E71C40859A
17 changed files with 402 additions and 71 deletions

View file

@ -8,6 +8,8 @@
#### Improvements 🧹
- Code snippets use bold and italic font styles as determined by highlighter [#710](https://github.com/terrastruct/d2/issues/710), [#741](https://github.com/terrastruct/d2/issues/741)
#### Bugfixes ⛑️
- Fixes groups overlapping in sequence diagrams when they end in a self loop. [#728](https://github.com/terrastruct/d2/pull/728)

View file

@ -47,7 +47,8 @@ func styleAttr(styles map[chroma.TokenType]string, tt chroma.TokenType) string {
}
}
}
return styles[tt]
out := strings.Replace(styles[tt], `font-weight="bold"`, `class="text-mono-bold"`, -1)
return strings.Replace(out, `font-style="italic"`, `class="text-mono-italic"`, -1)
}
// <<< END

View file

@ -1300,6 +1300,82 @@ func embedFonts(buf *bytes.Buffer, fontFamily *d2fonts.FontFamily) string {
}
}
triggers = []string{
`class="text-mono-bold"`,
}
for _, t := range triggers {
if strings.Contains(content, t) {
fmt.Fprintf(buf, `
.text-mono-bold {
font-family: "font-mono-bold";
}
@font-face {
font-family: font-mono-bold;
src: url("%s");
}`,
d2fonts.FontEncodings[d2fonts.SourceCodePro.Font(0, d2fonts.FONT_STYLE_BOLD)])
break
}
}
triggers = []string{
`class="text-mono-italic"`,
}
for _, t := range triggers {
if strings.Contains(content, t) {
fmt.Fprintf(buf, `
.text-mono-italic {
font-family: "font-mono-italic";
}
@font-face {
font-family: font-mono-italic;
src: url("%s");
}`,
d2fonts.FontEncodings[d2fonts.SourceCodePro.Font(0, d2fonts.FONT_STYLE_ITALIC)])
break
}
}
triggers = []string{
`class="text-mono-bold"`,
}
for _, t := range triggers {
if strings.Contains(content, t) {
fmt.Fprintf(buf, `
.text-mono-bold {
font-family: "font-mono-bold";
}
@font-face {
font-family: font-mono-bold;
src: url("%s");
}`,
d2fonts.FontEncodings[d2fonts.SourceCodePro.Font(0, d2fonts.FONT_STYLE_BOLD)])
break
}
}
triggers = []string{
`class="text-mono-italic"`,
}
for _, t := range triggers {
if strings.Contains(content, t) {
fmt.Fprintf(buf, `
.text-mono-italic {
font-family: "font-mono-italic";
}
@font-face {
font-family: font-mono-italic;
src: url("%s");
}`,
d2fonts.FontEncodings[d2fonts.SourceCodePro.Font(0, d2fonts.FONT_STYLE_ITALIC)])
break
}
}
triggers = []string{
`sketch-overlay-bright`,
}

File diff suppressed because one or more lines are too long

Before

Width:  |  Height:  |  Size: 189 KiB

After

Width:  |  Height:  |  Size: 519 KiB

File diff suppressed because one or more lines are too long

Before

Width:  |  Height:  |  Size: 189 KiB

After

Width:  |  Height:  |  Size: 519 KiB

File diff suppressed because one or more lines are too long

Before

Width:  |  Height:  |  Size: 516 KiB

After

Width:  |  Height:  |  Size: 694 KiB

File diff suppressed because one or more lines are too long

Before

Width:  |  Height:  |  Size: 516 KiB

After

Width:  |  Height:  |  Size: 694 KiB

File diff suppressed because one or more lines are too long

Before

Width:  |  Height:  |  Size: 512 KiB

After

Width:  |  Height:  |  Size: 842 KiB

File diff suppressed because one or more lines are too long

Before

Width:  |  Height:  |  Size: 512 KiB

After

Width:  |  Height:  |  Size: 842 KiB

File diff suppressed because one or more lines are too long

Before

Width:  |  Height:  |  Size: 672 KiB

After

Width:  |  Height:  |  Size: 850 KiB

File diff suppressed because one or more lines are too long

Before

Width:  |  Height:  |  Size: 672 KiB

After

Width:  |  Height:  |  Size: 850 KiB

File diff suppressed because one or more lines are too long

Before

Width:  |  Height:  |  Size: 517 KiB

After

Width:  |  Height:  |  Size: 695 KiB

File diff suppressed because one or more lines are too long

Before

Width:  |  Height:  |  Size: 517 KiB

After

Width:  |  Height:  |  Size: 694 KiB

File diff suppressed because one or more lines are too long

Before

Width:  |  Height:  |  Size: 517 KiB

After

Width:  |  Height:  |  Size: 694 KiB

File diff suppressed because one or more lines are too long

Before

Width:  |  Height:  |  Size: 517 KiB

After

Width:  |  Height:  |  Size: 694 KiB

File diff suppressed because one or more lines are too long

Before

Width:  |  Height:  |  Size: 846 KiB

After

Width:  |  Height:  |  Size: 1 MiB

File diff suppressed because one or more lines are too long

Before

Width:  |  Height:  |  Size: 846 KiB

After

Width:  |  Height:  |  Size: 1,024 KiB