Refactoring, so functionality can be called without the GUI.
This commit is contained in:
parent
9ae7a6ec62
commit
8fb6373a83
@ -184,6 +184,16 @@ LeDatabase >> gtViewErrorDetailsOn: aView withKey: erroKey [
|
||||
].
|
||||
]
|
||||
|
||||
{ #category : #'*MiniDocs' }
|
||||
LeDatabase >> importDocumentFrom: aURL [
|
||||
| doc |
|
||||
"Using file extension in URL as a cheap (non-robuts) way of detecting the kind of document.
|
||||
Better file type detection should be implemented in the future."
|
||||
(aURL endsWith: '.md.html') ifTrue: [ ^ self addPageFromMarkdeepUrl: aURL ].
|
||||
doc := HedgeDoc fromLink: aURL asString.
|
||||
^ self addPage: doc asLePage
|
||||
]
|
||||
|
||||
{ #category : #'*MiniDocs' }
|
||||
LeDatabase >> importErrorForLocal: page withRemote: externalDocLocation [
|
||||
|
||||
|
@ -42,22 +42,25 @@ LeMiniDocsImport >> createURLeditable [
|
||||
text: 'Document link';
|
||||
switchToEditor.
|
||||
editable when: BrEditorAcceptWish do: [ :aWish |
|
||||
self importHedgedoc: aWish text asString.
|
||||
self importDocumentFrom: aWish text asString.
|
||||
].
|
||||
base addChild: editable.
|
||||
^ base
|
||||
]
|
||||
|
||||
{ #category : #accessing }
|
||||
LeMiniDocsImport >> database [
|
||||
^ database
|
||||
]
|
||||
|
||||
{ #category : #accessing }
|
||||
LeMiniDocsImport >> database: aLeDatabase [
|
||||
database := aLeDatabase
|
||||
]
|
||||
|
||||
{ #category : #accessing }
|
||||
LeMiniDocsImport >> importHedgedoc: aURL [
|
||||
| doc |
|
||||
doc := HedgeDoc fromLink: aURL asString.
|
||||
^ database addPage: doc asLePage
|
||||
LeMiniDocsImport >> importDocumentFrom: aURL [
|
||||
^ self database importDocumentFrom: aURL.
|
||||
]
|
||||
|
||||
{ #category : #accessing }
|
||||
|
Loading…
Reference in New Issue
Block a user