From f390c61d6f03d16406b0caa9aefec8a8401bc71d Mon Sep 17 00:00:00 2001 From: Offray Luna Date: Tue, 17 Aug 2021 12:03:53 -0500 Subject: [PATCH] Starting support for wiki visualizations. --- repository/TiddlyWiki/Tiddler.class.st | 30 ++++++++++++++++++++++- repository/TiddlyWiki/TiddlyWiki.class.st | 13 +++++++++- 2 files changed, 41 insertions(+), 2 deletions(-) diff --git a/repository/TiddlyWiki/Tiddler.class.st b/repository/TiddlyWiki/Tiddler.class.st index 67a56a1..6304448 100644 --- a/repository/TiddlyWiki/Tiddler.class.st +++ b/repository/TiddlyWiki/Tiddler.class.st @@ -17,7 +17,8 @@ Class { 'type', 'list', 'caption', - 'modifier' + 'modifier', + 'wiki' ], #category : #'TiddlyWiki-Model' } @@ -130,6 +131,13 @@ Tiddler >> itemContentsStringFor: item into: stream [ nextPut: Character cr ] +{ #category : #accessing } +Tiddler >> linkedTiddlers [ + "At the begining we are going to introduce 'pureTiddles' as thos included in the wiki which are not linked + via aliases. Future versions of this method sould included internal aliased tiddlers." + self rawLinks +] + { #category : #accessing } Tiddler >> list [ @@ -187,6 +195,16 @@ Tiddler >> printOn: aStream [ nextPutAll: '( ', self title, ' )' ] +{ #category : #'as yet unclassified' } +Tiddler >> rawAliasedLinks [ + ^ self rawLinks select: [ :each | each includesSubstring: '|' ] +] + +{ #category : #accessing } +Tiddler >> rawLinks [ + ^ (WikiTextGrammar new linkSea star parse: self text) asSet +] + { #category : #accessing } Tiddler >> tags [ @@ -234,3 +252,13 @@ Tiddler >> type: anObject [ type := anObject ] + +{ #category : #accessing } +Tiddler >> wiki [ + ^ wiki +] + +{ #category : #accessing } +Tiddler >> wiki: aTiddlyWiki [ + wiki := aTiddlyWiki +] diff --git a/repository/TiddlyWiki/TiddlyWiki.class.st b/repository/TiddlyWiki/TiddlyWiki.class.st index ba5821f..9127084 100644 --- a/repository/TiddlyWiki/TiddlyWiki.class.st +++ b/repository/TiddlyWiki/TiddlyWiki.class.st @@ -29,7 +29,11 @@ TiddlyWiki >> importJSONTiddlers [ | tiddlersDict | self tiddlersJSONFile ifNil: [ ^ self ]. tiddlersDict := STONJSON fromString: self tiddlersJSONFile contents. - self tiddlers: (tiddlersDict collect: [:each | Tiddler new fromDictionary: each ]) + self tiddlers: (tiddlersDict collect: [:each | + Tiddler new + fromDictionary: each; + wiki: self + ]) ] { #category : #accessing } @@ -39,6 +43,13 @@ TiddlyWiki >> printOn: aStream [ nextPutAll: '( ', self file basename ,' )' ] +{ #category : #accessing } +TiddlyWiki >> taggedWith: aTag [ + ^ self tiddlers select: [:tiddler | + tiddler tags isNotNil and: [tiddler tags includesSubstring: aTag ] + ] +] + { #category : #accessing } TiddlyWiki >> tiddlers [