Retaking Markdeep page importation.
This commit is contained in:
parent
994ce727d1
commit
ea2657883a
@ -6,17 +6,28 @@ LeDatabase >> addPageFromMarkdeepUrl: aString [
|
||||
| page |
|
||||
page := self detectLocalPageForRemote: aString.
|
||||
page ifNotNil: [ :arg | ^ self importErrorMessage: page ].
|
||||
self addPage: page.
|
||||
^ self addPageFromString: (self docTreeForLink: aString)
|
||||
]
|
||||
|
||||
{ #category : #'*MiniDocs' }
|
||||
LeDatabase >> addPageFromString: markdeepDocTree [
|
||||
^ markdeepDocTree
|
||||
|
||||
]
|
||||
|
||||
{ #category : #'*MiniDocs' }
|
||||
LeDatabase >> detectLocalPageForRemote: markdeepDocUrl [
|
||||
| markdeepHelper id remoteMetadata docTree |
|
||||
markdeepHelper := Markdeep new.
|
||||
docTree := (XMLHTMLParser on: markdeepDocUrl asUrl retrieveContents) parseDocument.
|
||||
docTree := self docTreeForLink: markdeepDocUrl.
|
||||
remoteMetadata := markdeepHelper metadataFromXML: docTree.
|
||||
id := remoteMetadata at: 'id' ifAbsent: [ ^ false ].
|
||||
^ self pageWithID: id ifAbsent: [ nil ].
|
||||
id := remoteMetadata at: 'id' ifAbsent: [ nil ].
|
||||
^ self pageWithID: id ifAbsent: [ ^ nil ].
|
||||
]
|
||||
|
||||
{ #category : #'*MiniDocs' }
|
||||
LeDatabase >> docTreeForLink: aString [
|
||||
^ (XMLHTMLParser on: aString) parseDocument
|
||||
]
|
||||
|
||||
{ #category : #'*MiniDocs' }
|
||||
|
Loading…
Reference in New Issue
Block a user