Resync after some image de-synchronization.
This commit is contained in:
parent
5ad652f25b
commit
1a6c46840a
@ -8,7 +8,8 @@ Class {
|
||||
'shortName',
|
||||
'template',
|
||||
'templateData',
|
||||
'namespace'
|
||||
'namespace',
|
||||
'bodyTag'
|
||||
],
|
||||
#category : #Brea
|
||||
}
|
||||
@ -22,6 +23,50 @@ BreaWikiPage >> bodyContentsAsHTML [
|
||||
^ Pandoc markdownToHtml: sourcePage
|
||||
]
|
||||
|
||||
{ #category : #accessing }
|
||||
BreaWikiPage >> bodyTag [
|
||||
^ bodyTag
|
||||
]
|
||||
|
||||
{ #category : #accessing }
|
||||
BreaWikiPage >> bodyTag: aString [
|
||||
"I represent the Mustache Template tag used to denote the body part of a page.
|
||||
While the metadata is self describing via YAML metadata blocks in Markddown, so
|
||||
they map where ever they are needed in a template, the Markdown file that will be converted
|
||||
in HTML via a template doesn't know which part should occupy once the conversion is done.
|
||||
I provide such knowledge. So if a page template puts the body content under the mustache tag
|
||||
{{content}}, I should use bodyTag: 'content'.
|
||||
bodyTag: is template dependant."
|
||||
bodyTag := aString
|
||||
]
|
||||
|
||||
{ #category : #'as yet unclassified' }
|
||||
BreaWikiPage >> exportAsHTML [
|
||||
| htmlContents allActions semaphore result |
|
||||
self shortName ifNil: [ ^ self ].
|
||||
self template ifNil: [ ^ self ].
|
||||
self bodyTag ifNil: [ ^ self ].
|
||||
allActions := TKTFuture all: {
|
||||
[ self populateMetadata ] future.
|
||||
[ self populateBodyAs: self bodyTag ] future.
|
||||
}.
|
||||
semaphore := Semaphore new.
|
||||
allActions onSuccessDo: [ :values |
|
||||
result := values last.
|
||||
semaphore signal.
|
||||
].
|
||||
semaphore wait.
|
||||
htmlContents := (MustacheTemplate on: result templateFile contents) value: result templateData.
|
||||
^ MarkupFile exportAsFileOn: self namespace / (self shortName, '.html' ) containing: htmlContents
|
||||
]
|
||||
|
||||
{ #category : #'as yet unclassified' }
|
||||
BreaWikiPage >> htmlContents [
|
||||
self shortName ifNil: [ ^ self ].
|
||||
self template ifNil: [ ^ self ].
|
||||
^ (MustacheTemplate on: self templateFile contents) value: self templateData.
|
||||
]
|
||||
|
||||
{ #category : #operation }
|
||||
BreaWikiPage >> markdownFile [
|
||||
| localFile |
|
||||
@ -42,25 +87,19 @@ BreaWikiPage >> namespace: folderFileReference [
|
||||
namespace := folderFileReference
|
||||
]
|
||||
|
||||
{ #category : #'as yet unclassified' }
|
||||
BreaWikiPage >> populateBodyAs2: key [
|
||||
|
||||
[self bodyContentsAsHTML] future
|
||||
andThen: [:result | self templateData at: key put: result contents]
|
||||
]
|
||||
|
||||
{ #category : #'as yet unclassified' }
|
||||
BreaWikiPage >> populateBodyAs: key [
|
||||
| allActions result |
|
||||
| allActions result semaphore |
|
||||
allActions := TKTFuture all: {
|
||||
[ self bodyContentsAsHTML ] future.
|
||||
[ self templateData at: key put: FileLocator temp / 'wikiPage.html' contents ] future
|
||||
}.
|
||||
semaphore := Semaphore new.
|
||||
allActions onSuccessDo: [ :values |
|
||||
result := values ].
|
||||
^ result.
|
||||
|
||||
|
||||
result := values last.
|
||||
semaphore signal ].
|
||||
semaphore wait.
|
||||
self templateData at: key put: result contents.
|
||||
^ self.
|
||||
]
|
||||
|
||||
{ #category : #operation }
|
||||
@ -101,3 +140,10 @@ BreaWikiPage >> templateData [
|
||||
BreaWikiPage >> templateData: aDictionary [
|
||||
templateData := aDictionary
|
||||
]
|
||||
|
||||
{ #category : #'as yet unclassified' }
|
||||
BreaWikiPage >> templateFile [
|
||||
self namespace ifNil: [ ^ self ].
|
||||
self template ifNil: [ ^ self ].
|
||||
^ self namespace / self template
|
||||
]
|
||||
|
Loading…
Reference in New Issue
Block a user