Making bodyTag optinal in HTML templates, in preparation for JSON support.
This commit is contained in:
parent
cd938cf480
commit
45f1ac84b1
@ -73,15 +73,12 @@ BreaPage >> contentsFile [
|
|||||||
|
|
||||||
{ #category : #'as yet unclassified' }
|
{ #category : #'as yet unclassified' }
|
||||||
BreaPage >> exportAsHTML [
|
BreaPage >> exportAsHTML [
|
||||||
| htmlContents allActions semaphore result |
|
| htmlContents allActions actionsArray semaphore result |
|
||||||
self shortName ifNil: [ ^ self ].
|
self shortName ifNil: [ ^ self ].
|
||||||
self template ifNil: [ ^ self ].
|
self template ifNil: [ ^ self ].
|
||||||
self bodyTag ifNil: [ ^ self ].
|
actionsArray := { [ self populateMetadata ] future. [ self split ] future. }.
|
||||||
allActions := TKTFuture all: {
|
self bodyTag ifNotNil: [ actionsArray := actionsArray copyWith: [ self populateBodyAs: self bodyTag ] future ].
|
||||||
[ self populateMetadata ] future.
|
allActions := TKTFuture all: actionsArray.
|
||||||
[ self split ] future.
|
|
||||||
[ self populateBodyAs: self bodyTag ] future.
|
|
||||||
}.
|
|
||||||
semaphore := Semaphore new.
|
semaphore := Semaphore new.
|
||||||
allActions onSuccessDo: [ :values |
|
allActions onSuccessDo: [ :values |
|
||||||
result := values last.
|
result := values last.
|
||||||
@ -94,7 +91,8 @@ BreaPage >> exportAsHTML [
|
|||||||
|
|
||||||
{ #category : #accessing }
|
{ #category : #accessing }
|
||||||
BreaPage >> file [
|
BreaPage >> file [
|
||||||
^ file
|
(self shortName isNil or: [ self folder isNil ]) ifTrue: [ ^ nil ].
|
||||||
|
^ file ifNil: [ ^ BreaFile fromShortName: self shortName andFolder: self folder ]
|
||||||
]
|
]
|
||||||
|
|
||||||
{ #category : #accessing }
|
{ #category : #accessing }
|
||||||
@ -134,6 +132,7 @@ BreaPage >> metadata: aDictionary [
|
|||||||
{ #category : #'as yet unclassified' }
|
{ #category : #'as yet unclassified' }
|
||||||
BreaPage >> populateBodyAs: key [
|
BreaPage >> populateBodyAs: key [
|
||||||
| allActions result semaphore |
|
| allActions result semaphore |
|
||||||
|
"(self file isMarkdown and: [ self bodyTag isNil ]) ifTrue: [ ^ self ]".
|
||||||
allActions := TKTFuture all: {
|
allActions := TKTFuture all: {
|
||||||
[ self bodyContentsAsHTML ] future.
|
[ self bodyContentsAsHTML ] future.
|
||||||
}.
|
}.
|
||||||
|
Loading…
Reference in New Issue
Block a user