Fixing authors/version metada preview.

This commit is contained in:
Offray Vladimir Luna Cárdenas 2022-01-28 22:34:33 -05:00
parent 326a28fce3
commit c5f71e8230
2 changed files with 8 additions and 7 deletions

View File

@ -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: '<meta name="', k, '" content="', v,'">';
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;

View File

@ -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 ].
^ ''
]