Accessing page shared variables.

This commit is contained in:
Offray Vladimir Luna Cárdenas 2022-07-27 12:11:51 -05:00
parent 3876b12eb9
commit e393519bf4
2 changed files with 25 additions and 6 deletions

View File

@ -98,11 +98,6 @@ LePage >> exportedFileName [
^ sanitized , '--' , (self uidString copyFrom: 1 to: 5) ^ sanitized , '--' , (self uidString copyFrom: 1 to: 5)
] ]
{ #category : #'*MiniDocs' }
LePage >> fileName [
^ self title asDashedLowercase, '.', ((self uidString copyFrom: 1 to: 5 ) copyWithoutAll: '/'), '.md.html'
]
{ #category : #'*MiniDocs' } { #category : #'*MiniDocs' }
LePage >> fromMarkdeepUrl: aString [ LePage >> fromMarkdeepUrl: aString [
| docTree pageMetadata | | docTree pageMetadata |
@ -184,6 +179,30 @@ LePage >> removeSnippetsMetadata [
ifTrue: [ snippet options removeKey: 'metadata' ] ] ifTrue: [ snippet options removeKey: 'metadata' ] ]
] ]
{ #category : #'*MiniDocs' }
LePage >> sharedVariablesBindings [
| codeSnippets shared |
codeSnippets := self preorderTraversal select: [:snippet |
snippet class = LePharoSnippet and: [ snippet code includesSubstring: ':=']
].
codeSnippets first in: [:snippet | | context |
context := snippet coder evaluationContext.
snippet coder doItInContext: context.
shared := context bindingStrategy bindings detect: [:each |
each isKindOf: GtSharedVariablesBindings
]
].
codeSnippets asArray allButFirstDo: [:snippet| | context|
context := snippet coder evaluationContext.
context addBindings: shared.
snippet coder doItInContext: context
].
^ shared asDictionary
]
{ #category : #'*MiniDocs' } { #category : #'*MiniDocs' }
LePage >> storage [ LePage >> storage [

View File

@ -43,5 +43,5 @@ LeTextualSnippet >> markdownCustomOpener [
{ #category : #'*MiniDocs' } { #category : #'*MiniDocs' }
LeTextualSnippet >> tags [ LeTextualSnippet >> tags [
^ self metadata at: 'tags' ^ self metadata at: 'tags' ifAbsentPut: [ Set new ]
] ]