GrafoscopioUtils/repository/Grafoscopio-Utils/LeSnippet.extension.st

13 lines
385 B
Smalltalk
Raw Normal View History

Extension { #name : #LeSnippet }
{ #category : #'*Grafoscopio-Utils-Core' }
LeSnippet class >> fromMetaMarkdeep: div [
| className metadata snippet |
className := (div xpath: '@st-class') stringValue.
metadata := STON fromString:(div xpath: '@st-data') stringValue.
snippet := className asClass new.
snippet injectMetadataFrom: metadata.
snippet contentFrom: div.
^ snippet.
]