Wiki pages preliminar exportation working.
This commit is contained in:
parent
5ad652f25b
commit
e5303fa3e7
@ -22,6 +22,24 @@ BreaWikiPage >> bodyContentsAsHTML [
|
|||||||
^ Pandoc markdownToHtml: sourcePage
|
^ Pandoc markdownToHtml: sourcePage
|
||||||
]
|
]
|
||||||
|
|
||||||
|
{ #category : #'as yet unclassified' }
|
||||||
|
BreaWikiPage >> exportAsHTML [
|
||||||
|
| htmlContents templateFile |
|
||||||
|
self shortName ifNil: [ ^ self ].
|
||||||
|
self template ifNil: [ ^ self ].
|
||||||
|
templateFile := self namespace / self template.
|
||||||
|
htmlContents := (MustacheTemplate on: templateFile contents) value: self templateData.
|
||||||
|
"htmlContents."
|
||||||
|
^ 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 }
|
{ #category : #operation }
|
||||||
BreaWikiPage >> markdownFile [
|
BreaWikiPage >> markdownFile [
|
||||||
| localFile |
|
| localFile |
|
||||||
@ -42,25 +60,19 @@ BreaWikiPage >> namespace: folderFileReference [
|
|||||||
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' }
|
{ #category : #'as yet unclassified' }
|
||||||
BreaWikiPage >> populateBodyAs: key [
|
BreaWikiPage >> populateBodyAs: key [
|
||||||
| allActions result |
|
| allActions result semaphore |
|
||||||
allActions := TKTFuture all: {
|
allActions := TKTFuture all: {
|
||||||
[self bodyContentsAsHTML] future.
|
[ self bodyContentsAsHTML ] future.
|
||||||
[ self templateData at: key put: FileLocator temp / 'wikiPage.html' contents ] future
|
|
||||||
}.
|
}.
|
||||||
|
semaphore := Semaphore new.
|
||||||
allActions onSuccessDo: [ :values |
|
allActions onSuccessDo: [ :values |
|
||||||
result := values ].
|
result := values last.
|
||||||
^ result.
|
semaphore signal ].
|
||||||
|
semaphore wait.
|
||||||
|
self templateData at: key put: result contents.
|
||||||
|
^ self.
|
||||||
]
|
]
|
||||||
|
|
||||||
{ #category : #operation }
|
{ #category : #operation }
|
||||||
@ -101,3 +113,10 @@ BreaWikiPage >> templateData [
|
|||||||
BreaWikiPage >> templateData: aDictionary [
|
BreaWikiPage >> templateData: aDictionary [
|
||||||
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