Improved Markdown exportation for better Pandoc conversions between formats.

This commit is contained in:
Offray Vladimir Luna Cárdenas 2023-12-27 19:55:26 -05:00
parent 486773af63
commit ef855a9ae5
4 changed files with 21 additions and 7 deletions

View File

@ -78,7 +78,7 @@ LeDatabase >> addPageFromMarkdeepUrl: aString [
page page
ifNotNil: [ :arg | ifNotNil: [ :arg |
self importErrorForLocal: page withRemote: aString. self importErrorForLocal: page withRemote: aString.
^ self ]. ^ self errorCardFor: page uidString ].
^ self addPageFromMarkdeep: (self docTreeForLink: aString) withRemote: aString ^ self addPageFromMarkdeep: (self docTreeForLink: aString) withRemote: aString
] ]
@ -98,11 +98,10 @@ LeDatabase >> docTreeForLink: aString [
] ]
{ #category : #'*MiniDocs' } { #category : #'*MiniDocs' }
LeDatabase >> errorCardFor: error [ LeDatabase >> errorCardFor: errorKey [
| keepButton overwriteButton loadCopyButton errorMessageUI localPage errorKey | | keepButton overwriteButton loadCopyButton errorMessageUI localPage |
errorKey := error keys last.
localPage := self pageWithID: errorKey. localPage := self pageWithID: errorKey.
keepButton := BrButton new keepButton := BrButton new
aptitude: BrGlamorousButtonWithIconAndLabelAptitude; aptitude: BrGlamorousButtonWithIconAndLabelAptitude;
@ -134,7 +133,13 @@ LeDatabase >> errorCardFor: error [
aptitude: BrGlamorousRegularEditorAptitude new ; aptitude: BrGlamorousRegularEditorAptitude new ;
text: (self errors at: errorKey at: 'message'); text: (self errors at: errorKey at: 'message');
vFitContent. vFitContent.
^ { errorMessageUI. keepButton. overwriteButton. loadCopyButton } ^ BrHorizontalPane new
matchParent;
alignCenter;
addChild:errorMessageUI;
addChild: keepButton;
addChild: overwriteButton;
addChild: loadCopyButton
] ]
{ #category : #'*MiniDocs' } { #category : #'*MiniDocs' }
@ -210,6 +215,7 @@ LeDatabase >> importErrorForLocal: page withRemote: externalDocLocation [
at: 'message' put: message ; at: 'message' put: message ;
yourself. yourself.
self errors at: id put: error. self errors at: id put: error.
^ self errors at: id.
] ]
{ #category : #'*MiniDocs' } { #category : #'*MiniDocs' }

View File

@ -63,7 +63,8 @@ LePage >> asMarkdown [
bodyStream bodyStream
nextPutAll: k , ': "' , v, '"'; nextPutAll: k , ': "' , v, '"';
nextPutAll: String lf ]. nextPutAll: String lf ].
bodyStream nextPutAll: '---' , String lf , String lf. bodyStream nextPutAll: '---' , String lf , String lf, String lf.
bodyStream nextPutAll: '# ', self title, String lf , String lf.
self preorderTraversal self preorderTraversal
do: [ :snippet | bodyStream nextPutAll: snippet asMarkdown ]. do: [ :snippet | bodyStream nextPutAll: snippet asMarkdown ].
markdown := Markdown new contents: bodyStream contents. markdown := Markdown new contents: bodyStream contents.

View File

@ -25,6 +25,11 @@ LePictureSnippet >> asMarkdeep [
^ output contents ^ output contents
] ]
{ #category : #'*MiniDocs' }
LePictureSnippet >> asMarkdown [
^ self asMarkdeep
]
{ #category : #'*MiniDocs' } { #category : #'*MiniDocs' }
LePictureSnippet >> contentFrom: markdeepDiv [ LePictureSnippet >> contentFrom: markdeepDiv [
| caption width | | caption width |

View File

@ -40,7 +40,9 @@ LeTextualSnippet >> asMarkdown [
{ #category : #'*MiniDocs' } { #category : #'*MiniDocs' }
LeTextualSnippet >> contentAsStringCustomized [ LeTextualSnippet >> contentAsStringCustomized [
^ self contentAsString (self contentAsString beginsWith: '#')
ifTrue: [ ^ '#', self contentAsString ]
ifFalse: [ ^ self contentAsString ]
] ]
{ #category : #'*MiniDocs' } { #category : #'*MiniDocs' }