From c5f71e82302dab957a2f6a6a4de1f342299d9856 Mon Sep 17 00:00:00 2001 From: Offray Luna Date: Fri, 28 Jan 2022 22:34:33 -0500 Subject: [PATCH] Fixing authors/version metada preview. --- repository/Grafoscopio-Utils/LePage.extension.st | 5 +++-- repository/Grafoscopio-Utils/Markdeep.class.st | 10 +++++----- 2 files changed, 8 insertions(+), 7 deletions(-) diff --git a/repository/Grafoscopio-Utils/LePage.extension.st b/repository/Grafoscopio-Utils/LePage.extension.st index 01903c4..83ec762 100644 --- a/repository/Grafoscopio-Utils/LePage.extension.st +++ b/repository/Grafoscopio-Utils/LePage.extension.st @@ -10,13 +10,13 @@ LePage >> asMarkdeep [ markdeep := Markdeep new title: self title; body: bodyStream contents. - markdeep metadata at: 'authors' put: (self metadata at: 'authors' ifAbsentPut: [ '']). - markdeep metadata at: 'version' put: (self metadata at: 'version' ifAbsentPut: [ '']). self metadata keysAndValuesDo: [:k :v | markdeep header add: ''; yourself. ]. + self metadata at: 'authors' ifPresent: [:author | markdeep metadata at: 'authors' put: author ]. + self metadata at: 'version' ifPresent: [:version | markdeep metadata at: 'version' put: version ]. ^ markdeep. ] @@ -55,6 +55,7 @@ LePage >> metadataInit [ ^ OrderedDictionary new at: 'id' put: self uidString; + at: 'title' put: self contentAsString; at: 'created' put: self createTime asString; at: 'modified' put: self latestEditTime asString; at: 'creator' put: self createEmail asString; diff --git a/repository/Grafoscopio-Utils/Markdeep.class.st b/repository/Grafoscopio-Utils/Markdeep.class.st index 8455020..e2c90b5 100644 --- a/repository/Grafoscopio-Utils/Markdeep.class.st +++ b/repository/Grafoscopio-Utils/Markdeep.class.st @@ -25,7 +25,8 @@ Markdeep class >> fromMarkdownFile: aFileReference [ { #category : #'instance creation' } Markdeep >> authors [ - ^ self metadata at: 'authors' ifAbsent: [ ^'' ] + self metadata at: 'authors' ifPresent: [:k | ^ '**', k, '**' ]. + ^ ''. ] { #category : #accessing } @@ -96,7 +97,7 @@ Markdeep >> contents [ output nextPutAll: self headerContents; lf; lf; nextPutAll: ' **', self title, '**'; lf; - nextPutAll: ' **', self authors, '**'; lf; + nextPutAll: ' ', self authors ; lf; nextPutAll: ' ', self version; lf; lf; nextPutAll: self body; lf; lf; nextPutAll: self tail; lf; lf; lf; lf; @@ -259,7 +260,6 @@ Markdeep >> tocStyle: anObject [ { #category : #'instance creation' } Markdeep >> version [ - | semVer | - semVer := self metadata at: 'version' ifAbsent: [ ^'' ]. - ^ 'v', semVer + self metadata at: 'version' ifPresent: [:value | ^ 'v',value ]. + ^ '' ]