From 3ef7b531f02653134d3c37940cc12260e24a676b Mon Sep 17 00:00:00 2001 From: Offray Luna Date: Thu, 21 Nov 2024 17:55:48 -0500 Subject: [PATCH] Starting support for Freeplane importation. --- repository/TiddlyWiki/TiddlyWiki.class.st | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/repository/TiddlyWiki/TiddlyWiki.class.st b/repository/TiddlyWiki/TiddlyWiki.class.st index c7c0ab5..8af8f5a 100644 --- a/repository/TiddlyWiki/TiddlyWiki.class.st +++ b/repository/TiddlyWiki/TiddlyWiki.class.st @@ -54,6 +54,14 @@ TiddlyWiki class >> fromJSONUrl: anUrlString [ name: anUrlString ] +{ #category : #accessing } +TiddlyWiki class >> fromMindMapFile: mindmapFile [ + "mindmapFile is a FileReference to a Mind map created in Freeplane." + | mindMapXML mindMapNodes | + mindMapXML := (XMLDOMParser on: mindmapFile contents) parseDocument. + mindMapNodes := mindMapXML xpath: '//node'. +] + { #category : #accessing } TiddlyWiki class >> loadFromLocalFolder: aFolder [ @@ -355,7 +363,7 @@ TiddlyWiki >> exportJSONTiddlersTagged: aTag in: aFolder named: aFileName [ | taggedTiddlers jsonString | self tiddlers. - taggedTiddlers := self taggedWith: aTag. + taggedTiddlers := self tagWith: aTag. jsonString := '[', (',' join: (taggedTiddlers collect: [ :each | each asJsonString ])), ']'. ^ MarkupFile exportAsFileOn: aFolder / (aFileName, '.json') containing: jsonString ] @@ -958,7 +966,7 @@ TiddlyWiki >> syncRemoteLocalDestructive [ ] { #category : #accessing } -TiddlyWiki >> taggedWith: aTag [ +TiddlyWiki >> tagWith: aTag [ ^ self tiddlers select: [:tiddler | tiddler tags isNotNil and: [tiddler tags includesSubstring: aTag ] ]