Creating FossilRepo and TiddlyWiki interactions.

This commit is contained in:
ruidajo 2022-03-03 20:38:14 -05:00
parent d7ce1331f4
commit 2353ffb15f

View File

@ -41,6 +41,17 @@ TiddlyWiki >> addToConfigFile [
^ MarkupFile exportAsFileOn: self configFile containing:(STON toStringPretty: newConfig)
]
{ #category : #testing }
TiddlyWiki >> belongsToLocalRepository [
| localFolder tempRepo relativeName |
localFolder := self detectRepositoryLocal ifNil: [ ^ false ].
tempRepo := FossilRepo new
local: localFolder.
relativeName := self file fullName withoutPrefix: (tempRepo local fullName, '/').
^ tempRepo listUnversioned hasLiteral: relativeName
]
{ #category : #accessing }
TiddlyWiki >> changesAfter: aDateString [
@ -96,14 +107,16 @@ TiddlyWiki >> contentTiddlersWithoutLargeTiddlers [
]
{ #category : #accessing }
TiddlyWiki >> detectRepository [
TiddlyWiki >> detectRepositoryLocal [
| folder folderItems |
folder := self file parent.
folderItems := folder children.
[(folderItems select: [ :path | path basename beginsWith: '.fossil' ]) isEmpty]
whileTrue: [folder := folder parent.
folderItems := folder children.].
[(folderItems select: [ :path | path basename beginsWith: '.fossil' ]) isEmpty
and:[ (folder = FileLocator root) not ]]
whileTrue: [folder := folder parent.
folderItems := folder children.].
folder = FileLocator root ifTrue: [ ^ nil ].
^ folder
]
@ -402,6 +415,17 @@ TiddlyWiki >> remote: aUrlString [
remote := aUrlString asZnUrl
]
{ #category : #accessing }
TiddlyWiki >> repository [
| repo |
self belongsToLocalRepository ifFalse: [ ^ self ].
repo := FossilRepo new
local: self detectRepositoryLocal.
repo repository.
^ repo
]
{ #category : #accessing }
TiddlyWiki >> selectContentType: mimeType [
@ -458,6 +482,13 @@ TiddlyWiki >> tiddlersJSONUrl [
self remote ifNil: [^ nil].
]
{ #category : #accessing }
TiddlyWiki >> updateAndRebuildTiddlersJSONWithFossilRepo [
self repository update; uvExportSTON.
^ self rebuildTiddlersJSON
]
{ #category : #accessing }
TiddlyWiki >> withoutContentType: application [
| filteredTiddlers tempWiki |