Improving HedgeDoc(s) convert/import as LePage(s).
This commit is contained in:
parent
72f3a633ae
commit
60939fe2b8
@ -31,7 +31,7 @@ HedgeDoc class >> newDefault [
|
|||||||
HedgeDoc >> asLePage [
|
HedgeDoc >> asLePage [
|
||||||
| newPage snippet |
|
| newPage snippet |
|
||||||
snippet := LeTextSnippet new
|
snippet := LeTextSnippet new
|
||||||
string: self body.
|
string: self bodyWithoutTitleHeader.
|
||||||
newPage := LePage new
|
newPage := LePage new
|
||||||
initializeTitle: self title;
|
initializeTitle: self title;
|
||||||
addSnippet: snippet;
|
addSnippet: snippet;
|
||||||
@ -57,6 +57,15 @@ HedgeDoc >> asMarkdownTiddler [
|
|||||||
created: Tiddler nowLocal.
|
created: Tiddler nowLocal.
|
||||||
]
|
]
|
||||||
|
|
||||||
|
{ #category : #accessing }
|
||||||
|
HedgeDoc >> bodyWithoutTitleHeader [
|
||||||
|
| headerIndex |
|
||||||
|
headerIndex := self body lines
|
||||||
|
detectIndex: [ :line | line includesSubstring: self headerAsTitle ]
|
||||||
|
ifNone: [ ^ self body].
|
||||||
|
^ (self body lines copyWithoutIndex: headerIndex) asStringWithCr
|
||||||
|
]
|
||||||
|
|
||||||
{ #category : #accessing }
|
{ #category : #accessing }
|
||||||
HedgeDoc >> contents [
|
HedgeDoc >> contents [
|
||||||
^ super contents
|
^ super contents
|
||||||
|
Loading…
Reference in New Issue
Block a user