diff --git a/repository/Brea/ArchiveOrgItem.class.st b/repository/Brea/ArchiveOrgItem.class.st
index 1cc5f01..842c08a 100644
--- a/repository/Brea/ArchiveOrgItem.class.st
+++ b/repository/Brea/ArchiveOrgItem.class.st
@@ -1,118 +1,118 @@
-"
-I model information of the items published on Internet Archive (https://archive.org/).
-"
-Class {
- #name : #ArchiveOrgItem,
- #superclass : #Object,
- #instVars : [
- 'id',
- 'metadata'
- ],
- #category : #Brea
-}
-
-{ #category : #utility }
-ArchiveOrgItem >> archive [
- ^ 'https://archive.org'
-]
-
-{ #category : #utilities }
-ArchiveOrgItem >> createHtmlImageGalleryList [
- "IMPORTANT: This is just a draft snipped. Should become a proper test o be deleted."
- self metadata ifNil: [ self getMetadata ].
- ^ '
-
'
-]
-
-{ #category : #utilities }
-ArchiveOrgItem >> embeddedUrl [
-
- ^ 'https://archive.org/embed/', self id.
-]
-
-{ #category : #utilities }
-ArchiveOrgItem >> galleryItemsBaseUrl [
- "I create the place where all image would be located for creating a custom image gallery,
- according with the requirements for nanogallery2."
-
- ^ 'https://', (self metadata at: 'd2'), (self metadata at: 'dir'), '/'.
-]
-
-{ #category : #operation }
-ArchiveOrgItem >> getMetadata [
- self id ifNil: [ ^ self ].
- self metadata: (NeoJSONReader fromString: (self archive, '/metadata/', self id) asUrl retrieveContents)
-]
-
-{ #category : #accessing }
-ArchiveOrgItem >> id [
- ^ id
-]
-
-{ #category : #accessing }
-ArchiveOrgItem >> id: anObject [
- id := anObject
-]
-
-{ #category : #utilities }
-ArchiveOrgItem >> imagesGalleryList [
- self metadata ifNil: [ self getMetadata ].
- ^ (self metadata at: 'files') select: [ :file | (file at: 'format') = 'JPEG Thumb' ]
-]
-
-{ #category : #utilities }
-ArchiveOrgItem >> imagesGalleryListAsDictionary [
- | galleryImages result |
- self imagesGalleryList ifNil: [ ^ self ].
- galleryImages := OrderedCollection new.
- self imagesGalleryList do: [ :imgMetadata |
- galleryImages
- add: (Dictionary new
- at: 'imgOriginal' put: (imgMetadata at: 'original');
- at: 'imgThumb' put: (imgMetadata at: 'name');
- yourself) ].
- result := { 'archiveItemImages' -> galleryImages } asDictionary.
- ^ result
-]
-
-{ #category : #accessing }
-ArchiveOrgItem >> metadata [
- ^ metadata
-]
-
-{ #category : #accessing }
-ArchiveOrgItem >> metadata: anObject [
- metadata := anObject
-]
-
-{ #category : #utilities }
-ArchiveOrgItem >> subjectTags [
- self id ifNil: [ ^ self ].
- self metadata ifNil: [ self getMetadata ].
- ^ (self metadata at: 'metadata') at: 'subject'
-]
-
-{ #category : #utilities }
-ArchiveOrgItem >> subjectTagsAsDictionary [
- | tagList result |
- self imagesGalleryList ifNil: [ ^ self ].
- tagList := OrderedCollection new.
- self subjectTags do: [ :tag |
- tagList
- add: (Dictionary new
- at: 'tag' put: tag;
- yourself) ].
- result := { 'tagList' -> tagList } asDictionary.
- ^ result
-]
+"
+I model information of the items published on Internet Archive (https://archive.org/).
+"
+Class {
+ #name : #ArchiveOrgItem,
+ #superclass : #Object,
+ #instVars : [
+ 'id',
+ 'metadata'
+ ],
+ #category : #Brea
+}
+
+{ #category : #utility }
+ArchiveOrgItem >> archive [
+ ^ 'https://archive.org'
+]
+
+{ #category : #utilities }
+ArchiveOrgItem >> createHtmlImageGalleryList [
+ "IMPORTANT: This is just a draft snipped. Should become a proper test o be deleted."
+ self metadata ifNil: [ self getMetadata ].
+ ^ '
+ '
+]
+
+{ #category : #utilities }
+ArchiveOrgItem >> embeddedUrl [
+
+ ^ 'https://archive.org/embed/', self id.
+]
+
+{ #category : #utilities }
+ArchiveOrgItem >> galleryItemsBaseUrl [
+ "I create the place where all image would be located for creating a custom image gallery,
+ according with the requirements for nanogallery2."
+
+ ^ 'https://', (self metadata at: 'd2'), (self metadata at: 'dir'), '/'.
+]
+
+{ #category : #operation }
+ArchiveOrgItem >> getMetadata [
+ self id ifNil: [ ^ self ].
+ self metadata: (NeoJSONReader fromString: (self archive, '/metadata/', self id) asUrl retrieveContents)
+]
+
+{ #category : #accessing }
+ArchiveOrgItem >> id [
+ ^ id
+]
+
+{ #category : #accessing }
+ArchiveOrgItem >> id: anObject [
+ id := anObject
+]
+
+{ #category : #utilities }
+ArchiveOrgItem >> imagesGalleryList [
+ self metadata ifNil: [ self getMetadata ].
+ ^ (self metadata at: 'files') select: [ :file | (file at: 'format') = 'JPEG Thumb' ]
+]
+
+{ #category : #utilities }
+ArchiveOrgItem >> imagesGalleryListAsDictionary [
+ | galleryImages result |
+ self imagesGalleryList ifNil: [ ^ self ].
+ galleryImages := OrderedCollection new.
+ self imagesGalleryList do: [ :imgMetadata |
+ galleryImages
+ add: (Dictionary new
+ at: 'imgOriginal' put: (imgMetadata at: 'original');
+ at: 'imgThumb' put: (imgMetadata at: 'name');
+ yourself) ].
+ result := { 'archiveItemImages' -> galleryImages } asDictionary.
+ ^ result
+]
+
+{ #category : #accessing }
+ArchiveOrgItem >> metadata [
+ ^ metadata
+]
+
+{ #category : #accessing }
+ArchiveOrgItem >> metadata: anObject [
+ metadata := anObject
+]
+
+{ #category : #utilities }
+ArchiveOrgItem >> subjectTags [
+ self id ifNil: [ ^ self ].
+ self metadata ifNil: [ self getMetadata ].
+ ^ (self metadata at: 'metadata') at: 'subject'
+]
+
+{ #category : #utilities }
+ArchiveOrgItem >> subjectTagsAsDictionary [
+ | tagList result |
+ self imagesGalleryList ifNil: [ ^ self ].
+ tagList := OrderedCollection new.
+ self subjectTags do: [ :tag |
+ tagList
+ add: (Dictionary new
+ at: 'tag' put: tag;
+ yourself) ].
+ result := { 'tagList' -> tagList } asDictionary.
+ ^ result
+]
diff --git a/repository/Brea/BreaDataSource.class.st b/repository/Brea/BreaDataSource.class.st
deleted file mode 100644
index 1de0c35..0000000
--- a/repository/Brea/BreaDataSource.class.st
+++ /dev/null
@@ -1,31 +0,0 @@
-Class {
- #name : #BreaDataSource,
- #superclass : #Object,
- #instVars : [
- 'source',
- 'queries'
- ],
- #category : #Brea
-}
-
-{ #category : #accessing }
-BreaDataSource >> queries [
- ^ queries
-]
-
-{ #category : #accessing }
-BreaDataSource >> queries: anObject [
- queries := anObject
-]
-
-{ #category : #accessing }
-BreaDataSource >> source [
- ^ source
-]
-
-{ #category : #accessing }
-BreaDataSource >> source: aDictionary [
- "Key, value pair in aDictionary contain a short name and a url pointing to a local or a remote
- resource. If is local a FileLocator should be provided."
- source := aDictionary
-]
diff --git a/repository/Brea/BreaFile.class.st b/repository/Brea/BreaFile.class.st
index cdbf0cd..01b0625 100644
--- a/repository/Brea/BreaFile.class.st
+++ b/repository/Brea/BreaFile.class.st
@@ -1,71 +1,78 @@
-"
-I model the file where contents (data and/or metadata) for the Brea CSM pages are stored.
-"
-Class {
- #name : #BreaFile,
- #superclass : #Object,
- #instVars : [
- 'folder',
- 'name'
- ],
- #category : #Brea
-}
-
-{ #category : #'instance creation' }
-BreaFile class >> fromShortName: nameString andFolder: aFileLocation [
- "I create a new BreaFile assigning priorities to the filename discovery according to
- their extension currently present in a particular folder."
- | extensions |
-
- extensions := #('md' 'json' 'yaml').
- extensions do: [ :ext | | markupFile filename |
- filename := nameString, '.', ext.
- markupFile := aFileLocation / filename.
- markupFile exists ifTrue: [ ^ self new name: filename; folder: aFileLocation ].
- ].
- ^ nil.
-]
-
-{ #category : #accessing }
-BreaFile >> contentString [
-
- self name ifNil: [ ^ nil ].
- (self name endsWith: '.md') ifTrue: [ ^ self contents contents ].
- (self name endsWith: '.json') ifTrue: [ ^ self contents asString ].
-]
-
-{ #category : #accessing }
-BreaFile >> contents [
- | file |
- self name ifNil: [ ^ nil ].
- file := self folder / self name.
- (self name endsWith: '.md') ifTrue: [ ^ Markdown fromFile: file ].
- (self name endsWith: '.json') ifTrue: [ ^ NeoJSONObject fromString: file contents ]
-]
-
-{ #category : #accessing }
-BreaFile >> folder [
- ^ folder
-]
-
-{ #category : #accessing }
-BreaFile >> folder: anObject [
- folder := anObject
-]
-
-{ #category : #accessing }
-BreaFile >> metadata [
- self name ifNil: [ ^ nil ].
- (self name endsWith: '.md') ifTrue: [ ^ self contents metadata ].
- (self name endsWith: '.json') ifTrue: [ ^ self contents ].
-]
-
-{ #category : #accessing }
-BreaFile >> name [
- ^ name
-]
-
-{ #category : #accessing }
-BreaFile >> name: anObject [
- name := anObject
-]
+"
+I model the file where contents (data and/or metadata) for the Brea CSM pages are stored.
+"
+Class {
+ #name : #BreaFile,
+ #superclass : #Object,
+ #instVars : [
+ 'folder',
+ 'name'
+ ],
+ #category : #Brea
+}
+
+{ #category : #'instance creation' }
+BreaFile class >> fromShortName: nameString andFolder: aFileLocation [
+ "I create a new BreaFile assigning priorities to the filename discovery according to
+ their extension currently present in a particular folder."
+ | extensions |
+
+ extensions := #('md' 'json' 'yaml').
+ extensions do: [ :ext | | markupFile filename |
+ filename := nameString, '.', ext.
+ markupFile := aFileLocation / filename.
+ markupFile exists ifTrue: [ ^ self new name: filename; folder: aFileLocation ].
+ ].
+ ^ nil.
+]
+
+{ #category : #accessing }
+BreaFile >> contentString [
+
+ self name ifNil: [ ^ nil ].
+ (self name endsWith: '.md') ifTrue: [ ^ self contents contents ].
+ (self name endsWith: '.json') ifTrue: [ ^ self contents asString ].
+]
+
+{ #category : #accessing }
+BreaFile >> contents [
+ | file |
+ self name ifNil: [ ^ nil ].
+ file := self folder / self name.
+ (self name endsWith: '.md') ifTrue: [ ^ Markdown fromFile: file ].
+ (self name endsWith: '.json') ifTrue: [ ^ NeoJSONObject fromString: file contents ]
+]
+
+{ #category : #accessing }
+BreaFile >> file [
+ self folder ifNil: [ ^ self ].
+ self name ifNil: [ ^ self ].
+ ^ self folder / self name.
+]
+
+{ #category : #accessing }
+BreaFile >> folder [
+ ^ folder
+]
+
+{ #category : #accessing }
+BreaFile >> folder: anObject [
+ folder := anObject
+]
+
+{ #category : #accessing }
+BreaFile >> metadata [
+ self name ifNil: [ ^ nil ].
+ (self name endsWith: '.md') ifTrue: [ ^ self contents metadata ].
+ (self name endsWith: '.json') ifTrue: [ ^ self contents asDictionary ].
+]
+
+{ #category : #accessing }
+BreaFile >> name [
+ ^ name
+]
+
+{ #category : #accessing }
+BreaFile >> name: anObject [
+ name := anObject
+]
diff --git a/repository/Brea/BreaMember.class.st b/repository/Brea/BreaMember.class.st
deleted file mode 100644
index 07e8c98..0000000
--- a/repository/Brea/BreaMember.class.st
+++ /dev/null
@@ -1,489 +0,0 @@
-"
-I model a member of a Brea site, usually a human.
-"
-Class {
- #name : #BreaMember,
- #superclass : #Object,
- #instVars : [
- 'givenName',
- 'familyName',
- 'picture',
- 'country',
- 'tags',
- 'email',
- 'password',
- 'webPresence',
- 'organizations'
- ],
- #category : #Brea
-}
-
-{ #category : #converting }
-BreaMember >> asStonModified [
- "asSton is generated a core dumped now. This renaming is trying to solve that. Maybe
- in the offical release it will be solved"
- ^ STON toStringPretty: self
-]
-
-{ #category : #accessing }
-BreaMember >> country [
- ^ country
-]
-
-{ #category : #accessing }
-BreaMember >> country: anObject [
- country := anObject
-]
-
-{ #category : #public }
-BreaMember >> countryTemplate [
- ^ '{{#country}}
-
- Country |
- {{.}} |
-
- {{/country}}' asMustacheTemplate value: self
-]
-
-{ #category : #helpers }
-BreaMember >> createTestUser [
- ^ self class new
- givenName: 'Test';
- familyName: 'User';
- country: 'Neverland';
- memberOf: 'HackBo' withWebsite: 'http://hackbo.co/';
- memberOf: 'mutabiT' withWebsite: 'http://mutabit.com/';
- website: 'http://test.user';
- twitter: '@offrayLC';
- email: 'iam@test.user';
- tags: 'just, a lot, of words, separated, by commas'.
-]
-
-{ #category : #accessing }
-BreaMember >> email [
- ^ email
-]
-
-{ #category : #accessing }
-BreaMember >> email: anEmailAddress [
- email := (SHA1 new hashMessage: anEmailAddress) hex
-]
-
-{ #category : #accessing }
-BreaMember >> facebook [
- ^ self webPresence facebook.
-]
-
-{ #category : #accessing }
-BreaMember >> facebook: aProfileName [
- aProfileName = ''
- ifTrue: [ self webPresence facebook: nil ]
- ifFalse: [ self webPresence facebook: aProfileName ]
-]
-
-{ #category : #public }
-BreaMember >> facebookTemplate [
- ^ '{{#facebook}}
-
-
- Facebook |
-
-
- {{.}} |
-
- {{/facebook}}' asMustacheTemplate value: self
-]
-
-{ #category : #accessing }
-BreaMember >> familyName [
- ^ familyName
-]
-
-{ #category : #accessing }
-BreaMember >> familyName: anObject [
- familyName := anObject
-]
-
-{ #category : #helpers }
-BreaMember >> fullName [
- ^ self givenName asLowercase, '-', self familyName asLowercase
-]
-
-{ #category : #accessing }
-BreaMember >> getGenericProfilePicture [
- "Other considered avatars where:
- 'https://upload.wikimedia.org/wikipedia/commons/1/1e/Default-avatar.jpg'"
- self picture: 'https://www.jamf.com/jamf-nation/img/default-avatars/generic-user.png'.
- ^ picture
-]
-
-{ #category : #accessing }
-BreaMember >> givenName [
- ^ givenName
-]
-
-{ #category : #accessing }
-BreaMember >> givenName: anObject [
- givenName := anObject
-]
-
-{ #category : #public }
-BreaMember >> head [
- ^ '', self headMeta, self headTitle, self headStyles,''
-]
-
-{ #category : #utility }
-BreaMember >> headMeta [
- ^ '
-
-
- '
-]
-
-{ #category : #utility }
-BreaMember >> headStyles [
- ^ '
-
-
-
-
-
- '
-]
-
-{ #category : #utility }
-BreaMember >> headTitle [
- ^ self headTitled: 'GIG: Network'
-]
-
-{ #category : #utility }
-BreaMember >> headTitled: aString [
- ^ '', aString ,''
-]
-
-{ #category : #public }
-BreaMember >> html [
- "I show the member profile as HTML"
- ^ self head, self htmlOutput
-]
-
-{ #category : #public }
-BreaMember >> htmlInput [
- "I capture data in a HTML Form and use it to create a new BreaMember"
- ^ '
-
-
-
-
-
-
-
- Add Member | GIG Network
-
-
-
-
-
-
-
-
-
-
-'
-]
-
-{ #category : #public }
-BreaMember >> htmlOutput [
-
- ^ self htmlOutputTemplate asMustacheTemplate value: self
-]
-
-{ #category : #public }
-BreaMember >> htmlOutputTemplate [
- "I show the member profile as HTML"
- ^ '
-
-
-
{{givenName}} {{familyName}}
-
-
-
-
-
-
- Name |
- {{givenName}} {{familyName}} |
-
',
- self countryTemplate,
- self organizationsTemplate,
- self websiteTemplate,
- self twitterTemplate,
- self facebookTemplate,
- self tagsTemplate,
- '
-
-
-
-
-
-
- '
-]
-
-{ #category : #accessing }
-BreaMember >> instagram [
- ^ self webPresence instagram.
-]
-
-{ #category : #accessing }
-BreaMember >> instagram: aProfileName [
- self webPresence instagram: aProfileName
-]
-
-{ #category : #accessing }
-BreaMember >> memberOf: anOrgName [
- self organizations add:
- (BreaOrganization new name: anOrgName)
-]
-
-{ #category : #accessing }
-BreaMember >> memberOf: anOrgName withWebsite: aUrl [
- self organizations add:
- (BreaOrganization new
- name: anOrgName;
- website: aUrl)
-]
-
-{ #category : #accessing }
-BreaMember >> organizations [
- ^ organizations ifNil: [ organizations := OrderedCollection new ]
-]
-
-{ #category : #accessing }
-BreaMember >> organizations: anOrgListOrName [
- anOrgListOrName splitOn: ',' do: [ :each | self memberOf: each ]
-]
-
-{ #category : #public }
-BreaMember >> organizationsTemplate [
- ^ '
-
- Organization(s) |
-
- {{#organizations}}
- {{name}}
- {{/organizations}}
- |
-
' asMustacheTemplate value: self
-]
-
-{ #category : #accessing }
-BreaMember >> password [
- ^ password
-]
-
-{ #category : #accessing }
-BreaMember >> password: anObject [
- password := anObject
-]
-
-{ #category : #accessing }
-BreaMember >> picture [
- ^ picture ifNil: [ ^ self getGenericProfilePicture ]
-]
-
-{ #category : #accessing }
-BreaMember >> picture: anImageFilePath [
- picture := anImageFilePath
-]
-
-{ #category : #helpers }
-BreaMember >> renderTestUserAsHtml [
- ^ self class new createTestUser html
-]
-
-{ #category : #'server handling' }
-BreaMember >> storeInto: aFileDirectory [
- | folder file |
- folder := (aFileDirectory asFileReference / self fullName) ensureCreateDirectory.
- file := (folder / 'info.ston') ensureCreateFile.
- file writeStreamDo: [:stream |
- (STON writer on: stream)
- newLine: String crlf;
- prettyPrint: true;
- nextPut: self]
-]
-
-{ #category : #accessing }
-BreaMember >> tags [
- ^ tags
-]
-
-{ #category : #accessing }
-BreaMember >> tags: anObject [
- tags := anObject
-]
-
-{ #category : #public }
-BreaMember >> tagsTemplate [
- ^ '{{#tags}}
-
-
- Tags
- {{.}}
- |
-
- {{/tags}}' asMustacheTemplate value: self
-]
-
-{ #category : #accessing }
-BreaMember >> twitter [
- ^ self webPresence twitter.
-]
-
-{ #category : #accessing }
-BreaMember >> twitter: aProfileName [
- aProfileName = ''
- ifTrue: [ self webPresence twitter: nil ]
- ifFalse: [ self webPresence twitter: aProfileName ]
-]
-
-{ #category : #public }
-BreaMember >> twitterTemplate [
- ^ '{{#twitter}}
-
-
- Twitter |
-
-
- {{.}} |
-
- {{/twitter}}' asMustacheTemplate value: self
-]
-
-{ #category : #accessing }
-BreaMember >> webPresence [
- ^ webPresence ifNil: [ webPresence := BreaWebPresence new ]
-]
-
-{ #category : #accessing }
-BreaMember >> webPresence: anObject [
- webPresence := anObject
-]
-
-{ #category : #accessing }
-BreaMember >> website [
- ^ self webPresence website.
-]
-
-{ #category : #accessing }
-BreaMember >> website: anUrl [
- self webPresence website: anUrl
-]
-
-{ #category : #public }
-BreaMember >> websiteTemplate [
- ^ '{{#website}}
-
- Website |
-
- {{.}}
- |
- {{/website}}' asMustacheTemplate value: self
-]
diff --git a/repository/Brea/BreaMemberTest.class.st b/repository/Brea/BreaMemberTest.class.st
deleted file mode 100644
index 162a3c5..0000000
--- a/repository/Brea/BreaMemberTest.class.st
+++ /dev/null
@@ -1,8 +0,0 @@
-"
-A BreaMemberTest is a test class for testing the behavior of BreaMember
-"
-Class {
- #name : #BreaMemberTest,
- #superclass : #TestCase,
- #category : #'Brea-Tests'
-}
diff --git a/repository/Brea/BreaOrganization.class.st b/repository/Brea/BreaOrganization.class.st
deleted file mode 100644
index 7142be6..0000000
--- a/repository/Brea/BreaOrganization.class.st
+++ /dev/null
@@ -1,32 +0,0 @@
-"
-I store the places a BreaMember is affiliated to.
-"
-Class {
- #name : #BreaOrganization,
- #superclass : #Object,
- #instVars : [
- 'name',
- 'website'
- ],
- #category : #Brea
-}
-
-{ #category : #accessing }
-BreaOrganization >> name [
- ^ name
-]
-
-{ #category : #accessing }
-BreaOrganization >> name: anObject [
- name := anObject
-]
-
-{ #category : #accessing }
-BreaOrganization >> website [
- ^ website
-]
-
-{ #category : #accessing }
-BreaOrganization >> website: anObject [
- website := anObject
-]
diff --git a/repository/Brea/BreaPage.class.st b/repository/Brea/BreaPage.class.st
index 9591c77..143b544 100644
--- a/repository/Brea/BreaPage.class.st
+++ b/repository/Brea/BreaPage.class.st
@@ -1,250 +1,262 @@
-"
-I model a wiki page of a Brea site.
-I am modelled after common wiki pages, where a document in a light markup laguage
-is converted in HTML and is expected to access document history (I am helped by
-FossilRepo for that).
-I can be used for other types of publications, like blog post though.
-"
-Class {
- #name : #BreaPage,
- #superclass : #Object,
- #instVars : [
- 'shortName',
- 'template',
- 'templateData',
- 'bodyTag',
- 'splitters',
- 'subpages',
- 'metadata',
- 'folder',
- 'file'
- ],
- #category : #Brea
-}
-
-{ #category : #operation }
-BreaPage >> bodyContentsAsHTML [
- | sourcePage |
- self contentsFile ifNil: [ ^ self ].
- sourcePage := FileLocator temp / 'wikiPage.md'.
- MarkupFile exportAsFileOn: sourcePage containing: self contents.
- ^ Pandoc markdownToHtml: sourcePage
-]
-
-{ #category : #accessing }
-BreaPage >> bodyTag [
- ^ bodyTag
-]
-
-{ #category : #accessing }
-BreaPage >> 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 : #accessing }
-BreaPage >> contents [
- | result |
- self contentsFile ifNil: [ ^ nil ].
- result := '' writeStream.
- result nextPutAll: self contentsFile contentString.
- self subpages ifNotNil: [
- self subpages do: [ :sp | | markdownTempFile |
- markdownTempFile := self folder / (sp, '.md').
- result nextPutAll: (Markdown fromFile: markdownTempFile) contents.
- ]
- ].
- ^ result contents.
-]
-
-{ #category : #operation }
-BreaPage >> contentsFile [
-
- self folder ifNil: [ ^ self ].
- self shortName ifNil: [ ^ self ].
- ^ BreaFile fromShortName: self shortName andFolder: self folder.
-]
-
-{ #category : #'as yet unclassified' }
-BreaPage >> exportAsHTML [
- | htmlContents allActions actionsArray semaphore result |
- self shortName ifNil: [ ^ self ].
- self template ifNil: [ ^ self ].
- actionsArray := { [ self populateMetadata ] future. [ self split ] future. }.
- self bodyTag ifNotNil: [ actionsArray := actionsArray copyWith: [ self populateBodyAs: self bodyTag ] future ].
- allActions := TKTFuture all: actionsArray.
- 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 folder / (self shortName, '.html' ) containing: htmlContents
-]
-
-{ #category : #accessing }
-BreaPage >> file [
- (self shortName isNil or: [ self folder isNil ]) ifTrue: [ ^ nil ].
- ^ file ifNil: [ ^ BreaFile fromShortName: self shortName andFolder: self folder ]
-]
-
-{ #category : #accessing }
-BreaPage >> file: anObject [
- file := anObject
-]
-
-{ #category : #accessing }
-BreaPage >> folder [
- ^ folder
-]
-
-{ #category : #accessing }
-BreaPage >> folder: folderFileReference [
- folder := folderFileReference
-]
-
-{ #category : #'as yet unclassified' }
-BreaPage >> htmlContents [
- self shortName ifNil: [ ^ self ].
- self template ifNil: [ ^ self ].
- ^ (MustacheTemplate on: self templateFile contents) value: self templateData.
-]
-
-{ #category : #accessing }
-BreaPage >> metadata [
- ^ metadata
-]
-
-{ #category : #accessing }
-BreaPage >> metadata: aDictionary [
- "External place where page metadata is located (on Internet or the local file system) in JSON format.
- If nil, is suposed that is placed in the Markdown file with the page contents."
- metadata := aDictionary
-]
-
-{ #category : #'as yet unclassified' }
-BreaPage >> populateBodyAs: key [
- | allActions result semaphore |
- "(self file isMarkdown and: [ self bodyTag isNil ]) ifTrue: [ ^ self ]".
- allActions := TKTFuture all: {
- [ self bodyContentsAsHTML ] future.
- }.
- semaphore := Semaphore new.
- allActions onSuccessDo: [ :values |
- result := values last.
- semaphore signal ].
- semaphore wait.
- self templateData at: key put: result contents.
- ^ self.
-]
-
-{ #category : #'as yet unclassified' }
-BreaPage >> populateExternalMetadata [
- self metadata ifNil: [ ^ self ].
- self
-]
-
-{ #category : #operation }
-BreaPage >> populateMetadata [
- | metadataTemp |
- self metadata
- ifNotNil: [ metadataTemp := self metadata ]
- ifNil: [ metadataTemp := self contentsFile metadata].
- metadataTemp keysAndValuesDo: [ :key :value |
- self templateData at: key put: value ].
- ^ templateData
-]
-
-{ #category : #accessing }
-BreaPage >> shortName [
- ^ shortName
-]
-
-{ #category : #accessing }
-BreaPage >> shortName: aString [
- "The name of the file tha contains the light markup to produce the web page, without file extension.
- By default I work with Markdown files."
- shortName := aString
-]
-
-{ #category : #'as yet unclassified' }
-BreaPage >> split [
- self splitters keysAndValuesDo: [ :key :value | self split: key with: value ].
-]
-
-{ #category : #'as yet unclassified' }
-BreaPage >> split: key with: subkey [
- "I split a comma separated collection of subkeys stored in the 'key' field and name each one as 'subkey'
- to put it indiviudally in a Mustache template."
- | allSubkeys cleaned data |
- allSubkeys := (self populateMetadata at: key) splitOn: ','.
- cleaned := allSubkeys collect: [ :item | item withBlanksCondensed ].
- data := OrderedCollection new.
- cleaned do: [ :item |
- data add: { subkey -> item } asDictionary ].
- self populateMetadata at: key put: data; yourself.
-]
-
-{ #category : #'as yet unclassified' }
-BreaPage >> splitterAt: key with: subkey [
- self splitters at: key put: subkey
-]
-
-{ #category : #accessing }
-BreaPage >> splitters [
- ^ splitters ifNil: [ splitters := Dictionary new ]
-]
-
-{ #category : #accessing }
-BreaPage >> splitters: aDictionary [
- "I model the pattern where a Mustache template contains something like
- {{# key}} {{value}} {{/ key}} and has data that needs to be split before injecting it in the template."
- splitters := aDictionary
-]
-
-{ #category : #accessing }
-BreaPage >> subpages [
- ^ subpages
-]
-
-{ #category : #accessing }
-BreaPage >> subpages: shortNamesList [
- "I am used when a page is composed of other subpages (for example with link aliases) that are shared
- accross several pages."
- subpages := shortNamesList
-]
-
-{ #category : #accessing }
-BreaPage >> template [
- ^ template
-]
-
-{ #category : #accessing }
-BreaPage >> template: mustacheFileName [
- "Usually templates and their pages are located in the same folder."
- template := mustacheFileName
-]
-
-{ #category : #accessing }
-BreaPage >> templateData [
- ^ templateData ifNil: [ templateData := Dictionary new ]
-]
-
-{ #category : #accessing }
-BreaPage >> templateData: aDictionary [
- templateData := aDictionary
-]
-
-{ #category : #'as yet unclassified' }
-BreaPage >> templateFile [
- self folder ifNil: [ ^ self ].
- self template ifNil: [ ^ self ].
- ^ self folder / self template
-]
+"
+I model a wiki page of a Brea site.
+I am modelled after common wiki pages, where a document in a light markup laguage
+is converted in HTML and is expected to access document history (I am helped by
+FossilRepo for that).
+I can be used for other types of publications, like blog post though.
+"
+Class {
+ #name : #BreaPage,
+ #superclass : #Object,
+ #instVars : [
+ 'shortName',
+ 'template',
+ 'templateData',
+ 'bodyTag',
+ 'splitters',
+ 'subpages',
+ 'metadata',
+ 'folder',
+ 'file'
+ ],
+ #category : #Brea
+}
+
+{ #category : #operation }
+BreaPage >> bodyContentsAsHTML [
+ | sourcePage |
+ self contentsFile ifNil: [ ^ self ].
+ Smalltalk os isWindows ifTrue: [
+ ^ Pandoc markdownToHtml: self file file
+ ].
+ sourcePage := FileLocator temp / 'wikiPage.md'.
+ MarkupFile exportAsFileOn: sourcePage containing: self contents.
+ ^ Pandoc markdownToHtml: sourcePage
+]
+
+{ #category : #accessing }
+BreaPage >> bodyTag [
+ ^ bodyTag
+]
+
+{ #category : #accessing }
+BreaPage >> 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 : #accessing }
+BreaPage >> contents [
+ | result |
+ self contentsFile ifNil: [ ^ nil ].
+ result := '' writeStream.
+ result nextPutAll: self contentsFile contentString.
+ self subpages ifNotNil: [
+ self subpages do: [ :sp | | markdownTempFile |
+ markdownTempFile := self folder / (sp, '.md').
+ result nextPutAll: (Markdown fromFile: markdownTempFile) contents.
+ ]
+ ].
+ ^ result contents.
+]
+
+{ #category : #operation }
+BreaPage >> contentsFile [
+
+ self folder ifNil: [ ^ self ].
+ self shortName ifNil: [ ^ self ].
+ ^ BreaFile fromShortName: self shortName andFolder: self folder.
+]
+
+{ #category : #'as yet unclassified' }
+BreaPage >> exportAsHTML [
+ | htmlContents allActions actionsArray semaphore result |
+ self shortName ifNil: [ ^ self ].
+ self template ifNil: [ ^ self ].
+ actionsArray := { [ self populateMetadata ] future. }.
+ self splitters ifNotEmpty: [ actionsArray := actionsArray copyWith: [ self split ] future ].
+ self bodyTag ifNotNil: [
+ actionsArray := actionsArray copyWith: [ self populateBodyAs: self bodyTag ] future ].
+ allActions := TKTFuture all: actionsArray.
+ 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 folder / (self shortName, '.html' ) containing: htmlContents
+]
+
+{ #category : #accessing }
+BreaPage >> file [
+ (self shortName isNil or: [ self folder isNil ]) ifTrue: [ ^ nil ].
+ ^ file ifNil: [ ^ BreaFile fromShortName: self shortName andFolder: self folder ]
+]
+
+{ #category : #accessing }
+BreaPage >> file: anObject [
+ file := anObject
+]
+
+{ #category : #accessing }
+BreaPage >> folder [
+ ^ folder
+]
+
+{ #category : #accessing }
+BreaPage >> folder: folderFileReference [
+ folder := folderFileReference
+]
+
+{ #category : #'as yet unclassified' }
+BreaPage >> htmlContents [
+ self shortName ifNil: [ ^ self ].
+ self template ifNil: [ ^ self ].
+ ^ (MustacheTemplate on: self templateFile contents) value: self templateData.
+]
+
+{ #category : #accessing }
+BreaPage >> metadata [
+ ^ metadata ifNil: [ self contentsFile metadata ]
+]
+
+{ #category : #accessing }
+BreaPage >> metadata: aDictionary [
+ "External place where page metadata is located (on Internet or the local file system) in JSON format.
+ If nil, is suposed that is placed in the Markdown file with the page contents."
+ metadata := aDictionary
+]
+
+{ #category : #'as yet unclassified' }
+BreaPage >> populateBodyAs: key [
+ | allActions result semaphore |
+
+ allActions := TKTFuture all: {
+ [ self bodyContentsAsHTML ] future.
+ }.
+ semaphore := Semaphore new.
+ allActions onSuccessDo: [ :values |
+ result := values last.
+ semaphore signal ].
+ semaphore wait.
+ self templateData at: key put: result contents.
+ ^ self.
+]
+
+{ #category : #'as yet unclassified' }
+BreaPage >> populateExternalMetadata [
+ self metadata ifNil: [ ^ self ].
+ self
+]
+
+{ #category : #operation }
+BreaPage >> populateMetadata [
+ | metadataTemp |
+ self metadata
+ ifNotNil: [ metadataTemp := self metadata ]
+ ifNil: [ metadataTemp := self contentsFile metadata].
+ metadataTemp keysAndValuesDo: [ :key :value |
+ self templateData at: key put: value ].
+ ^ templateData
+]
+
+{ #category : #operation }
+BreaPage >> populateTaggedBody [
+ self bodyTag ifNil: [ ^ self ].
+ ^ self populateBodyAs: self bodyTag.
+]
+
+{ #category : #accessing }
+BreaPage >> shortName [
+ ^ shortName
+]
+
+{ #category : #accessing }
+BreaPage >> shortName: aString [
+ "The name of the file tha contains the light markup to produce the web page, without file extension.
+ By default I work with Markdown files."
+ shortName := aString
+]
+
+{ #category : #'as yet unclassified' }
+BreaPage >> split [
+ self splitters ifEmpty: [ ^ self ].
+ self splitters keysAndValuesDo: [ :key :value | self split: key with: value ].
+]
+
+{ #category : #'as yet unclassified' }
+BreaPage >> split: key with: subkey [
+ "I split a comma separated collection of subkeys stored in the 'key' field and name each one as 'subkey'
+ to put it indiviudally in a Mustache template."
+ | allSubkeys cleaned data |
+ allSubkeys := (self populateMetadata at: key) splitOn: ','.
+ cleaned := allSubkeys collect: [ :item | item withBlanksCondensed ].
+ data := OrderedCollection new.
+ cleaned do: [ :item |
+ data add: { subkey -> item } asDictionary ].
+ self populateMetadata at: key put: data; yourself.
+]
+
+{ #category : #'as yet unclassified' }
+BreaPage >> splitterAt: key with: subkey [
+ self splitters at: key put: subkey
+]
+
+{ #category : #accessing }
+BreaPage >> splitters [
+ ^ splitters ifNil: [ splitters := Dictionary new ]
+]
+
+{ #category : #accessing }
+BreaPage >> splitters: aDictionary [
+ "I model the pattern where a Mustache template contains something like
+ {{# key}} {{value}} {{/ key}} and has data that needs to be split before injecting it in the template."
+ splitters := aDictionary
+]
+
+{ #category : #accessing }
+BreaPage >> subpages [
+ ^ subpages
+]
+
+{ #category : #accessing }
+BreaPage >> subpages: shortNamesList [
+ "I am used when a page is composed of other subpages (for example with link aliases) that are shared
+ accross several pages."
+ subpages := shortNamesList
+]
+
+{ #category : #accessing }
+BreaPage >> template [
+ ^ template
+]
+
+{ #category : #accessing }
+BreaPage >> template: mustacheFileName [
+ "Usually templates and their pages are located in the same folder."
+ template := mustacheFileName
+]
+
+{ #category : #accessing }
+BreaPage >> templateData [
+ ^ templateData ifNil: [ templateData := Dictionary new ]
+]
+
+{ #category : #accessing }
+BreaPage >> templateData: aDictionary [
+ templateData := aDictionary
+]
+
+{ #category : #'as yet unclassified' }
+BreaPage >> templateFile [
+ self folder ifNil: [ ^ self ].
+ self template ifNil: [ ^ self ].
+ ^ self folder / self template
+]
diff --git a/repository/Brea/BreaTemplate.class.st b/repository/Brea/BreaTemplate.class.st
deleted file mode 100644
index f23e4f9..0000000
--- a/repository/Brea/BreaTemplate.class.st
+++ /dev/null
@@ -1,89 +0,0 @@
-"
-I define a [Mustache][1] template and how it is used to create
-derivate output files combining it with particular data sources.
-
-[1]: https://mustache.github.io/
-"
-Class {
- #name : #BreaTemplate,
- #superclass : #Object,
- #instVars : [
- 'template',
- 'data',
- 'location',
- 'queries',
- 'outputs'
- ],
- #category : #Brea
-}
-
-{ #category : #adding }
-BreaTemplate >> addDataSourceNamed: name with: source [
- self
- data at: name put: source.
- self data.
-]
-
-{ #category : #accessing }
-BreaTemplate >> data [
- ^ data ifNil: [ data := Dictionary new ]
-]
-
-{ #category : #accessing }
-BreaTemplate >> data: aDictionary [
- "Each item in the dictionary is a unique alias (as key) and a data location (as value),
- usually on the web.
- Alias and locations are used later to define data queries to feed into templates."
- data := aDictionary
-]
-
-{ #category : #accessing }
-BreaTemplate >> location [
- ^ location
-]
-
-{ #category : #accessing }
-BreaTemplate >> location: aFolderPath [
- "This is the place where a template and its derivate files are located.
- A shared location is an easy approach to start with and creates more explicit
- relation between derived files and templates.
- Eventually some re-mapping or re-routing could be used so templates and their outputs
- could be further apart."
- location := aFolderPath
-]
-
-{ #category : #accessing }
-BreaTemplate >> outputs [
- ^ outputs
-]
-
-{ #category : #accessing }
-BreaTemplate >> outputs: fileNamesList [
- "fileNamesList contain the files which are derived from the template."
- outputs := fileNamesList
-]
-
-{ #category : #accessing }
-BreaTemplate >> queries [
- ^ queries ifNil: [ queries := Dictionary new ]
-]
-
-{ #category : #accessing }
-BreaTemplate >> queries: aDictionary [
- "aDictionary contains the alias for the query as key and a block that will be executed
- on a particular data source, as value."
- queries := aDictionary
-]
-
-{ #category : #accessing }
-BreaTemplate >> template [
- ^ template
-]
-
-{ #category : #accessing }
-BreaTemplate >> template: aFileName [
- "I provide the name of the mustache base template.
- The file can have any name, but by convention they end in '.mus.html' 'mus.md' and
- so on."
- template := aFileName
-]
diff --git a/repository/Brea/BreaTheme.class.st b/repository/Brea/BreaTheme.class.st
index 8dc2f20..5413050 100644
--- a/repository/Brea/BreaTheme.class.st
+++ b/repository/Brea/BreaTheme.class.st
@@ -1,204 +1,204 @@
-"
-I model a web theme.
-
-For the Collaborators Part: State my main collaborators and one line about how I interact with them.
-
-Public API and Key Messages
-
-- message one
-- message two
-- (for bonus points) how to create instances.
-
- One simple example is simply gorgeous.
-
-Internal Representation and Key Implementation Points.
-
- Instance Variables
- name: