Markdeep front page generation.
This commit is contained in:
parent
4b6853d920
commit
e7411c2075
|
@ -54,7 +54,7 @@ PubPub >> defaultTitle [
|
|||
PubPub >> downloadContents [
|
||||
| workingDirectory |
|
||||
workingDirectory := self folder / self currentLanguage / 'book'.
|
||||
self tableOfContents keysAndValuesDo: [ :name :chapterAddress | |currentFileName|
|
||||
self tableOfContentsDictionary keysAndValuesDo: [ :name :chapterAddress | |currentFileName|
|
||||
currentFileName := name, '--', chapterAddress, '.md'.
|
||||
(workingDirectory / currentFileName) asFileReference ensureDelete.
|
||||
(workingDirectory / 'markdown') asFileReference ensureDelete.
|
||||
|
@ -113,6 +113,22 @@ PubPub >> languageFolder [
|
|||
^ 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 }
|
||||
PubPub >> populateTableOfContents [
|
||||
| contentsCollection |
|
||||
|
|
|
@ -15,6 +15,30 @@ PubPubContent class >> 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 }
|
||||
PubPubContent >> fromXML: aXMLElement [
|
||||
| image anchor|
|
||||
|
@ -59,6 +83,11 @@ PubPubContent >> shortName [
|
|||
^ sanitized
|
||||
]
|
||||
|
||||
{ #category : #accessing }
|
||||
PubPubContent >> thumbnail [
|
||||
^ thumbnail
|
||||
]
|
||||
|
||||
{ #category : #accessing }
|
||||
PubPubContent >> thumbnail: anURL [
|
||||
thumbnail := anURL
|
||||
|
|
Loading…
Reference in New Issue