Extracting shadow tiddlers to a different subfolder to ease content tiddlers versioning.

This commit is contained in:
Offray Vladimir Luna Cárdenas 2022-02-11 12:45:06 -05:00
parent c75b44f160
commit 6a9a2c345d
1 changed files with 21 additions and 6 deletions

View File

@ -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 }