Improving splitting of admonition snippets.
This commit is contained in:
parent
5ccff44fc9
commit
babbd48934
@ -30,7 +30,7 @@ ByteString >> admonitionEndingPosition [
|
||||
response > 0 ifTrue: [ response := response + 1 ].
|
||||
(line trimBoth = ':::')
|
||||
ifFalse: [ response := response + line size ]
|
||||
ifTrue: [ response := response + line size. ]
|
||||
ifTrue: [ ^ response := response + line size. ]
|
||||
].
|
||||
^ response
|
||||
]
|
||||
@ -75,5 +75,6 @@ ByteString >> markdownSplitted [
|
||||
|
||||
{ #category : #'*MiniDocs' }
|
||||
ByteString >> startsWithMarkdownAdmonition [
|
||||
self lines ifEmpty: [ ^ false ].
|
||||
^ self admonitionBorders includes: self lines first trimBoth
|
||||
]
|
||||
|
@ -42,6 +42,7 @@ HedgeDoc >> asLePage [
|
||||
yourself
|
||||
].
|
||||
newPage incomingLinks.
|
||||
newPage splitAdmonitionSnippets.
|
||||
newPage options
|
||||
at: 'originalMetadata' put: self metadata;
|
||||
at: 'url' put: self url.
|
||||
|
@ -290,6 +290,22 @@ LePage >> sharedVariablesBindings [
|
||||
^ shared asDictionary
|
||||
]
|
||||
|
||||
{ #category : #'*MiniDocs' }
|
||||
LePage >> splitAdmonitionSnippets [
|
||||
"I'm used to clean after importing from HedgeDoc to ensure that a snippet contains only admonitions and extra content is put in a new cell."
|
||||
(self children select: [:node | node string startsWithMarkdownAdmonition ])
|
||||
do: [:node | | nodeContent |
|
||||
node ifNotNil: [
|
||||
nodeContent := node string.
|
||||
nodeContent startsWithMarkdownAdmonition
|
||||
ifTrue: [ | snippetCommand |
|
||||
snippetCommand := node splitSnippetCommandAtPosition: nodeContent admonitionEndingPosition.
|
||||
snippetCommand execute
|
||||
]
|
||||
]
|
||||
]
|
||||
]
|
||||
|
||||
{ #category : #'*MiniDocs' }
|
||||
LePage >> storage [
|
||||
| current |
|
||||
|
Loading…
Reference in New Issue
Block a user