Improving HedgeDoc(s) convert/import as LePage(s).

This commit is contained in:
Offray Vladimir Luna Cárdenas 2024-03-26 14:52:18 -05:00
parent 4399531c8d
commit 72f3a633ae
2 changed files with 14 additions and 5 deletions

View File

@ -27,6 +27,18 @@ HedgeDoc class >> newDefault [
defaultServer. defaultServer.
] ]
{ #category : #accessing }
HedgeDoc >> asLePage [
| newPage snippet |
snippet := LeTextSnippet new
string: self body.
newPage := LePage new
initializeTitle: self title;
addSnippet: snippet;
yourself.
^ newPage
]
{ #category : #accessing } { #category : #accessing }
HedgeDoc >> asMarkdeep [ HedgeDoc >> asMarkdeep [
^ Markdeep new ^ Markdeep new

View File

@ -55,12 +55,9 @@ LeMiniDocsImport >> database: aLeDatabase [
{ #category : #accessing } { #category : #accessing }
LeMiniDocsImport >> importHedgedoc: aURL [ LeMiniDocsImport >> importHedgedoc: aURL [
| doc text page | | doc |
doc := HedgeDoc fromLink: aURL asString. doc := HedgeDoc fromLink: aURL asString.
text := doc retrieveContents; contents. ^ database addPage: doc asLePage
page := LePage named: (doc title).
page addSnippet: (LeTextSnippet string: text).
^ database addPage: page
] ]
{ #category : #accessing } { #category : #accessing }