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

View File

@ -95,20 +95,22 @@ TiddlyWiki >> exportJSONSubtiddlers: subtiddlersCollection [
{ #category : #accessing } { #category : #accessing }
TiddlyWiki >> exportSTONFiles [ TiddlyWiki >> exportSTONFiles [
| stonFile wikiTemp shadowFile | | stonFile wikiTemp shadowFile |
self tiddlersJSONFile self tiddlersJSONFile
ifNil: [ 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' ] stonFile := FileLocator temp / 'tiddlers.ston' ]
ifNotNil: [ stonFile := self tiddlersJSONFile withoutExtension, 'ston' ]. ifNotNil: [
shadowFile := self file parent / 'tiddlers' / '_shadow.ston'. stonFile := self tiddlersJSONFile withoutExtension , 'ston' ].
shadowFile := self shadowsFolder / '_shadow.ston'.
wikiTemp := self copy. wikiTemp := self copy.
wikiTemp tiddlers: self contentTiddlers. wikiTemp tiddlers: self contentTiddlers.
wikiTemp := wikiTemp withoutImages. wikiTemp := wikiTemp withoutImages.
wikiTemp := wikiTemp withoutPDFs. wikiTemp := wikiTemp withoutPDFs.
GrafoscopioUtils exportAsSton: self shadow on: shadowFile. GrafoscopioUtils exportAsSton: self shadow on: shadowFile.
^ GrafoscopioUtils exportAsSton: wikiTemp on: stonFile ^ GrafoscopioUtils exportAsSton: wikiTemp on: stonFile
] ]
{ #category : #accessing } { #category : #accessing }
@ -256,7 +258,20 @@ TiddlyWiki >> remote: aUrlString [
{ #category : #accessing } { #category : #accessing }
TiddlyWiki >> shadow [ 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 } { #category : #accessing }