From c162b9b4bccb0726cd16a0fded269a1a2e34a024 Mon Sep 17 00:00:00 2001 From: Offray Luna Date: Sat, 9 Mar 2024 12:05:25 -0500 Subject: [PATCH] Improving populating metadata from a given Markdeep file. --- src/MiniDocs/Markdeep.class.st | 64 ++++++++++++++++++++++++++-------- 1 file changed, 49 insertions(+), 15 deletions(-) diff --git a/src/MiniDocs/Markdeep.class.st b/src/MiniDocs/Markdeep.class.st index 50f963c..9f9f6e2 100644 --- a/src/MiniDocs/Markdeep.class.st +++ b/src/MiniDocs/Markdeep.class.st @@ -57,6 +57,11 @@ Markdeep >> bodyReplaceAll: original with: replacement [ self body: (self body copyReplaceAll: original with: replacement) ] +{ #category : #accessing } +Markdeep >> cleanMetadata [ + metadata := nil +] + { #category : #accessing } Markdeep >> commentPubPubDelimiters [ | commented openners | @@ -158,6 +163,29 @@ Markdeep >> converPubPubFootnoteBetween: footnote and: nextFootnote in: footnote ^ response contents ] +{ #category : #accessing } +Markdeep >> extractTitleFrom: docTree [ + | tempTitle | + tempTitle := ((docTree children + detect: [ :node | node className = 'PPCMIndentedCode' ]) children + detect: [ :subnode | subnode text trimmed beginsWith: '**' ]) text trimmed. + self title: (tempTitle copyFrom: 3 to: tempTitle size - 2). + ^ tempTitle +] + +{ #category : #accessing } +Markdeep >> extractYamlMetadataFrom: documentTree [ + | yamlComment response | + yamlComment := documentTree children + detect: [:node | node className = 'PPCMHtmlBlock' and: [node text trimmed beginsWith: '