Prototyping copying pages. Snippets' order is preserved, but not (yet) hierarchy.
This commit is contained in:
parent
0a802799b2
commit
8488531726
@ -1,5 +1,23 @@
|
||||
Extension { #name : #LeDatabase }
|
||||
|
||||
{ #category : #'*MiniDocs' }
|
||||
LeDatabase >> addPageCopy: aLePage [
|
||||
| page |
|
||||
page := LePage new.
|
||||
page title: ('Copy of ', aLePage title,' (id: ', (page uid asString copyFrom: 1 to: 8), ')').
|
||||
aLePage children do: [ :snippet | | newSnippet |
|
||||
newSnippet := snippet class new.
|
||||
newSnippet className = 'LeTextSnippet' ifTrue: [ newSnippet
|
||||
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
|
||||
]
|
||||
|
||||
{ #category : #'*MiniDocs' }
|
||||
LeDatabase >> addPageFromMarkdeep: markdeepDocTree withRemote: externalDocLocation [
|
||||
| remoteMetadata divSnippets snippets page |
|
||||
|
@ -224,6 +224,15 @@ LePage >> storage [
|
||||
^ self optionAt: 'storage'
|
||||
]
|
||||
|
||||
{ #category : #'*MiniDocs' }
|
||||
LePage >> uiAddCopyButtonFor: anAction [
|
||||
<lePageAction>
|
||||
^ anAction button
|
||||
tooltip: 'Export Page';
|
||||
icon: BrGlamorousVectorIcons changes;
|
||||
action: [:aButton | aButton phlow spawnObject: (self page database addPageCopy: self page) ]
|
||||
]
|
||||
|
||||
{ #category : #'*MiniDocs' }
|
||||
LePage >> uiDefineFolderFor: anAction [
|
||||
<lePageAction>
|
||||
|
Loading…
Reference in New Issue
Block a user