From 51a5a09d6c677e49ad3b85539f64b22ef5b880f7 Mon Sep 17 00:00:00 2001 From: Offray Luna Date: Thu, 6 Apr 2023 09:08:04 -0500 Subject: [PATCH] More document tree element views. --- src/PetitMarkdown/PPCMHtml.class.st | 17 +++++++++++++++++ src/PetitMarkdown/PPCMStrong.class.st | 17 +++++++++++++++++ 2 files changed, 34 insertions(+) diff --git a/src/PetitMarkdown/PPCMHtml.class.st b/src/PetitMarkdown/PPCMHtml.class.st index 00d08c5..5727ae2 100644 --- a/src/PetitMarkdown/PPCMHtml.class.st +++ b/src/PetitMarkdown/PPCMHtml.class.st @@ -21,3 +21,20 @@ PPCMHtml >> text [ PPCMHtml >> text: anObject [ text := anObject ] + +{ #category : #accessing } +PPCMHtml >> viewBody [ + + | aText | + aText := (self className ,' ', + self text) asRopedText. + + self children do: [ :child | + aText append: ' ' asRopedText. + aText append: (child className asRopedText foreground: + BrGlamorousColors disabledButtonTextColor) + ]. + + + ^ aText +] diff --git a/src/PetitMarkdown/PPCMStrong.class.st b/src/PetitMarkdown/PPCMStrong.class.st index 809d36e..970e6c6 100644 --- a/src/PetitMarkdown/PPCMStrong.class.st +++ b/src/PetitMarkdown/PPCMStrong.class.st @@ -8,3 +8,20 @@ Class { PPCMStrong >> accept: visitor [ ^ visitor visitStrong: self ] + +{ #category : #accessing } +PPCMStrong >> viewBody [ + + | aText | + aText := (self className ,' ', + self text) asRopedText. + + self children do: [ :child | + aText append: ' ' asRopedText. + aText append: (child className asRopedText foreground: + BrGlamorousColors disabledButtonTextColor) + ]. + + + ^ aText +]