From ee2ade050906b11e1e73edba7cfda4d84ab8c2b4 Mon Sep 17 00:00:00 2001 From: Offray Luna Date: Mon, 3 Apr 2023 22:25:29 -0500 Subject: [PATCH] Improving Markdown document tree node views. --- src/PetitMarkdown/PPCMContainer.class.st | 15 +++++++++++++++ src/PetitMarkdown/PPCMHeader.class.st | 2 +- src/PetitMarkdown/PPCMListItem.class.st | 22 ++++++++++++++++++++++ 3 files changed, 38 insertions(+), 1 deletion(-) diff --git a/src/PetitMarkdown/PPCMContainer.class.st b/src/PetitMarkdown/PPCMContainer.class.st index 4b006b2..1fc5238 100644 --- a/src/PetitMarkdown/PPCMContainer.class.st +++ b/src/PetitMarkdown/PPCMContainer.class.st @@ -8,3 +8,18 @@ Class { PPCMContainer >> accept: visitor [ ^ visitor visitContainer: self ] + +{ #category : #accessing } +PPCMContainer >> viewBody [ + + | aText | + aText := self className asRopedText. + + self children do: [ :child | + aText append: ' ' asRopedText. + aText append: (child className asRopedText foreground: + BrGlamorousColors disabledButtonTextColor) ]. + + + ^ aText +] diff --git a/src/PetitMarkdown/PPCMHeader.class.st b/src/PetitMarkdown/PPCMHeader.class.st index dad312b..61ef059 100644 --- a/src/PetitMarkdown/PPCMHeader.class.st +++ b/src/PetitMarkdown/PPCMHeader.class.st @@ -56,7 +56,7 @@ PPCMHeader >> viewBody [ BrGlamorousColors disabledButtonTextColor). aText append: ('= "' asRopedText foreground: BrGlamorousColors disabledButtonTextColor). - aText append: (child className asRopedText foreground: + aText append: (child text asRopedText foreground: BrGlamorousColors disabledButtonTextColor). aText append: ('"' asRopedText foreground: diff --git a/src/PetitMarkdown/PPCMListItem.class.st b/src/PetitMarkdown/PPCMListItem.class.st index fa3e4d6..eedda8d 100644 --- a/src/PetitMarkdown/PPCMListItem.class.st +++ b/src/PetitMarkdown/PPCMListItem.class.st @@ -19,3 +19,25 @@ PPCMListItem >> initialize [ PPCMListItem >> isBlockLevel [ ^ true ] + +{ #category : #accessing } +PPCMListItem >> viewBody [ + + | aText | + aText := self className asRopedText. + + self children do: [ :child | + aText append: ' ' asRopedText. + aText append: (child className asRopedText foreground: + BrGlamorousColors disabledButtonTextColor). + aText append: ('= "' asRopedText foreground: + BrGlamorousColors disabledButtonTextColor). + aText append: (child className asRopedText foreground: + BrGlamorousColors disabledButtonTextColor). + aText append: + ('"' asRopedText foreground: + BrGlamorousColors disabledButtonTextColor) ]. + + + ^ aText +]