Compare commits
No commits in common. "cdd8607532c48a3a4fd488a36db4f93fe581418a" and "0ff99de89634fc508cd925d5f8ef9c0427d10622" have entirely different histories.
cdd8607532
...
0ff99de896
@ -267,12 +267,6 @@ Tiddler >> gtTextFor: aView [
|
|||||||
text: [ text ]
|
text: [ text ]
|
||||||
]
|
]
|
||||||
|
|
||||||
{ #category : #testing }
|
|
||||||
Tiddler >> hasUID [
|
|
||||||
|
|
||||||
^ self customFields includesKey: 'uid'
|
|
||||||
]
|
|
||||||
|
|
||||||
{ #category : #accessing }
|
{ #category : #accessing }
|
||||||
Tiddler >> importFedWikiPage: pageViewUrlString [
|
Tiddler >> importFedWikiPage: pageViewUrlString [
|
||||||
| pageTitle pageViewUrl pageData |
|
| pageTitle pageViewUrl pageData |
|
||||||
@ -308,8 +302,7 @@ Tiddler >> installTiddlerExporter [
|
|||||||
{ #category : #testing }
|
{ #category : #testing }
|
||||||
Tiddler >> isImage [
|
Tiddler >> isImage [
|
||||||
|
|
||||||
^ self type ifNil: [ ^ false ];
|
^ self type = 'image/'
|
||||||
beginsWith: 'image/'
|
|
||||||
]
|
]
|
||||||
|
|
||||||
{ #category : #testing }
|
{ #category : #testing }
|
||||||
|
@ -25,9 +25,9 @@ TiddlyWiki class >> createFromRemote: aRemoteTWUrl in: aFolder [
|
|||||||
aFolder hasChildren ifTrue: [ ^ nil ].
|
aFolder hasChildren ifTrue: [ ^ nil ].
|
||||||
wiki := TiddlyWiki new
|
wiki := TiddlyWiki new
|
||||||
remote: aRemoteTWUrl;
|
remote: aRemoteTWUrl;
|
||||||
folder: (aFolder ensureCreateDirectory).
|
folder: aFolder;
|
||||||
|
file: (aFolder / 'index.html') ensureCreateFile.
|
||||||
^ wiki downloadHTML;
|
^ wiki downloadHTML;
|
||||||
file: (aFolder / 'index.html');
|
|
||||||
tiddlers.
|
tiddlers.
|
||||||
]
|
]
|
||||||
|
|
||||||
@ -52,33 +52,6 @@ TiddlyWiki class >> fromJSONUrl: anUrlString [
|
|||||||
name: anUrlString
|
name: anUrlString
|
||||||
]
|
]
|
||||||
|
|
||||||
{ #category : #accessing }
|
|
||||||
TiddlyWiki class >> loadFromLocalFolder: aFolder [
|
|
||||||
|
|
||||||
| wiki |
|
|
||||||
wiki := TiddlyWiki new
|
|
||||||
folder: aFolder;
|
|
||||||
file: aFolder / 'index.html';
|
|
||||||
jsonFile: aFolder / 'tiddlers.json'.
|
|
||||||
^ wiki fromString: wiki jsonFile.
|
|
||||||
]
|
|
||||||
|
|
||||||
{ #category : #accessing }
|
|
||||||
TiddlyWiki class >> loadFromLocalFolder: aFolder named: aName [
|
|
||||||
|
|
||||||
| wiki |
|
|
||||||
wiki := TiddlyWiki loadFromLocalFolder: aFolder.
|
|
||||||
^ wiki name: aName
|
|
||||||
]
|
|
||||||
|
|
||||||
{ #category : #accessing }
|
|
||||||
TiddlyWiki class >> loadFromLocalFolder: aFolder named: aName withRemote: aRemoteURL [
|
|
||||||
|
|
||||||
| wiki |
|
|
||||||
wiki := self loadFromLocalFolder: aFolder named: aName.
|
|
||||||
^ wiki remote: aRemoteURL
|
|
||||||
]
|
|
||||||
|
|
||||||
{ #category : #accessing }
|
{ #category : #accessing }
|
||||||
TiddlyWiki >> addRecentChangesToRepo [
|
TiddlyWiki >> addRecentChangesToRepo [
|
||||||
|
|
||||||
@ -208,7 +181,7 @@ TiddlyWiki >> downloadHTML [
|
|||||||
localCopy := self folder / 'index.html'.
|
localCopy := self folder / 'index.html'.
|
||||||
localCopy exists ifTrue: [ | timestamp |
|
localCopy exists ifTrue: [ | timestamp |
|
||||||
timestamp := (DateAndTime now asString) copyReplaceAll: ':' with: '_'.
|
timestamp := (DateAndTime now asString) copyReplaceAll: ':' with: '_'.
|
||||||
localCopy renameTo: 'index-', timestamp, '.html'].
|
localCopy renameTo: 'index', timestamp, '.html'].
|
||||||
ZnClient new
|
ZnClient new
|
||||||
url: htmlLink;
|
url: htmlLink;
|
||||||
downloadTo: self folder / 'index.html'.
|
downloadTo: self folder / 'index.html'.
|
||||||
@ -454,12 +427,7 @@ TiddlyWiki >> importJSONFile [
|
|||||||
{ #category : #accessing }
|
{ #category : #accessing }
|
||||||
TiddlyWiki >> importJSONLink [
|
TiddlyWiki >> importJSONLink [
|
||||||
|
|
||||||
| localCopy |
|
self jsonFile: self folder / 'tiddlers.json'.
|
||||||
self jsonFile ifNil: [ self jsonFile: self folder / 'tiddlers.json' ].
|
|
||||||
localCopy := self folder / 'tiddlers.json'.
|
|
||||||
localCopy exists ifTrue: [ | timestamp |
|
|
||||||
timestamp := (DateAndTime now asString) copyReplaceAll: ':' with: '_'.
|
|
||||||
localCopy renameTo: 'tiddlers-', timestamp, '.json'].
|
|
||||||
MarkupFile exportAsFileOn: jsonFile containing: self remoteTiddlersContentsString.
|
MarkupFile exportAsFileOn: jsonFile containing: self remoteTiddlersContentsString.
|
||||||
^ self fromString: self remoteTiddlersContentsString
|
^ self fromString: self remoteTiddlersContentsString
|
||||||
]
|
]
|
||||||
@ -827,21 +795,6 @@ TiddlyWiki >> tiddlersJSONUrl [
|
|||||||
self remote ifNil: [^ nil].
|
self remote ifNil: [^ nil].
|
||||||
]
|
]
|
||||||
|
|
||||||
{ #category : #accessing }
|
|
||||||
TiddlyWiki >> tiddlersMissingUID [
|
|
||||||
|
|
||||||
^ self tiddlers reject: [ :tiddler | (tiddler customFields includesKey: 'uid') or: [ (tiddler title beginsWith:'$') ] ].
|
|
||||||
]
|
|
||||||
|
|
||||||
{ #category : #accessing }
|
|
||||||
TiddlyWiki >> updateFilesFromRemote [
|
|
||||||
|
|
||||||
self remote ifNil: [ self inform: 'No remote found. If you have one, please provide its URL.'.
|
|
||||||
^ self ].
|
|
||||||
^ self downloadHTML;
|
|
||||||
importJSONLink
|
|
||||||
]
|
|
||||||
|
|
||||||
{ #category : #accessing }
|
{ #category : #accessing }
|
||||||
TiddlyWiki >> updateFromHtml [
|
TiddlyWiki >> updateFromHtml [
|
||||||
self
|
self
|
||||||
|
Loading…
Reference in New Issue
Block a user