Extracting from populated table of contents. Debuging web preview.
This commit is contained in:
parent
356ee754bf
commit
4b6853d920
@ -129,10 +129,10 @@ LePage >> latestEditTime: aLeTime [
|
||||
{ #category : #'*MiniDocs' }
|
||||
LePage >> localHostAddress [
|
||||
| localUrl route |
|
||||
MiniDocsServer teapot server isRunning ifFalse: [ MiniDocsServer start ].
|
||||
MiniDocsServer teapot server isRunning ifFalse: [ MiniDocsServer restart ].
|
||||
route := MiniDocsServer teapot staticRouter prefix joinUsing: '/'.
|
||||
localUrl := MiniDocsServer teapot server localUrl asString.
|
||||
^ localUrl, route, '/', self markdeepFileName
|
||||
^ {localUrl, route, '/', self markdeepFileName . MiniDocsServer}
|
||||
]
|
||||
|
||||
{ #category : #'*MiniDocs' }
|
||||
|
@ -91,13 +91,6 @@ 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
|
||||
@ -120,6 +113,16 @@ PubPub >> languageFolder [
|
||||
^ self folder / self currentLanguage
|
||||
]
|
||||
|
||||
{ #category : #accessing }
|
||||
PubPub >> populateTableOfContents [
|
||||
| contentsCollection |
|
||||
contentsCollection := self extractRawTableOfContents collect: [:each |
|
||||
(PubPubContent fromXML: each)
|
||||
language: self currentLanguage
|
||||
].
|
||||
self addTableOfContents: contentsCollection asOrderedCollection
|
||||
]
|
||||
|
||||
{ #category : #accessing }
|
||||
PubPub >> printOn: aStream [
|
||||
super printOn: aStream.
|
||||
@ -133,6 +136,22 @@ PubPub >> tableOfContents [
|
||||
^ tableOfContents at: self currentLanguage
|
||||
]
|
||||
|
||||
{ #category : #accessing }
|
||||
PubPub >> tableOfContents: anObject [
|
||||
tableOfContents := anObject
|
||||
]
|
||||
|
||||
{ #category : #accessing }
|
||||
PubPub >> tableOfContentsDictionary [
|
||||
| response |
|
||||
response := OrderedDictionary new.
|
||||
self tableOfContents do: [:content |
|
||||
response
|
||||
at: content shortName put: content id
|
||||
].
|
||||
^ response
|
||||
]
|
||||
|
||||
{ #category : #accessing }
|
||||
PubPub >> titles [
|
||||
^ titles ifNil: [titles := OrderedDictionary new]
|
||||
|
@ -37,6 +37,11 @@ PubPubContent >> id [
|
||||
^ (self url splitOn: $/) last
|
||||
]
|
||||
|
||||
{ #category : #'as yet unclassified' }
|
||||
PubPubContent >> language: aString [
|
||||
language := aString
|
||||
]
|
||||
|
||||
{ #category : #accessing }
|
||||
PubPubContent >> printOn: aStream [
|
||||
super printOn: aStream.
|
||||
|
Loading…
Reference in New Issue
Block a user