Copy of nested docs working thanks to botwhytho's LepiterBuiddingBlocs.
This commit is contained in:
parent
6a3c0332b3
commit
92a686de96
@ -14,6 +14,7 @@ BaselineOfMiniDocs >> baseline: spec [
|
|||||||
spec
|
spec
|
||||||
baseline: 'Mustache' with: [ spec repository: 'github://noha/mustache' ];
|
baseline: 'Mustache' with: [ spec repository: 'github://noha/mustache' ];
|
||||||
baseline: 'Tealight' with: [ spec repository: 'github://astares/Tealight:main/src' ];
|
baseline: 'Tealight' with: [ spec repository: 'github://astares/Tealight:main/src' ];
|
||||||
|
baseline: 'LepiterBuildingBlocs' with: [spec repository: 'github://botwhytho/LepiterBuildingBlocs:main/src'];
|
||||||
baseline: 'PetitParser' with: [
|
baseline: 'PetitParser' with: [
|
||||||
spec
|
spec
|
||||||
loads: #('Minimal' 'Core' 'Tests' 'Islands');
|
loads: #('Minimal' 'Core' 'Tests' 'Islands');
|
||||||
|
@ -2,19 +2,12 @@ Extension { #name : #LeDatabase }
|
|||||||
|
|
||||||
{ #category : #'*MiniDocs' }
|
{ #category : #'*MiniDocs' }
|
||||||
LeDatabase >> addPageCopy: aLePage [
|
LeDatabase >> addPageCopy: aLePage [
|
||||||
| page |
|
| pageTitle timestamp shortID page |
|
||||||
page := LePage new.
|
timestamp := DateAndTime now asString.
|
||||||
page title: ('Copy of ', aLePage title,' (id: ', (page uid asString copyFrom: 1 to: 8), ')').
|
pageTitle := 'Copy of ', aLePage title.
|
||||||
aLePage allChildrenDepthFirst do: [ :snippet | | newSnippet |
|
page := aLePage duplicatePageWithNewName: pageTitle, timestamp.
|
||||||
newSnippet := snippet class new.
|
shortID := '(id: ', (page uid asString copyFrom: 1 to: 8), ')'.
|
||||||
newSnippet className = 'LeTextSnippet' ifTrue: [ newSnippet
|
page title: (page title copyReplaceAll: timestamp with: shortID).
|
||||||
string: snippet contentAsString ].
|
|
||||||
newSnippet className = 'LePharoSnippet' ifTrue: [ newSnippet code: snippet contentAsString ].
|
|
||||||
newSnippet uid: LeUID new.
|
|
||||||
page addSnippet: newSnippet.
|
|
||||||
newSnippet database: self.
|
|
||||||
self registerSnippet: newSnippet ].
|
|
||||||
self addPage: page.
|
|
||||||
^ page
|
^ page
|
||||||
]
|
]
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user