diff --git a/src/MiniDocs/LeCodeSnippet.extension.st b/src/MiniDocs/LeCodeSnippet.extension.st new file mode 100644 index 0000000..f4fba87 --- /dev/null +++ b/src/MiniDocs/LeCodeSnippet.extension.st @@ -0,0 +1,21 @@ +Extension { #name : #LeCodeSnippet } + +{ #category : #'*MiniDocs' } +LeCodeSnippet >> metadataUpdate [ + | surrogate | + self parent + ifNil: [ surrogate := nil] + ifNotNil: [ + self parent isString + ifTrue: [ surrogate := self parent] + ifFalse: [ surrogate := self parent uidString ] + ]. + ^ OrderedDictionary new + at: 'id' put: self uidString; + at: 'parent' put: surrogate; + 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 +] diff --git a/src/MiniDocs/LeSnippet.extension.st b/src/MiniDocs/LeSnippet.extension.st index a549628..74fd8ee 100644 --- a/src/MiniDocs/LeSnippet.extension.st +++ b/src/MiniDocs/LeSnippet.extension.st @@ -11,6 +11,26 @@ LeSnippet class >> fromMetaMarkdeep: div [ ^ snippet. ] +{ #category : #'*MiniDocs' } +LeSnippet >> metadata [ + ^ self metadataUpdate +] + +{ #category : #'*MiniDocs' } +LeSnippet >> metadataUpdate [ + | createEmailSanitized editEmailSanitized | + createEmailSanitized := self createEmail asString withoutXMLTagDelimiters. + editEmailSanitized := self editEmail asString withoutXMLTagDelimiters. + ^ OrderedDictionary new + at: 'id' put: self uidString; + at: 'parent' put: self parent uuid; + at: 'created' put: self createTime asString; + at: 'modified' put: self latestEditTime asString; + at: 'creator' put: createEmailSanitized; + at: 'modifier' put: editEmailSanitized; + yourself +] + { #category : #'*MiniDocs' } LeSnippet >> moveToPageTitled: pageName [ | db origin destination thisSnippet | diff --git a/src/MiniDocs/LeTextSnippet.extension.st b/src/MiniDocs/LeTextSnippet.extension.st index c270a62..f79b51e 100644 --- a/src/MiniDocs/LeTextSnippet.extension.st +++ b/src/MiniDocs/LeTextSnippet.extension.st @@ -25,21 +25,6 @@ LeTextSnippet >> metadata [ ^ self metadataUpdate ] -{ #category : #'*MiniDocs' } -LeTextSnippet >> metadataUpdate [ - | createEmailSanitized editEmailSanitized | - createEmailSanitized := self createEmail asString withoutXMLTagDelimiters. - editEmailSanitized := self editEmail asString withoutXMLTagDelimiters. - ^ OrderedDictionary new - at: 'id' put: self uidString; - at: 'parent' put: self parentId; - at: 'created' put: self createTime asString; - at: 'modified' put: self latestEditTime asString; - at: 'creator' put: createEmailSanitized; - at: 'modifier' put: editEmailSanitized; - yourself -] - { #category : #'*MiniDocs' } LeTextSnippet >> options [ ^ options diff --git a/src/MiniDocs/LeTextualSnippet.extension.st b/src/MiniDocs/LeTextualSnippet.extension.st index cc0d45f..d28e84a 100644 --- a/src/MiniDocs/LeTextualSnippet.extension.st +++ b/src/MiniDocs/LeTextualSnippet.extension.st @@ -71,22 +71,17 @@ LeTextualSnippet >> metadata [ { #category : #'*MiniDocs' } LeTextualSnippet >> metadataUpdate [ - | surrogate | - self parent - ifNil: [ surrogate := nil] - ifNotNil: [ - self parent isString - ifTrue: [ surrogate := self parent] - ifFalse: [ surrogate := self parent uidString ] - ]. + | createEmailSanitized editEmailSanitized | + createEmailSanitized := self createEmail asString withoutXMLTagDelimiters. + editEmailSanitized := self editEmail asString withoutXMLTagDelimiters. ^ OrderedDictionary new at: 'id' put: self uidString; - at: 'parent' put: surrogate; + at: 'parent' put: self parent uuid; 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 + at: 'creator' put: createEmailSanitized; + at: 'modifier' put: editEmailSanitized; + yourself ] { #category : #'*MiniDocs' } diff --git a/src/MiniDocs/LeUnknownSnippet.extension.st b/src/MiniDocs/LeUnknownSnippet.extension.st new file mode 100644 index 0000000..e520faf --- /dev/null +++ b/src/MiniDocs/LeUnknownSnippet.extension.st @@ -0,0 +1,21 @@ +Extension { #name : #LeUnknownSnippet } + +{ #category : #'*MiniDocs' } +LeUnknownSnippet >> metadataUpdate [ + | surrogate | + self parent + ifNil: [ surrogate := nil] + ifNotNil: [ + self parent isString + ifTrue: [ surrogate := self parent] + ifFalse: [ surrogate := self parent uidString ] + ]. + ^ OrderedDictionary new + at: 'id' put: self uidString; + at: 'parent' put: surrogate; + 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 +] diff --git a/src/MiniDocs/String.extension.st b/src/MiniDocs/String.extension.st index 87fe274..2a45029 100644 --- a/src/MiniDocs/String.extension.st +++ b/src/MiniDocs/String.extension.st @@ -32,3 +32,8 @@ String >> romanizeAccents [ ]. ^ modified ] + +{ #category : #'*MiniDocs' } +String >> withoutXMLTagDelimiters [ + ^ self copyWithoutAll: #($< $>) +]