From ed6d66fb2a8c7b6da478a065c80b5f63fa79fdb4 Mon Sep 17 00:00:00 2001 From: Offray Luna Date: Fri, 28 Jan 2022 17:01:41 -0500 Subject: [PATCH] Adding LePage metadata. --- .../Grafoscopio-Utils/LePage.extension.st | 32 +++++++++++++------ 1 file changed, 22 insertions(+), 10 deletions(-) diff --git a/repository/Grafoscopio-Utils/LePage.extension.st b/repository/Grafoscopio-Utils/LePage.extension.st index 427c2a9..05eac80 100644 --- a/repository/Grafoscopio-Utils/LePage.extension.st +++ b/repository/Grafoscopio-Utils/LePage.extension.st @@ -2,15 +2,20 @@ Extension { #name : #LePage } { #category : #'*Grafoscopio-Utils-Core' } LePage >> asMarkdeep [ - | bodyStream | + | bodyStream markdeep | bodyStream := '' writeStream. self preorderTraversal do: [:snippet | bodyStream nextPutAll: snippet asMarkdeep ]. - ^ Markdeep new + markdeep := Markdeep new title: self title; - body: bodyStream contents - contents. + body: bodyStream contents. + self metadata keysAndValuesDo: [:k :v | + markdeep header + add: ''; + yourself. + ]. + ^ markdeep. ] { #category : #'*Grafoscopio-Utils-Core' } @@ -39,13 +44,20 @@ LePage >> markdeepTemporalFile [ { #category : #'*Grafoscopio-Utils-Core' } LePage >> metadata [ + + ^ self options at: 'metadata' ifAbsentPut: [ self metadataInit] +] + +{ #category : #'*Grafoscopio-Utils-Core' } +LePage >> metadataInit [ + ^ OrderedDictionary new - at: 'id' put: self uidString; - at: 'created' put: self createTime asString; - at: 'modified' put: self latestEditTime asString; - at: 'creator' put: self createEmail asString; - at: 'editor' put: self editEmail asString; - yourself. + at: 'id' put: self uidString; + at: 'created' put: self createTime asString; + at: 'modified' put: self latestEditTime asString; + at: 'creator' put: self createEmail asString; + at: 'modifier' put: self editEmail asString; + yourself ] { #category : #'*Grafoscopio-Utils-Core' }