Improved Markdown exportation for better Pandoc conversions between formats.
This commit is contained in:
parent
486773af63
commit
ef855a9ae5
@ -78,7 +78,7 @@ LeDatabase >> addPageFromMarkdeepUrl: aString [
|
||||
page
|
||||
ifNotNil: [ :arg |
|
||||
self importErrorForLocal: page withRemote: aString.
|
||||
^ self ].
|
||||
^ self errorCardFor: page uidString ].
|
||||
^ self addPageFromMarkdeep: (self docTreeForLink: aString) withRemote: aString
|
||||
]
|
||||
|
||||
@ -98,11 +98,10 @@ LeDatabase >> docTreeForLink: aString [
|
||||
]
|
||||
|
||||
{ #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.
|
||||
keepButton := BrButton new
|
||||
aptitude: BrGlamorousButtonWithIconAndLabelAptitude;
|
||||
@ -134,7 +133,13 @@ LeDatabase >> errorCardFor: error [
|
||||
aptitude: BrGlamorousRegularEditorAptitude new ;
|
||||
text: (self errors at: errorKey at: 'message');
|
||||
vFitContent.
|
||||
^ { errorMessageUI. keepButton. overwriteButton. loadCopyButton }
|
||||
^ BrHorizontalPane new
|
||||
matchParent;
|
||||
alignCenter;
|
||||
addChild:errorMessageUI;
|
||||
addChild: keepButton;
|
||||
addChild: overwriteButton;
|
||||
addChild: loadCopyButton
|
||||
]
|
||||
|
||||
{ #category : #'*MiniDocs' }
|
||||
@ -210,6 +215,7 @@ LeDatabase >> importErrorForLocal: page withRemote: externalDocLocation [
|
||||
at: 'message' put: message ;
|
||||
yourself.
|
||||
self errors at: id put: error.
|
||||
^ self errors at: id.
|
||||
]
|
||||
|
||||
{ #category : #'*MiniDocs' }
|
||||
|
@ -63,7 +63,8 @@ LePage >> asMarkdown [
|
||||
bodyStream
|
||||
nextPutAll: k , ': "' , v, '"';
|
||||
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
|
||||
do: [ :snippet | bodyStream nextPutAll: snippet asMarkdown ].
|
||||
markdown := Markdown new contents: bodyStream contents.
|
||||
|
@ -25,6 +25,11 @@ LePictureSnippet >> asMarkdeep [
|
||||
^ output contents
|
||||
]
|
||||
|
||||
{ #category : #'*MiniDocs' }
|
||||
LePictureSnippet >> asMarkdown [
|
||||
^ self asMarkdeep
|
||||
]
|
||||
|
||||
{ #category : #'*MiniDocs' }
|
||||
LePictureSnippet >> contentFrom: markdeepDiv [
|
||||
| caption width |
|
||||
|
@ -40,7 +40,9 @@ LeTextualSnippet >> asMarkdown [
|
||||
|
||||
{ #category : #'*MiniDocs' }
|
||||
LeTextualSnippet >> contentAsStringCustomized [
|
||||
^ self contentAsString
|
||||
(self contentAsString beginsWith: '#')
|
||||
ifTrue: [ ^ '#', self contentAsString ]
|
||||
ifFalse: [ ^ self contentAsString ]
|
||||
]
|
||||
|
||||
{ #category : #'*MiniDocs' }
|
||||
|
Loading…
Reference in New Issue
Block a user