diff --git a/src/MiniDocs/LePage.extension.st b/src/MiniDocs/LePage.extension.st index 97e9527..347aa18 100644 --- a/src/MiniDocs/LePage.extension.st +++ b/src/MiniDocs/LePage.extension.st @@ -3,7 +3,7 @@ Extension { #name : #LePage } { #category : #'*MiniDocs' } LePage >> asHtmlFile [ - self asMarkdownFile. + self asMarkdownFileWIthMetadataWrappers. self defaultPandocTemplate exists ifFalse: [ MarkupFile installTemplate: 'https://mutabit.com/repos.fossil/mutabit/doc/trunk/plantillas/Pandoc/clean-menu-mod.html' into: self defaultPandocTemplate parent ]. @@ -48,6 +48,7 @@ LePage >> asMarkdeepFile [ { #category : #'*MiniDocs' } LePage >> asMarkdown [ + "PENDING: to debug the output." | bodyStream markdown | bodyStream := '' writeStream. bodyStream @@ -55,13 +56,13 @@ LePage >> asMarkdown [ self preorderTraversal do: [ :snippet | bodyStream nextPutAll: snippet asMarkdown ]. markdown := Markdown new - contents: bodyStream contents demoteMarkdownHeaders; + contents: bodyStream contents promoteMarkdownHeaders; metadata: (self metadata at: 'original' ifAbsentPut: Dictionary new). ^ markdown ] { #category : #'*MiniDocs' } -LePage >> asMarkdownFile [ +LePage >> asMarkdownFileWIthMetadataWrappers [ | folder | folder := self storage. ^ MarkupFile exportAsFileOn: folder / self markdownFileName containing: self asMarkdownWithMetadataWrappers contents @@ -71,13 +72,15 @@ LePage >> asMarkdownFile [ LePage >> asMarkdownWithMetadataWrappers [ | bodyStream markdown | bodyStream := '' writeStream. - bodyStream - nextPutAll: '# ', self title; cr; cr. + "bodyStream + nextPut: Character lf; + nextPutAll: '# ', self title; cr; cr." self preorderTraversal do: [ :snippet | bodyStream nextPutAll: snippet asMarkdownWithMetadataWrappers ]. markdown := Markdown new - contents: bodyStream contents demoteMarkdownHeaders; - metadata: (self metadata at: 'original' ifAbsentPut: Dictionary new). + contents: bodyStream contents promoteMarkdownHeaders; + title: self title; + metadata: self metadata. ^ markdown ] @@ -237,7 +240,7 @@ LePage >> notebookMetadataSnippet [ | response | response := LeTextSnippet new fromString: ''. response parent: self. - (self optionAt: 'HedgeDoc') ifNil: [ ^ response ]. + self optionAt: 'HedgeDoc' ifAbsent: [ ^ response ]. (response extra) at: 'HedgeDoc' put: (self optionAt: 'HedgeDoc'). ^ response diff --git a/src/MiniDocs/LeTextualSnippet.extension.st b/src/MiniDocs/LeTextualSnippet.extension.st index dcd75d5..565f349 100644 --- a/src/MiniDocs/LeTextualSnippet.extension.st +++ b/src/MiniDocs/LeTextualSnippet.extension.st @@ -34,13 +34,12 @@ LeTextualSnippet >> asMarkdownWithMetadataWrappers [ | output | output := '' writeStream. output - nextPutAll: '