Markdeep front page generation.
This commit is contained in:
parent
4b6853d920
commit
e7411c2075
|
@ -54,7 +54,7 @@ PubPub >> defaultTitle [
|
||||||
PubPub >> downloadContents [
|
PubPub >> downloadContents [
|
||||||
| workingDirectory |
|
| workingDirectory |
|
||||||
workingDirectory := self folder / self currentLanguage / 'book'.
|
workingDirectory := self folder / self currentLanguage / 'book'.
|
||||||
self tableOfContents keysAndValuesDo: [ :name :chapterAddress | |currentFileName|
|
self tableOfContentsDictionary keysAndValuesDo: [ :name :chapterAddress | |currentFileName|
|
||||||
currentFileName := name, '--', chapterAddress, '.md'.
|
currentFileName := name, '--', chapterAddress, '.md'.
|
||||||
(workingDirectory / currentFileName) asFileReference ensureDelete.
|
(workingDirectory / currentFileName) asFileReference ensureDelete.
|
||||||
(workingDirectory / 'markdown') asFileReference ensureDelete.
|
(workingDirectory / 'markdown') asFileReference ensureDelete.
|
||||||
|
@ -113,6 +113,22 @@ PubPub >> languageFolder [
|
||||||
^ self folder / self currentLanguage
|
^ self folder / self currentLanguage
|
||||||
]
|
]
|
||||||
|
|
||||||
|
{ #category : #accessing }
|
||||||
|
PubPub >> markdeepFrontPage [
|
||||||
|
| frontPage markdeepIndex |
|
||||||
|
frontPage := Markdeep new.
|
||||||
|
frontPage
|
||||||
|
title: self defaultTitle;
|
||||||
|
file: self languageFolder / 'frontPage.md.html'.
|
||||||
|
markdeepIndex := '' writeStream.
|
||||||
|
self tableOfContents do: [:pubPubContent|
|
||||||
|
markdeepIndex
|
||||||
|
nextPutAll: pubPubContent asMarkdeepFrontPageElement
|
||||||
|
].
|
||||||
|
frontPage body: markdeepIndex contents.
|
||||||
|
^ frontPage
|
||||||
|
]
|
||||||
|
|
||||||
{ #category : #accessing }
|
{ #category : #accessing }
|
||||||
PubPub >> populateTableOfContents [
|
PubPub >> populateTableOfContents [
|
||||||
| contentsCollection |
|
| contentsCollection |
|
||||||
|
|
|
@ -15,6 +15,30 @@ PubPubContent class >> fromXML: anXMLElement [
|
||||||
^ self new fromXML: anXMLElement
|
^ self new fromXML: anXMLElement
|
||||||
]
|
]
|
||||||
|
|
||||||
|
{ #category : #accessing }
|
||||||
|
PubPubContent >> asMarkdeepFrontPageElement [
|
||||||
|
| response anchorName anchorLink markdeepFile |
|
||||||
|
response := '' writeStream.
|
||||||
|
anchorName := '[', self title,']'.
|
||||||
|
markdeepFile := './book/', self shortName,'--',self id,'.md.html'.
|
||||||
|
anchorLink := '(', markdeepFile,')'.
|
||||||
|
response
|
||||||
|
nextPutAll: '<big>', anchorName, anchorLink,'</big><br><br>';
|
||||||
|
nextPutAll: String lf.
|
||||||
|
self thumbnail ifNotNil: [ |image|
|
||||||
|
image := '
|
||||||
|
<img
|
||||||
|
src=', self thumbnail,
|
||||||
|
' width="55%"
|
||||||
|
style="width: 400px; height: 220px; object-fit: cover;"
|
||||||
|
/>'.
|
||||||
|
response nextPutAll: '<a href="',markdeepFile,'">', image, '</a>'
|
||||||
|
].
|
||||||
|
response
|
||||||
|
nextPutAll: String lf, String lf.
|
||||||
|
^ response contents
|
||||||
|
]
|
||||||
|
|
||||||
{ #category : #accessing }
|
{ #category : #accessing }
|
||||||
PubPubContent >> fromXML: aXMLElement [
|
PubPubContent >> fromXML: aXMLElement [
|
||||||
| image anchor|
|
| image anchor|
|
||||||
|
@ -59,6 +83,11 @@ PubPubContent >> shortName [
|
||||||
^ sanitized
|
^ sanitized
|
||||||
]
|
]
|
||||||
|
|
||||||
|
{ #category : #accessing }
|
||||||
|
PubPubContent >> thumbnail [
|
||||||
|
^ thumbnail
|
||||||
|
]
|
||||||
|
|
||||||
{ #category : #accessing }
|
{ #category : #accessing }
|
||||||
PubPubContent >> thumbnail: anURL [
|
PubPubContent >> thumbnail: anURL [
|
||||||
thumbnail := anURL
|
thumbnail := anURL
|
||||||
|
|
Loading…
Reference in New Issue