Improved Markdeep exporter for LePictureSnippets.
This commit is contained in:
parent
55e786f01c
commit
9163d0b145
@ -123,7 +123,7 @@ LeDatabase >> errorCardFor: error [
|
||||
|
||||
| keepButton overwriteButton loadCopyButton errorMessageUI localPage errorKey |
|
||||
|
||||
errorKey := error keys first.
|
||||
errorKey := error keys last.
|
||||
localPage := self pageWithID: errorKey.
|
||||
keepButton := BrButton new
|
||||
aptitude: BrGlamorousButtonWithIconAndLabelAptitude;
|
||||
@ -186,7 +186,7 @@ LeDatabase >> gtViewErrorDetailsOn: aView [
|
||||
LeDatabase >> gtViewErrorDetailsOn: aView withKey: erroKey [
|
||||
<gtView>
|
||||
^ aView explicit
|
||||
title: 'Errors' translated;
|
||||
title: 'Errors beta' translated;
|
||||
priority: 5;
|
||||
stencil: [ | container |
|
||||
container := BlElement new
|
||||
|
@ -9,7 +9,7 @@ LePharoSnippet >> contentAsStringCustomized [
|
||||
]
|
||||
|
||||
{ #category : #'*MiniDocs' }
|
||||
LePharoSnippet >> contentFrom: markdeepDiv [
|
||||
LePharoSnippet >> fromMarkdeep: markdeepDiv [
|
||||
|
||||
^ markdeepDiv asSnippetDictionary asLepiterSnippet
|
||||
]
|
||||
|
@ -25,6 +25,11 @@ LePictureSnippet >> asMarkdeep [
|
||||
^ output contents
|
||||
]
|
||||
|
||||
{ #category : #'*MiniDocs' }
|
||||
LePictureSnippet >> fromMarkdeep: markdeepDiv [
|
||||
^ markdeepDiv asSnippetDictionary asLepiterSnippet
|
||||
]
|
||||
|
||||
{ #category : #'*MiniDocs' }
|
||||
LePictureSnippet >> metadata [
|
||||
^ self optionAt: 'metadata' ifAbsentPut: [ self metadataInit ]
|
||||
@ -37,8 +42,9 @@ LePictureSnippet >> metadataDiv [
|
||||
output
|
||||
nextPutAll: '<div st-class="' , self class greaseString , '"';
|
||||
nextPut: Character lf;
|
||||
nextPutAll: ' st-data="' , (STON toString: self metadata) , '">'.
|
||||
^ output.
|
||||
nextPutAll: ' st-data="' , (STON toStringPretty: self metadata) , '">';
|
||||
nextPut: Character lf.
|
||||
^ output contents withInternetLineEndings.
|
||||
|
||||
]
|
||||
|
||||
|
@ -7,7 +7,7 @@ LeSnippet class >> fromMetaMarkdeep: div [
|
||||
metadata := STON fromString:(div xpath: '@st-data') stringValue.
|
||||
snippet := className asClass new.
|
||||
snippet injectMetadataFrom: metadata.
|
||||
snippet contentFrom: div.
|
||||
snippet fromMarkdeep: div.
|
||||
^ snippet.
|
||||
]
|
||||
|
||||
@ -21,3 +21,13 @@ LeSnippet >> moveToPageTitled: pageName [
|
||||
origin removeSnippet: thisSnippet.
|
||||
destination addSnippet: thisSnippet.
|
||||
]
|
||||
|
||||
{ #category : #'*MiniDocs' }
|
||||
LeSnippet >> sanitizeMetadata [
|
||||
self metadata keysAndValuesDo: [:k :v |
|
||||
(v includesAny: #($< $>))
|
||||
ifTrue: [
|
||||
self metadata at: k put: (v copyWithoutAll: #($< $>))
|
||||
]
|
||||
]
|
||||
]
|
||||
|
@ -14,7 +14,7 @@ LeTextSnippet >> asLePage [
|
||||
]
|
||||
|
||||
{ #category : #'*MiniDocs' }
|
||||
LeTextSnippet >> contentFrom: markdeepDiv [
|
||||
LeTextSnippet >> fromMarkdeep: markdeepDiv [
|
||||
|
||||
^ markdeepDiv asSnippetDictionary asLepiterSnippet
|
||||
]
|
||||
|
Loading…
Reference in New Issue
Block a user