Improving remote and local storage for TiddlyWiki.
This commit is contained in:
parent
b8b4c6863e
commit
7725213f7a
@ -9,7 +9,9 @@ Class {
|
|||||||
#superclass : 'Object',
|
#superclass : 'Object',
|
||||||
#instVars : [
|
#instVars : [
|
||||||
'tiddlers',
|
'tiddlers',
|
||||||
'file'
|
'file',
|
||||||
|
'remote',
|
||||||
|
'name'
|
||||||
],
|
],
|
||||||
#category : 'TiddlyWiki-Model'
|
#category : 'TiddlyWiki-Model'
|
||||||
}
|
}
|
||||||
@ -53,6 +55,40 @@ TiddlyWiki >> importJSONFile [
|
|||||||
])
|
])
|
||||||
]
|
]
|
||||||
|
|
||||||
|
{ #category : 'accessing' }
|
||||||
|
TiddlyWiki >> local [
|
||||||
|
^ self file
|
||||||
|
]
|
||||||
|
|
||||||
|
{ #category : 'accessing' }
|
||||||
|
TiddlyWiki >> local: aFileRefence [
|
||||||
|
^ self file:aFileRefence
|
||||||
|
]
|
||||||
|
|
||||||
|
{ #category : 'accessing' }
|
||||||
|
TiddlyWiki >> name [
|
||||||
|
|
||||||
|
^ name ifNil: [
|
||||||
|
self file
|
||||||
|
ifNil: [ | tempName suffix |
|
||||||
|
tempName := self remote file.
|
||||||
|
(tempName endsWithAnyOf: #('.html' '.htm'))
|
||||||
|
ifTrue: [
|
||||||
|
suffix := (tempName splitOn: '.') last.
|
||||||
|
tempName := tempName removeSuffix: '.', suffix.
|
||||||
|
].
|
||||||
|
name := tempName
|
||||||
|
]
|
||||||
|
ifNotNil: [ name := self file basenameWithoutExtension ]
|
||||||
|
]
|
||||||
|
]
|
||||||
|
|
||||||
|
{ #category : 'accessing' }
|
||||||
|
TiddlyWiki >> name: aString [
|
||||||
|
|
||||||
|
name := aString
|
||||||
|
]
|
||||||
|
|
||||||
{ #category : 'accessing' }
|
{ #category : 'accessing' }
|
||||||
TiddlyWiki >> networkView [
|
TiddlyWiki >> networkView [
|
||||||
| view |
|
| view |
|
||||||
@ -72,6 +108,18 @@ TiddlyWiki >> printOn: aStream [
|
|||||||
nextPutAll: '( ', self file basename ,' )'
|
nextPutAll: '( ', self file basename ,' )'
|
||||||
]
|
]
|
||||||
|
|
||||||
|
{ #category : 'accessing' }
|
||||||
|
TiddlyWiki >> remote [
|
||||||
|
|
||||||
|
^ remote
|
||||||
|
]
|
||||||
|
|
||||||
|
{ #category : 'accessing' }
|
||||||
|
TiddlyWiki >> remote: aUrlString [
|
||||||
|
|
||||||
|
remote := aUrlString asZnUrl
|
||||||
|
]
|
||||||
|
|
||||||
{ #category : 'accessing' }
|
{ #category : 'accessing' }
|
||||||
TiddlyWiki >> taggedWith: aTag [
|
TiddlyWiki >> taggedWith: aTag [
|
||||||
^ self tiddlers select: [:tiddler |
|
^ self tiddlers select: [:tiddler |
|
||||||
|
@ -31,6 +31,7 @@ WikiText >> convertMarkdownBold [
|
|||||||
{ #category : 'conversions' }
|
{ #category : 'conversions' }
|
||||||
WikiText >> convertMarkdownLinks [
|
WikiText >> convertMarkdownLinks [
|
||||||
| markdownLinks markdownLinksRegex |
|
| markdownLinks markdownLinksRegex |
|
||||||
|
"\[([\w|\s]+)\]\((\S+)\)"
|
||||||
markdownLinksRegex := '\[([\w|\s]+)\]\((\S+)\)'.
|
markdownLinksRegex := '\[([\w|\s]+)\]\((\S+)\)'.
|
||||||
"For the explanation of the Regex details see: http://scottradcliff.com/how-to-parse-urls-in-markdown.html"
|
"For the explanation of the Regex details see: http://scottradcliff.com/how-to-parse-urls-in-markdown.html"
|
||||||
markdownLinks := self content regex: markdownLinksRegex matchesCollect: [:link | link ].
|
markdownLinks := self content regex: markdownLinksRegex matchesCollect: [:link | link ].
|
||||||
|
Loading…
Reference in New Issue
Block a user