From 8d024451639d42556dae4286839919e8974d0747 Mon Sep 17 00:00:00 2001 From: ruidajo Date: Fri, 9 Dec 2022 12:49:51 -0500 Subject: [PATCH] Creating tiddler method for append prefix to text a remove tag. --- repository/TiddlyWiki/Tiddler.class.st | 18 ++++++++++++++++++ repository/TiddlyWiki/TiddlyWiki.class.st | 2 +- 2 files changed, 19 insertions(+), 1 deletion(-) diff --git a/repository/TiddlyWiki/Tiddler.class.st b/repository/TiddlyWiki/Tiddler.class.st index ecdcb90..1cf0973 100644 --- a/repository/TiddlyWiki/Tiddler.class.st +++ b/repository/TiddlyWiki/Tiddler.class.st @@ -32,6 +32,15 @@ Tiddler class >> nowLocal [ format: (ZTimestamp fromString: Time nowLocal asDateAndTime asString)) copyFrom: 1 to: 17 ] +{ #category : #accessing } +Tiddler >> appendPrefixToText: prefix [ + + | textPre | + textPre := self text. + self text: prefix, textPre. + ^ self +] + { #category : #accessing } Tiddler >> asDictionary [ | response | @@ -470,6 +479,15 @@ Tiddler >> rawLinks [ ^ (WikiTextGrammar new linkSea star parse: self text) asSet ] +{ #category : #accessing } +Tiddler >> removeTag: aTag [ + + | tagsPre | + tagsPre := self tags. + self tags: ('' join: (tagsPre splitOn: aTag)). + ^ self +] + { #category : #accessing } Tiddler >> revision [ ^ revision diff --git a/repository/TiddlyWiki/TiddlyWiki.class.st b/repository/TiddlyWiki/TiddlyWiki.class.st index b18a4cf..11b364d 100644 --- a/repository/TiddlyWiki/TiddlyWiki.class.st +++ b/repository/TiddlyWiki/TiddlyWiki.class.st @@ -293,7 +293,7 @@ TiddlyWiki >> exportJSONSubtiddlers: subtiddlersCollection [ { #category : #accessing } TiddlyWiki >> exportJSONSubtiddlers: subtiddlersCollection as: aName [ - ^ MarkupFile exportAsFileOn: self file parent / aName, 'json' containing: (self jsonSubtiddlers: subtiddlersCollection) + ^ MarkupFile exportAsFileOn: self folder / aName, 'json' containing: (self jsonSubtiddlers: subtiddlersCollection) ] { #category : #'export - json' }