Skip to content

Commit

Permalink
markdown hr tag
Browse files Browse the repository at this point in the history
  • Loading branch information
Light-Beacon committed Oct 2, 2024
1 parent ba2dfbc commit e54596b
Show file tree
Hide file tree
Showing 5 changed files with 99 additions and 81 deletions.
3 changes: 2 additions & 1 deletion Plugin/Markdown/Modules/Parsers.py
Original file line number Diff line number Diff line change
Expand Up @@ -175,7 +175,8 @@ class LineNode(NodeBase):
@property
def inline(self):
return False


@handles('hr')
class BlockNode(LineNode):
@property
def isblock(self):
Expand Down
2 changes: 2 additions & 0 deletions Plugin/Markdown/Resources/Components/hr.xaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@

<Section Style="{StaticResource Hr}"/>
46 changes: 46 additions & 0 deletions Plugin/Markdown/Resources/Styles/headings.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
Anchors:
- &Color1 "{DynamicResource ColorBrush1}"
- &Color2 "{DynamicResource ColorBrush2}"
- &Color3 "{DynamicResource ColorBrush3}"
- &Color4 "{DynamicResource ColorBrush4}"
- &Color5 "{DynamicResource ColorBrush5}"

Styles:
- Key: H1
Target: Paragraph
Setters:
FontSize: 24
Margin: 0,10,0,10
FontWeight: Bold
Foreground: *Color3

- Key: H2
Target: Paragraph
Setters:
FontSize: 22
Margin: 0,10,0,5
FontWeight: Bold
Foreground: *Color3

- Key: H3
Target: Paragraph
Setters:
FontSize: 18
Margin: 0,5,0,5
FontWeight: Bold
Foreground: *Color4

- Key: H4
Target: Paragraph
Setters:
FontSize: 16
Margin: 0,3,0,5
FontWeight: Bold
Foreground: *Color4

- Key: H5
Target: Paragraph
Setters:
FontSize: 15
Margin: 0,3,0,5
Foreground: *Color4
86 changes: 6 additions & 80 deletions Plugin/Markdown/Resources/Styles/markdown_styles.yml
Original file line number Diff line number Diff line change
Expand Up @@ -31,84 +31,10 @@ Styles:
Foreground: Black
LineHeight: 22

- Key: H1
Target: Paragraph
- Key: Hr
Target: Section
Setters:
FontSize: 24
Margin: 0,10,0,10
FontWeight: Bold
Foreground: *Color3

- Key: H2
Target: Paragraph
Setters:
FontSize: 22
Margin: 0,10,0,5
FontWeight: Bold
Foreground: *Color3

- Key: H3
Target: Paragraph
Setters:
FontSize: 18
Margin: 0,5,0,5
FontWeight: Bold
Foreground: *Color4

- Key: H4
Target: Paragraph
Setters:
FontSize: 16
Margin: 0,3,0,5
FontWeight: Bold
Foreground: *Color4

- Key: H5
Target: Paragraph
Setters:
FontSize: 15
Margin: 0,3,0,5
Foreground: *Color4

- Key: Quote
Target: Border
Setters:
BorderThickness: 5,0,0,0
BorderBrush: *Color4
Padding: 10,5
Margin: 0,5

- Key: cautionQuote
Target: Border
BasedOn: Quote
Setters:
BorderBrush: "#CC4455"
Background: "#33CC4455"

- Key: noteQuote
Target: Border
BasedOn: Quote
Setters:
BorderBrush: "#4455AA"
Background: "#334455AA"

- Key: tipQuote
Target: Border
BasedOn: Quote
Setters:
BorderBrush: "#44AA55"
Background: "#3344AA55"

- Key: importantQuote
Target: Border
BasedOn: Quote
Setters:
BorderBrush: "#AA55BB"
Background: "#33AA55BB"

- Key: warningQuote
Target: Border
BasedOn: Quote
Setters:
BorderBrush: "#DDBB44"
Background: "#33DDBB44"
Margin: "0,4,0,0"
BorderThickness: "0,1.5,0,0"
BorderBrush: "{StaticResource ColorBrush4}"
FontSize: 4
43 changes: 43 additions & 0 deletions Plugin/Markdown/Resources/Styles/quotes.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
Styles:
- Key: Quote
Target: Border
Setters:
BorderThickness: 5,0,0,0
BorderBrush: "{DynamicResource ColorBrush4}"
Padding: 10,5
Margin: 0,5

- Key: cautionQuote
Target: Border
BasedOn: Quote
Setters:
BorderBrush: "#CC4455"
Background: "#33CC4455"

- Key: noteQuote
Target: Border
BasedOn: Quote
Setters:
BorderBrush: "#4455AA"
Background: "#334455AA"

- Key: tipQuote
Target: Border
BasedOn: Quote
Setters:
BorderBrush: "#44AA55"
Background: "#3344AA55"

- Key: importantQuote
Target: Border
BasedOn: Quote
Setters:
BorderBrush: "#AA55BB"
Background: "#33AA55BB"

- Key: warningQuote
Target: Border
BasedOn: Quote
Setters:
BorderBrush: "#DDBB44"
Background: "#33DDBB44"

0 comments on commit e54596b

Please sign in to comment.