diff --git a/src/BaselineOfMiniDocs/BaselineOfMiniDocs.class.st b/src/BaselineOfMiniDocs/BaselineOfMiniDocs.class.st index 5ec783b..e7fd75b 100644 --- a/src/BaselineOfMiniDocs/BaselineOfMiniDocs.class.st +++ b/src/BaselineOfMiniDocs/BaselineOfMiniDocs.class.st @@ -60,9 +60,9 @@ BaselineOfMiniDocs >> semanticVersion [ BaselineOfMiniDocs >> setUpLepiterBuildingBlocs: spec [ spec baseline: 'LepiterBuildingBlocs' - with: [spec - repository: 'github://botwhytho/LepiterBuildingBlocs:main/src'; - loads: #('ALL')]; + with: [spec + repository: 'github://botwhytho/LepiterBuildingBlocs:main/src'; + loads: #('ALL')]; import: 'LepiterBuildingBlocs' ] diff --git a/src/MiniDocs/LeTextCoderSnippetElement.extension.st b/src/MiniDocs/LeTextCoderSnippetElement.extension.st index f0739d8..eb6f4ca 100644 --- a/src/MiniDocs/LeTextCoderSnippetElement.extension.st +++ b/src/MiniDocs/LeTextCoderSnippetElement.extension.st @@ -1,5 +1,20 @@ Extension { #name : #LeTextCoderSnippetElement } +{ #category : #'*MiniDocs' } +LeTextCoderSnippetElement >> asLePage [ + | currentSnippet newPage | + currentSnippet := self snippet. + newPage := LePage new. + newPage + title: (currentSnippet text asString trimLeft: [:char | char = $# ]) trim. + self page database + addPage: newPage. + currentSnippet allChildrenBreadthFirstDo: [:child | + child moveToPageTitled: newPage title. + ]. + ^ newPage +] + { #category : #'*MiniDocs' } LeTextCoderSnippetElement >> moveToPageTitled: pageName [ | db origin destination | diff --git a/src/MiniDocs/LeTextSnippet.extension.st b/src/MiniDocs/LeTextSnippet.extension.st index 5a65a0e..be0f368 100644 --- a/src/MiniDocs/LeTextSnippet.extension.st +++ b/src/MiniDocs/LeTextSnippet.extension.st @@ -64,3 +64,15 @@ LeTextSnippet >> taggedWith: aString [ self metadata at: 'tags' ifPresent: [ (self metadata at: 'tags') add: aString; yourself ] ifAbsentPut: [ Set new ]. ^ self metadata at: 'tags' ] + +{ #category : #'*MiniDocs' } +LeTextSnippet >> withFollowingSnippets [ + "I'm the same method implemented for PharoSnippets, + but present also here as a way to improve moving prose snippets from pages. + " + | snippets stop start | + snippets := self parent children asArray. + start := snippets indexOf: self. + stop := snippets size. + ^ snippets copyFrom: start to: stop +]