From 6a9a2c345dc22c2ec291687257beb2cf45760a39 Mon Sep 17 00:00:00 2001 From: Offray Luna Date: Fri, 11 Feb 2022 12:45:06 -0500 Subject: [PATCH] Extracting shadow tiddlers to a different subfolder to ease content tiddlers versioning. --- repository/TiddlyWiki/TiddlyWiki.class.st | 27 ++++++++++++++++++----- 1 file changed, 21 insertions(+), 6 deletions(-) diff --git a/repository/TiddlyWiki/TiddlyWiki.class.st b/repository/TiddlyWiki/TiddlyWiki.class.st index e05f12a..9f58825 100644 --- a/repository/TiddlyWiki/TiddlyWiki.class.st +++ b/repository/TiddlyWiki/TiddlyWiki.class.st @@ -95,20 +95,22 @@ TiddlyWiki >> exportJSONSubtiddlers: subtiddlersCollection [ { #category : #accessing } TiddlyWiki >> exportSTONFiles [ + | stonFile wikiTemp shadowFile | - self tiddlersJSONFile + self tiddlersJSONFile ifNil: [ - self inform: 'No JSON Tiddlers file found. If you have one, please provide its location'. + self inform: + 'No JSON Tiddlers file found. If you have one, please provide its location'. stonFile := FileLocator temp / 'tiddlers.ston' ] - ifNotNil: [ stonFile := self tiddlersJSONFile withoutExtension, 'ston' ]. - shadowFile := self file parent / 'tiddlers' / '_shadow.ston'. + ifNotNil: [ + stonFile := self tiddlersJSONFile withoutExtension , 'ston' ]. + shadowFile := self shadowsFolder / '_shadow.ston'. wikiTemp := self copy. wikiTemp tiddlers: self contentTiddlers. wikiTemp := wikiTemp withoutImages. wikiTemp := wikiTemp withoutPDFs. GrafoscopioUtils exportAsSton: self shadow on: shadowFile. ^ GrafoscopioUtils exportAsSton: wikiTemp on: stonFile - ] { #category : #accessing } @@ -256,7 +258,20 @@ TiddlyWiki >> remote: aUrlString [ { #category : #accessing } TiddlyWiki >> shadow [ - ^ self tiddlers select: [:tiddler | tiddler title beginsWith: '$:/'] + "Shadow tiddlers are tiddlers that are loaded from plugins. + For more information about them, see: + + - https://tiddlywiki.com/static/ShadowTiddlers.html + - https://groups.google.com/g/TiddlyWiki/c/HuyZmaRJTxI" + ^ self tiddlers select: [:tiddler | tiddler title beginsWith: '$:/'] +] + +{ #category : #accessing } +TiddlyWiki >> shadowsFolder [ + "I store all shadow tiddlers, i.e. tiddlers that provide functionality to TiddlyWiki, + for example the ones that come in the plugins or in system tiddlers. + For more information about shadow tiddlers, see #shadow method." + ^ self file parent / 'shadow' ] { #category : #accessing }