Fixing page and snippets create-edit time and uid parsing for markdeep lepiter format.

This commit is contained in:
ruidajo 2022-10-03 12:14:48 -05:00
parent 739c7298f1
commit d35eedd172
4 changed files with 18 additions and 10 deletions

View File

@ -16,9 +16,10 @@ LeDatabase >> addPageFromMarkdeep: markdeepDocTree [
remoteMetadata := Markdeep new metadataFromXML: markdeepDocTree.
page := LePage new
title: (remoteMetadata at: 'title');
basicUid: (remoteMetadata at: 'id');
createTime: (remoteMetadata at: 'created');
editTime: ("ZTimestamp fromString:" (remoteMetadata at: 'modified'));
basicUid: (UUID fromString36: (remoteMetadata at: 'id'));
createTime: (LeTime new time: ((remoteMetadata at: 'created') asDateAndTime));
editTime: (LeTime new time: ((remoteMetadata at: 'modified') asDateAndTime));
latestEditTime: (LeTime new time: ((remoteMetadata at: 'modified') asDateAndTime));
createEmail: (remoteMetadata at: 'creator');
editEmail: (remoteMetadata at: 'modifier').
snippets do: [ :snippet | page addSnippet: snippet ].

View File

@ -120,6 +120,13 @@ LePage >> htmlFileName [
^ self exportedFileName, '.html'
]
{ #category : #'*MiniDocs' }
LePage >> latestEditTime: aLeTime [
"Used for adding a LePage to database from a shared markdeep LePage version."
latestEditTime := aLeTime
]
{ #category : #'*MiniDocs' }
LePage >> markdeepFileName [

View File

@ -16,12 +16,12 @@ LePharoSnippet >> contentFrom: markdeepDiv [
sanitizedStringText := markdeepDiv contentString lines reject: [ :line | line beginsWith: '~~~' ].
sanitizedStringText := "(Character cr asString)" '' join: sanitizedStringText.
self code: sanitizedStringText;
uid: (metadata at: 'id');
uid: (LeUID new uidString: (metadata at: 'id'));
parent: (metadata at: 'parent');
createTime: (metadata at: 'created');
editTime: (metadata at: 'modified');
createTime: (LeTime new time: ((metadata at: 'created')asDateAndTime));
editTime: (LeTime new time: ((metadata at: 'modified') asDateAndTime));
editEmail: (metadata at: 'modifier');
createEmail: (metadata at: 'creator').
createEmail: (metadata at: 'creator')
]
{ #category : #'*MiniDocs' }

View File

@ -9,10 +9,10 @@ LeTextSnippet >> contentFrom: markdeepDiv [
sanitizedStringText := sanitizedStringText allButFirst.
sanitizedStringText := sanitizedStringText allButLast.
self string: sanitizedStringText;
uid: (metadata at: 'id');
uid: (LeUID new uidString: (metadata at: 'id'));
parent: (metadata at: 'parent');
createTime: (metadata at: 'created');
editTime: (metadata at: 'modified');
createTime: (LeTime new time: ((metadata at: 'created')asDateAndTime));
editTime: (LeTime new time: ((metadata at: 'modified') asDateAndTime));
editEmail: (metadata at: 'modifier');
createEmail: (metadata at: 'creator')
]