Better naming. Introducing optimized external Nim callings to improve speed.

This commit is contained in:
Offray Vladimir Luna Cárdenas 2022-03-13 18:06:23 -05:00
parent 8d607a6aea
commit e05a216b52
1 changed files with 37 additions and 36 deletions

View File

@ -88,7 +88,7 @@ TiddlyWiki >> changesAfter: aDateString [
| recent created modified wiki aDate |
aDate := aDateString asZTimestamp.
wiki := self contentTiddlersWithoutLargeTiddlers.
wiki := self commonTiddlers.
created := wiki select: [ :tiddler | tiddler created asZTimestamp > aDate ].
modified := wiki select: [ :tiddler | tiddler modified isNotNil
and: [ tiddler modified asZTimestamp > aDate ] ].
@ -100,6 +100,21 @@ TiddlyWiki >> changesAfter: aDateString [
^ recent asSet.
]
{ #category : #accessing }
TiddlyWiki >> commonTiddlers [
| content |
content := OrderedCollection new.
content
addAll: (self contentTiddlers
select: [ :each | each isTW5Type or: [ each isNilType ]]);
addAll: (self contentTiddlers select: [ :each | each isJavascript ]);
addAll: (self contentTiddlers select: [ :each | each isXTiddlerDictionary ]);
addAll: (self contentTiddlers select: [ :each | each isTextPlain ]);
addAll: (self contentTiddlers select: [ :each | each isMarkdown ]).
^ content.
]
{ #category : #accessing }
TiddlyWiki >> configDictonary [
^ STONJSON fromString: self configFile contents.
@ -122,21 +137,6 @@ TiddlyWiki >> contentTiddlers [
^ self tiddlers copyWithoutAll: self shadow
]
{ #category : #accessing }
TiddlyWiki >> contentTiddlersWithoutLargeTiddlers [
| content |
content := OrderedCollection new.
content
addAll: (self contentTiddlers
select: [ :each | each isTW5Type or: [ each isNilType ]]);
addAll: (self contentTiddlers select: [ :each | each isJavascript ]);
addAll: (self contentTiddlers select: [ :each | each isXTiddlerDictionary ]);
addAll: (self contentTiddlers select: [ :each | each isTextPlain ]);
addAll: (self contentTiddlers select: [ :each | each isMarkdown ]).
^ content.
]
{ #category : #accessing }
TiddlyWiki >> detectRepositoryLocal [
@ -153,18 +153,18 @@ TiddlyWiki >> detectRepositoryLocal [
]
{ #category : #accessing }
TiddlyWiki >> exportContentShadowAndLargeTiddlersSTONFiles [
TiddlyWiki >> exportCommonTiddlers [
self exportSTONFiles; exportLargeTiddlers
| content |
content := self commonTiddlers.
^ content do: [ :each |
each exportSTONFileInto: 'tiddlers' ].
]
{ #category : #accessing }
TiddlyWiki >> exportContentTiddlers [
TiddlyWiki >> exportContentShadowAndLargeTiddlersSTONFiles [
| content |
content := self contentTiddlersWithoutLargeTiddlers.
^ content do: [ :each |
each exportSTONFileInto: 'tiddlers' ].
self exportSTONFiles; exportLargeTiddlers
]
{ #category : #accessing }
@ -240,7 +240,7 @@ TiddlyWiki >> exportSTONFiles [
stonFile := self tiddlersJSONFile withoutExtension , 'ston' ].
shadowFile := self largeTiddlersFolder / '_shadow.ston'.
wikiTemp := self copy.
wikiTemp tiddlers: self contentTiddlersWithoutLargeTiddlers.
wikiTemp tiddlers: self commonTiddlers.
GrafoscopioUtils exportAsSton: self shadow on: shadowFile.
^ GrafoscopioUtils exportAsSton: wikiTemp on: stonFile
]
@ -515,29 +515,23 @@ TiddlyWiki >> repository [
]
{ #category : #accessing }
TiddlyWiki >> resynchronize [
TiddlyWiki >> resynchronizeWithRepository [
| repository return |
repository := self repository.
repository update.
self updateFromHtml.
repository syncUnversioned.
return := Dictionary new
at: 'status' put: self addRecentChangesToRepo.
self exportSTONFiles.
self exportContentTiddlers.
self exportLargeTiddlers.
self exportSTONFiles;
exportCommonTiddlers;
exportLargeTiddlers.
^ return
at: 'file' put: self rebuildTiddlersJSON;
yourself.
]
{ #category : #accessing }
TiddlyWiki >> resynchronizeWithHtml [
self
exportJSONFileOptimized;
importJSONFile.
]
{ #category : #accessing }
TiddlyWiki >> selectByTagsIncludes: string [
@ -579,7 +573,7 @@ TiddlyWiki >> syncRemoteLocalDestructive [
exportJSONFile;
importJSONFile.
self exportSTONFiles.
self exportContentTiddlers.
self exportCommonTiddlers.
self exportLargeTiddlers.
^ Dictionary new
at: 'status' put: repository status;
@ -627,6 +621,13 @@ TiddlyWiki >> tiddlersJSONUrl [
self remote ifNil: [^ nil].
]
{ #category : #accessing }
TiddlyWiki >> updateFromHtml [
self
exportJSONFileOptimized;
importJSONFile.
]
{ #category : #accessing }
TiddlyWiki >> withoutContentType: application [
| filteredTiddlers tempWiki |