PubPubContent recovering after GT crash.
This commit is contained in:
parent
4b0227454b
commit
ae75337739
@ -91,6 +91,13 @@ PubPub >> extractRawTableOfContents [
|
||||
^ self extractAllContentsRaw first xpath: '//div[contains(concat(" ",normalize-space(@class)," "), " pub-preview-component ")]'
|
||||
]
|
||||
|
||||
{ #category : #accessing }
|
||||
PubPub >> extractTableOfContents [
|
||||
^ self extractRawTableOfContents collect: [:each |
|
||||
PubPubContent fromXML: each
|
||||
]
|
||||
]
|
||||
|
||||
{ #category : #accessing }
|
||||
PubPub >> folder [
|
||||
^ folder ensureCreateDirectory
|
||||
|
@ -10,6 +10,11 @@ Class {
|
||||
#category : #'MiniDocs-Model'
|
||||
}
|
||||
|
||||
{ #category : #accessing }
|
||||
PubPubContent class >> fromXML: anXMLElement [
|
||||
^ self new fromXML: anXMLElement
|
||||
]
|
||||
|
||||
{ #category : #accessing }
|
||||
PubPubContent >> fromXML: aXMLElement [
|
||||
| image anchor|
|
||||
@ -24,7 +29,28 @@ image
|
||||
anchor := (aXMLElement contentNodes second contentNodes first xpath: './div[@class="title-wrapper"]/a') first.
|
||||
self
|
||||
title: (anchor attributeAt: 'title');
|
||||
url: (anchor attributeAt: 'title').
|
||||
url: (anchor attributeAt: 'href').
|
||||
]
|
||||
|
||||
{ #category : #accessing }
|
||||
PubPubContent >> id [
|
||||
^ (self url splitOn: $/) last
|
||||
]
|
||||
|
||||
{ #category : #accessing }
|
||||
PubPubContent >> printOn: aStream [
|
||||
super printOn: aStream.
|
||||
aStream
|
||||
nextPutAll: '( ', self title,' | ', self id, ' )'
|
||||
]
|
||||
|
||||
{ #category : #accessing }
|
||||
PubPubContent >> shortName [
|
||||
| sanitized |
|
||||
sanitized := (self title splitOn: $:) first.
|
||||
sanitized := sanitized asCamelCase.
|
||||
sanitized at: 1 put: sanitized first asLowercase.
|
||||
^ sanitized
|
||||
]
|
||||
|
||||
{ #category : #accessing }
|
||||
@ -32,11 +58,21 @@ PubPubContent >> thumbnail: anURL [
|
||||
thumbnail := anURL
|
||||
]
|
||||
|
||||
{ #category : #accessing }
|
||||
PubPubContent >> title [
|
||||
^ title
|
||||
]
|
||||
|
||||
{ #category : #accessing }
|
||||
PubPubContent >> title: anObject [
|
||||
title := anObject
|
||||
]
|
||||
|
||||
{ #category : #accessing }
|
||||
PubPubContent >> url [
|
||||
^url
|
||||
]
|
||||
|
||||
{ #category : #accessing }
|
||||
PubPubContent >> url: anObject [
|
||||
url := anObject
|
||||
|
Loading…
Reference in New Issue
Block a user