From 05d2f3b18268aa74f45879f459c431c6fa7c1bc4 Mon Sep 17 00:00:00 2001 From: Offray Luna Date: Sat, 22 Jan 2022 10:23:56 -0500 Subject: [PATCH] Modularizing code and improving extensions. --- .../BaselineOfGrafoscopioUtils.class.st | 2 +- .../GrafoscopioUtils.class.st | 8 +++----- .../Grafoscopio-Utils/HedgeDoc.class.st | 2 +- .../Grafoscopio-Utils/LePage.extension.st | 19 +++++++++++++++++++ .../Grafoscopio-Utils/Markdeep.class.st | 6 ++++-- .../Grafoscopio-Utils/MarkupFile.class.st | 2 +- repository/Grafoscopio-Utils/Pandoc.class.st | 2 +- .../Grafoscopio-Utils/PandocWork.class.st | 2 +- 8 files changed, 31 insertions(+), 12 deletions(-) create mode 100644 repository/Grafoscopio-Utils/LePage.extension.st diff --git a/repository/BaselineOfGrafoscopioUtils/BaselineOfGrafoscopioUtils.class.st b/repository/BaselineOfGrafoscopioUtils/BaselineOfGrafoscopioUtils.class.st index 3e88a9e..33635ad 100644 --- a/repository/BaselineOfGrafoscopioUtils/BaselineOfGrafoscopioUtils.class.st +++ b/repository/BaselineOfGrafoscopioUtils/BaselineOfGrafoscopioUtils.class.st @@ -15,7 +15,7 @@ BaselineOfGrafoscopioUtils >> baseline: spec [ self fossil: spec. spec baseline: 'PetitParser' with: [spec - repository: 'github://moosetechnology/PetitParser/src'; + repository: 'github://moosetechnology/PetitParser:v3.x.x/src'; loads: #('Minimal' 'Indent' 'YAML')]. "Packages" diff --git a/repository/Grafoscopio-Utils/GrafoscopioUtils.class.st b/repository/Grafoscopio-Utils/GrafoscopioUtils.class.st index 68de372..b5b30f8 100644 --- a/repository/Grafoscopio-Utils/GrafoscopioUtils.class.st +++ b/repository/Grafoscopio-Utils/GrafoscopioUtils.class.st @@ -5,7 +5,7 @@ or other related projects. Class { #name : #GrafoscopioUtils, #superclass : #Object, - #category : #'Grafoscopio-Utils' + #category : #'Grafoscopio-Utils-Core' } { #category : #utilities } @@ -64,13 +64,11 @@ GrafoscopioUtils class >> exportAsSton: anObject on: aFileReference [ aFileReference ensureCreateFile. aFileReference writeStreamDo: [ :stream | (STON writer on: stream) - newLine: String crlf; + newLine: String lf; prettyPrint: true; keepNewLines: true; nextPut: anObject ]. - - - + ^ aFileReference ] { #category : #'graphical interface' } diff --git a/repository/Grafoscopio-Utils/HedgeDoc.class.st b/repository/Grafoscopio-Utils/HedgeDoc.class.st index d414c7c..ee4f39c 100644 --- a/repository/Grafoscopio-Utils/HedgeDoc.class.st +++ b/repository/Grafoscopio-Utils/HedgeDoc.class.st @@ -14,7 +14,7 @@ Class { 'contents', 'url' ], - #category : #'Grafoscopio-Utils' + #category : #'Grafoscopio-Utils-Core' } { #category : #'as yet unclassified' } diff --git a/repository/Grafoscopio-Utils/LePage.extension.st b/repository/Grafoscopio-Utils/LePage.extension.st new file mode 100644 index 0000000..dfd1b89 --- /dev/null +++ b/repository/Grafoscopio-Utils/LePage.extension.st @@ -0,0 +1,19 @@ +Extension { #name : #LePage } + +{ #category : #'*Grafoscopio-Utils-Core' } +LePage >> asMarkdeep [ + | bodyStream | + bodyStream := '' writeStream. + self preorderTraversal do: [:snippet | + bodyStream nextPutAll: snippet contentAsString; lf; lf. + ]. + ^ Markdeep new + body: bodyStream contents + contents. +] + +{ #category : #'*Grafoscopio-Utils-Core' } +LePage >> asMarkdeepInto: aFileLocator [ + + self preorderTraversal +] diff --git a/repository/Grafoscopio-Utils/Markdeep.class.st b/repository/Grafoscopio-Utils/Markdeep.class.st index 10d69f6..94b28ea 100644 --- a/repository/Grafoscopio-Utils/Markdeep.class.st +++ b/repository/Grafoscopio-Utils/Markdeep.class.st @@ -11,9 +11,11 @@ Class { 'tail', 'body', 'language', - 'markdownFile' + 'markdownFile', + 'config', + 'title' ], - #category : #'Grafoscopio-Utils' + #category : #'Grafoscopio-Utils-Core' } { #category : #'as yet unclassified' } diff --git a/repository/Grafoscopio-Utils/MarkupFile.class.st b/repository/Grafoscopio-Utils/MarkupFile.class.st index 23f8109..7e5019c 100644 --- a/repository/Grafoscopio-Utils/MarkupFile.class.st +++ b/repository/Grafoscopio-Utils/MarkupFile.class.st @@ -7,7 +7,7 @@ Class { #instVars : [ 'file' ], - #category : #'Grafoscopio-Utils' + #category : #'Grafoscopio-Utils-Core' } { #category : #persistence } diff --git a/repository/Grafoscopio-Utils/Pandoc.class.st b/repository/Grafoscopio-Utils/Pandoc.class.st index a15f98c..ae1aecd 100644 --- a/repository/Grafoscopio-Utils/Pandoc.class.st +++ b/repository/Grafoscopio-Utils/Pandoc.class.st @@ -7,7 +7,7 @@ Class { #classInstVars : [ 'executable' ], - #category : #'Grafoscopio-Utils' + #category : #'Grafoscopio-Utils-Core' } { #category : #'as yet unclassified' } diff --git a/repository/Grafoscopio-Utils/PandocWork.class.st b/repository/Grafoscopio-Utils/PandocWork.class.st index 4e09828..52754c2 100644 --- a/repository/Grafoscopio-Utils/PandocWork.class.st +++ b/repository/Grafoscopio-Utils/PandocWork.class.st @@ -22,7 +22,7 @@ Class { 'rootFolder', 'manifests' ], - #category : #'Grafoscopio-Utils' + #category : #'Grafoscopio-Utils-Core' } { #category : #utilities }