Improved Markdeep exporter for snippets metadata readability.

This commit is contained in:
Offray Vladimir Luna Cárdenas 2023-10-31 13:13:31 -05:00
parent 9163d0b145
commit 056dad228a
3 changed files with 9 additions and 4 deletions

View File

@ -190,6 +190,11 @@ LePage >> removeSnippetsMetadata [
ifTrue: [ snippet options removeKey: 'metadata' ] ] ifTrue: [ snippet options removeKey: 'metadata' ] ]
] ]
{ #category : #'*MiniDocs' }
LePage >> sanitizeMetadata [
self allChildrenDepthFirst do: [:snippet | snippet sanitizeMetadata ]
]
{ #category : #'*MiniDocs' } { #category : #'*MiniDocs' }
LePage >> sharedVariablesBindings [ LePage >> sharedVariablesBindings [
| codeSnippets shared | | codeSnippets shared |

View File

@ -10,7 +10,7 @@ LeTextualSnippet >> asMarkdeep [
output output
nextPutAll: '<div st-class="' , self class greaseString , '"'; nextPutAll: '<div st-class="' , self class greaseString , '"';
nextPut: Character lf; nextPut: Character lf;
nextPutAll: ' st-data="' , (STON toString: self metadata) , '">'; nextPutAll: ' st-data="' , (STON toStringPretty: self metadata) , '">';
nextPut: Character lf; nextPut: Character lf;
nextPutAll: self markdeepCustomOpener; nextPutAll: self markdeepCustomOpener;
nextPutAll: self contentAsString; nextPutAll: self contentAsString;
@ -19,7 +19,7 @@ LeTextualSnippet >> asMarkdeep [
nextPutAll: '</div>'; nextPutAll: '</div>';
nextPut: Character lf; nextPut: Character lf;
nextPut: Character lf. nextPut: Character lf.
^ output contents ^ output contents withInternetLineEndings
] ]
{ #category : #'*MiniDocs' } { #category : #'*MiniDocs' }

View File

@ -26,8 +26,8 @@ LeYoutubeReferenceSnippet >> metadataDiv [
output output
nextPutAll: '<div st-class="' , self class greaseString , '"'; nextPutAll: '<div st-class="' , self class greaseString , '"';
nextPut: Character lf; nextPut: Character lf;
nextPutAll: ' st-data="' , (STON toString: self metadata) , '">'. nextPutAll: ' st-data="' , (STON toStringPretty: self metadata) , '">'.
^ output. ^ output contents withInternetLineEndings.
] ]
{ #category : #'*MiniDocs' } { #category : #'*MiniDocs' }