From c8afd87f542f2102c67cce1e899398c326c98d7b Mon Sep 17 00:00:00 2001 From: Offray Luna Date: Sat, 1 Nov 2014 16:36:57 +0000 Subject: [PATCH] Changing default location for drafts temporally to solve a problem in the workshop. Needs to be reviewed and corrected. --- repository/Grafoscopio/GrafoscopioBrowser.class.st | 2 +- repository/Grafoscopio/GrafoscopioNode.class.st | 4 +++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/repository/Grafoscopio/GrafoscopioBrowser.class.st b/repository/Grafoscopio/GrafoscopioBrowser.class.st index 4b66a17..040cbbe 100644 --- a/repository/Grafoscopio/GrafoscopioBrowser.class.st +++ b/repository/Grafoscopio/GrafoscopioBrowser.class.st @@ -229,7 +229,7 @@ GrafoscopioBrowser >> open [ self buildBrowser. mainTree := GrafoscopioNode new. mainTree becomeDefaultTree. - draftsLocation := FileSystem disk workingDirectory / 'Grafoscopio/Drafts'. + draftsLocation := FileSystem disk workingDirectory / 'Drafts'. draftsLocation ensureCreateDirectory. workingFile := draftsLocation / 'draft.ston'. browser openOn: mainTree children. diff --git a/repository/Grafoscopio/GrafoscopioNode.class.st b/repository/Grafoscopio/GrafoscopioNode.class.st index e0f3e99..765d98b 100644 --- a/repository/Grafoscopio/GrafoscopioNode.class.st +++ b/repository/Grafoscopio/GrafoscopioNode.class.st @@ -251,7 +251,7 @@ GrafoscopioNode >> level: anInteger [ GrafoscopioNode >> markdownContent [ "Extracts the markdown of a node using body as content, header as title and level as hierarchical level of the title. If special nodes types are present, converts them into proper markup to be embedded inside markdown" - | markdown configDict specialWords embedNodes | + | markdown configDict specialWords embedNodes temporalBody | markdown := '' writeStream. specialWords := #('#config' '#abstract' '#invisible' '#idea' '#footnote' 'nuevoNodo' '%embed'). (self level > 0) & (specialWords includes: self header) not & (specialWords includes: ((self header findTokens: $ ) at: 1)) not @@ -260,6 +260,8 @@ GrafoscopioNode >> markdownContent [ markdown nextPutAll: ' '. markdown nextPutAll: (self header copyReplaceTokens: #cr with: #lf); lf; lf. embedNodes := self headers select: [:each | ((each findTokens: $ ) at: 1) = '%embed']. + temporalBody := self body. + embedNodes ifNotNil: [ ]. markdown nextPutAll: (self body contents withUnixLineEndings); lf; lf]. (self header = '#config')