diff --git a/repository/Grafoscopio-Utils/LePage.extension.st b/repository/Grafoscopio-Utils/LePage.extension.st index a213181..5f0bbb0 100644 --- a/repository/Grafoscopio-Utils/LePage.extension.st +++ b/repository/Grafoscopio-Utils/LePage.extension.st @@ -11,7 +11,7 @@ LePage >> asMarkdeep [ title: self title; body: bodyStream contents. self metadata keysAndValuesDo: [:k :v | - markdeep header + markdeep head add: ''; yourself. ]. @@ -38,6 +38,11 @@ LePage >> fileName [ ^ self title asDashedLowercase, '.', ((self uidString copyFrom: 1 to: 5 ) copyWithoutAll: '/'), '.md.html' ] +{ #category : #'*Grafoscopio-Utils-Core' } +LePage >> fromMarkdeepUrl: aString [ + ^ aString asUrl retrieveContents. +] + { #category : #'*Grafoscopio-Utils-Core' } LePage >> markdeepFileName [ | sanitized | diff --git a/repository/Grafoscopio-Utils/Markdeep.class.st b/repository/Grafoscopio-Utils/Markdeep.class.st index e2c90b5..1801520 100644 --- a/repository/Grafoscopio-Utils/Markdeep.class.st +++ b/repository/Grafoscopio-Utils/Markdeep.class.st @@ -9,11 +9,11 @@ Class { 'body', 'tocStyle', 'comments', - 'header', 'tail', 'language', 'config', - 'metadata' + 'metadata', + 'head' ], #category : #'Grafoscopio-Utils-Core' } @@ -95,7 +95,7 @@ Markdeep >> contents [ | output | output := '' writeStream. output - nextPutAll: self headerContents; lf; lf; + nextPutAll: self headContents; lf; lf; nextPutAll: ' **', self title, '**'; lf; nextPutAll: ' ', self authors ; lf; nextPutAll: ' ', self version; lf; lf; @@ -146,23 +146,33 @@ Markdeep >> gtTextFor: aView [ ] { #category : #accessing } -Markdeep >> header [ - ^ header ifNil: [header := OrderedCollection new. - header add: self fontAwesomeHeader; yourself ] +Markdeep >> head [ + ^ head ifNil: [ head := OrderedCollection new. + head add: self fontAwesomeHeader; yourself ] ] { #category : #accessing } -Markdeep >> header: anOrderedCollection [ - header := anOrderedCollection +Markdeep >> head: anOrderedCollection [ + head := anOrderedCollection ] { #category : #'instance creation' } -Markdeep >> headerContents [ - | output | - output := '' writeStream. - self header do: [:line | - output nextPutAll: line; lf ]. - ^ output contents. +Markdeep >> headContents [ + + ^ String streamContents: [ :stream | + stream + nextPutAll: ''; + nextPut: Character lf. + self head do: [ :line | + stream + nextPutAll: ' '; + nextPutAll: line; + nextPut: Character lf + ]. + stream + nextPutAll: ''; + nextPut: Character lf. + ]. ] { #category : #accessing }