Improving Markdown to Markdeep conversion.
This commit is contained in:
parent
e3f3a62078
commit
f5006572e8
@ -132,7 +132,7 @@ LePage >> localHostAddress [
|
||||
MiniDocsServer teapot server isRunning ifFalse: [ MiniDocsServer restart ].
|
||||
route := MiniDocsServer teapot staticRouter prefix joinUsing: '/'.
|
||||
localUrl := MiniDocsServer teapot server localUrl asString.
|
||||
^ {localUrl, route, '/', self markdeepFileName . MiniDocsServer}
|
||||
^ localUrl, route, '/', self markdeepFileName
|
||||
]
|
||||
|
||||
{ #category : #'*MiniDocs' }
|
||||
|
@ -229,6 +229,7 @@ Markdown >> printOn: aStream [
|
||||
|
||||
{ #category : #utilities }
|
||||
Markdown >> startsWithYAMLMetadataDelimiter [
|
||||
self lines ifEmpty: [^false].
|
||||
^ self lines first beginsWith: self class yamlMetadataDelimiter
|
||||
|
||||
]
|
||||
@ -250,7 +251,8 @@ Markdown >> yamlMetadataClosingLineNumber [
|
||||
{ #category : #operation }
|
||||
Markdown >> yamlMetadataString [
|
||||
| output yamlLines |
|
||||
self detectYAMLMetadata ifFalse: [ ^ nil ].
|
||||
self detectYAMLMetadata ifFalse: [ ^nil ].
|
||||
self lines ifEmpty: [ ^nil ].
|
||||
yamlLines := self lines copyFrom: 2 to: self yamlMetadataClosingLineNumber - 1.
|
||||
output := '' writeStream.
|
||||
yamlLines do: [ :line |
|
||||
|
@ -100,6 +100,7 @@ MiniDocs class >> shiftKeys [
|
||||
MiniDocs class >> yamlToJson: yamlString [
|
||||
"This method uses a external binary written in Nim, as the native Pharo parser for YAML, written in PetitParser,
|
||||
was less robust and unable to parse correctly the same strings as the external one."
|
||||
yamlString ifNil: [ ^ Dictionary new ].
|
||||
self yamlToJsonBinary exists ifFalse: [ self installYamlToJson ].
|
||||
|
||||
OSSUnixSubprocess new
|
||||
|
Loading…
Reference in New Issue
Block a user