Preserving HedgeDoc importation metadata when converted to Markdeep.
This commit is contained in:
parent
ca3550a3f4
commit
d2959856b9
@ -57,8 +57,8 @@ HedgeDoc >> asLePage [
|
||||
splitAdmonitionSnippets.
|
||||
newPage editTime: DateAndTime now.
|
||||
newPage options
|
||||
at: 'originalMetadata' put: self metadata;
|
||||
at: 'url' put: self url.
|
||||
at: 'HedgeDoc' at: 'yamlFrontmatter' put: self metadata;
|
||||
at: 'HedgeDoc' at: 'url' put: self url.
|
||||
^ newPage
|
||||
]
|
||||
|
||||
|
@ -21,6 +21,7 @@ LePage >> asHtmlFile [
|
||||
LePage >> asMarkdeep [
|
||||
| bodyStream markdeep |
|
||||
bodyStream := '' writeStream.
|
||||
bodyStream nextPutAll: self notebookMetadataSnippet asMarkdeep.
|
||||
self preorderTraversal
|
||||
do: [ :snippet | bodyStream nextPutAll: snippet asMarkdeep ].
|
||||
markdeep := Markdeep new
|
||||
@ -231,6 +232,17 @@ LePage >> navTop [
|
||||
ifTrue: [ ^ topNavFile contents ]
|
||||
]
|
||||
|
||||
{ #category : #'*MiniDocs' }
|
||||
LePage >> notebookMetadataSnippet [
|
||||
| response |
|
||||
response := LeTextSnippet new fromString: '<!-- See this snippet source code for this notebook''s metadata -->'.
|
||||
response parent: self.
|
||||
(self optionAt: 'HedgeDoc') ifNil: [ ^ response ].
|
||||
(response extra)
|
||||
at: 'HedgeDoc' put: (self optionAt: 'HedgeDoc').
|
||||
^ response
|
||||
]
|
||||
|
||||
{ #category : #'*MiniDocs' }
|
||||
LePage >> olderChild [
|
||||
"I provide the last edited child node.
|
||||
|
@ -38,7 +38,9 @@ LeTextSnippet >> fromMarkdeep: markdeepDiv [
|
||||
{ #category : #'*MiniDocs' }
|
||||
LeTextSnippet >> fromString: aString [
|
||||
|
||||
self string: aString
|
||||
self
|
||||
string: aString;
|
||||
uid: LeUID new.
|
||||
]
|
||||
|
||||
{ #category : #'*MiniDocs' }
|
||||
|
@ -109,7 +109,7 @@ LeTextualSnippet >> metadataUpdate [
|
||||
editEmailSanitized := self editEmail asString withoutXMLTagDelimiters.
|
||||
^ OrderedDictionary new
|
||||
at: 'id' put: self uidString;
|
||||
at: 'parent' put: self parent uidString;
|
||||
at: 'parent' put: (self parent ifNotNil: [self parent uidString]);
|
||||
at: 'created' put: self createTime asString;
|
||||
at: 'modified' put: self latestEditTime asString;
|
||||
at: 'creator' put: createEmailSanitized;
|
||||
|
Loading…
Reference in New Issue
Block a user