diff --git a/src/Microdown-Blog-Tests/MicDummyBlogDeployer.class.st b/src/Microdown-Blog-Tests/MicDummyBlogDeployer.class.st index 475b5c6d..e50ed7a7 100644 --- a/src/Microdown-Blog-Tests/MicDummyBlogDeployer.class.st +++ b/src/Microdown-Blog-Tests/MicDummyBlogDeployer.class.st @@ -38,7 +38,8 @@ MicDummyBlogDeployer >> go [ self deploy. MicBlogCreator createFrom: FileSystem workingDirectory / self sourceFolder - to: self outputDirectory. + to: self outputDirectory + withRoot: ''. self launchHTTPServer. 1 seconds wait. self launchBrowser diff --git a/src/Microdown-Blog-Tests/MicFileTestResources.class.st b/src/Microdown-Blog-Tests/MicFileTestResources.class.st index a92212f0..78a1804e 100644 --- a/src/Microdown-Blog-Tests/MicFileTestResources.class.st +++ b/src/Microdown-Blog-Tests/MicFileTestResources.class.st @@ -10,7 +10,7 @@ MicFileTestResources >> dumperInput1 [ | root | root := Microdown parse: - '# [A Cool Story](' , '' , '/anExample1.html' , '' , ')'. + '### [A Cool Story](' , '' , '/anExample1.html' , '' , ')'. root children add: (Microdown parse: '2019/01/09') children first. root children add: (Microdown parse: 'Pharo is cool but this is a superlong paragraph Simple powerful language: No constructors, no...') @@ -24,7 +24,8 @@ MicFileTestResources >> dumperInput1WithRootPath [ | root | root := Microdown parse: - '# [A Cool Story](' , '' , self genericNonEmptyRootPath, '/anExample1.html' , '' , ')'. + '### [A Cool Story](' , '' , self genericNonEmptyRootPath + , '/anExample1.html' , '' , ')'. root children add: (Microdown parse: '2019/01/09') children first. root children add: (Microdown parse: 'Pharo is cool but this is a superlong paragraph Simple powerful language: No constructors, no...') @@ -38,9 +39,8 @@ MicFileTestResources >> dumperInput2 [ | root | root := Microdown parse: - '# [Pharo is cool](' , '' , '/anExample2.html' , '' , ')'. - root children add: - (Microdown parse: '2019/01/22') children first. + '### [Pharo is cool](' , '' , '/anExample2.html' , '' , ')'. + root children add: (Microdown parse: '2019/01/22') children first. root children add: (Microdown parse: 'If you are either a beginner or an expert in object-oriented programming, this MOOC will...') children first. @@ -53,9 +53,9 @@ MicFileTestResources >> dumperInput2WithRootPath [ | root | root := Microdown parse: - '# [Pharo is cool](' , '' , self genericNonEmptyRootPath, '/anExample2.html' , '' , ')'. - root children add: - (Microdown parse: '2019/01/22') children first. + '### [Pharo is cool](' , '' , self genericNonEmptyRootPath + , '/anExample2.html' , '' , ')'. + root children add: (Microdown parse: '2019/01/22') children first. root children add: (Microdown parse: 'If you are either a beginner or an expert in object-oriented programming, this MOOC will...') children first. @@ -68,9 +68,8 @@ MicFileTestResources >> dumperInput3 [ | root | root := Microdown parse: - '# [Mooc Pharo](' , '' , '/anExample3.html' , '' , ')'. - root children add: - (Microdown parse: '2018/01/29') children first. + '### [Mooc Pharo](' , '' , '/anExample3.html' , '' , ')'. + root children add: (Microdown parse: '2018/01/29') children first. root children add: (Microdown parse: 'Welcome to the Pharo Mooc (a set of videos, exercises, challenges, and miniprojects).') children first. @@ -83,9 +82,9 @@ MicFileTestResources >> dumperInput3WithRootPath [ | root | root := Microdown parse: - '# [Mooc Pharo](' , '' , self genericNonEmptyRootPath, '/anExample3.html' , '' , ')'. - root children add: - (Microdown parse: '2018/01/29') children first. + '### [Mooc Pharo](' , '' , self genericNonEmptyRootPath + , '/anExample3.html' , '' , ')'. + root children add: (Microdown parse: '2018/01/29') children first. root children add: (Microdown parse: 'Welcome to the Pharo Mooc (a set of videos, exercises, challenges, and miniprojects).') children first. diff --git a/src/Microdown-Blog/MicBlogCreator.class.st b/src/Microdown-Blog/MicBlogCreator.class.st index 95544ee1..3afb5c1c 100644 --- a/src/Microdown-Blog/MicBlogCreator.class.st +++ b/src/Microdown-Blog/MicBlogCreator.class.st @@ -101,7 +101,7 @@ MicBlogCreator >> createAllHtmlFile [ listOfSingleSummary := allFileParse collect: [ :each | MicSingleSummarizer new targetDirectory: targetDirectory; - root: root; + root: root; summarize: each ]. self sortSingleSummarizedDocuments: listOfSingleSummary. self generateRecentpost: listOfSingleSummary. @@ -205,8 +205,8 @@ MicBlogCreator >> generateRecentpost: listOfMicSingleSummarized [ MicBlogCreator >> initialize [ super initialize. - self cssFrameworkName: 'Axist'. - sum := MicListSummarizer new. + self cssFrameworkName: 'ClasslessCSS'. + sum := MicListSummarizer new ] { #category : 'rendering' } @@ -232,20 +232,25 @@ MicBlogCreator >> initializeMonthList: singleSummarizedDocuments [ MicBlogCreator >> mustacheAssembly: htmlString [ | context | - context := Dictionary new - at: 'content' put: htmlString; - at: 'recentPost' put: (MicHTMLVisitor new visit: recentPost copy) first contents; - at: 'archive' put: (MicHTMLVisitor new visit: dateList copy) first contents; - yourself. - - ^ (MustacheTemplate on: self mustacheTemplate) value: context + at: 'homeLink' put: self root , '/'; + at: 'content' put: htmlString; + at: 'recentPost' + put: + (MicHTMLVisitor new visit: recentPost copy) first + contents; + at: 'archive' + put: + (MicHTMLVisitor new visit: dateList copy) first contents; + yourself. + + ^ (MustacheTemplate on: self mustacheTemplate) value: context ] { #category : 'rendering' } MicBlogCreator >> mustacheTemplate [ - ^ '

Weekly news about Pharo

+ ^ '

Weekly news about Pharo

Everything you wanted to know about http://www.pharo.org without being forced to read 1000 mails

diff --git a/src/Microdown-Blog/MicSingleSummarizer.class.st b/src/Microdown-Blog/MicSingleSummarizer.class.st index a2f396a8..045b3c9a 100644 --- a/src/Microdown-Blog/MicSingleSummarizer.class.st +++ b/src/Microdown-Blog/MicSingleSummarizer.class.st @@ -19,12 +19,12 @@ MicSingleSummarizer >> firstHeaderBlockOf: aMicRootBlock [ h := MicHeaderBlock new. t := MicTextBlock new bodyString: 'Please define a header'. - h level: 1. + h level: 3. t parent: h. ^ h ]. newHeader := MicHeaderBlock new. header headerElements do: [ :t | t copy parent: newHeader ]. - newHeader level: header level. + newHeader level: 3. ^ newHeader ] @@ -54,12 +54,12 @@ MicSingleSummarizer >> headerLink: aMicRootBlock [ | headerLink header fileReference | headerLink := MicHeaderBlock new. header := self firstHeaderBlockOf: aMicRootBlock. - + self verifyFromFile: aMicRootBlock. fileReference := (aMicRootBlock fromFile withoutExtension fullName - withoutPrefix: targetDirectory fullName) , '.html'. - fileReference := fileReference asFileReference. + withoutPrefix: targetDirectory fullName) , '.html'. + fileReference := fileReference asFileReference. headerLink addChild: (self makeALink: header text to: fileReference);