Starting FedWiki modelling.
This commit is contained in:
parent
5f36628190
commit
f317287ed6
33
repository/TiddlyWiki/FedWikiPage.class.st
Normal file
33
repository/TiddlyWiki/FedWikiPage.class.st
Normal file
@ -0,0 +1,33 @@
|
||||
Class {
|
||||
#name : #FedWikiPage,
|
||||
#superclass : #Object,
|
||||
#instVars : [
|
||||
'url'
|
||||
],
|
||||
#category : #'TiddlyWiki-Model'
|
||||
}
|
||||
|
||||
{ #category : #accessing }
|
||||
FedWikiPage >> host [
|
||||
^ self url host
|
||||
]
|
||||
|
||||
{ #category : #accessing }
|
||||
FedWikiPage >> isView [
|
||||
^ self url firstPathSegment = 'view'
|
||||
]
|
||||
|
||||
{ #category : #accessing }
|
||||
FedWikiPage >> scheme [
|
||||
^ self url scheme
|
||||
]
|
||||
|
||||
{ #category : #accessing }
|
||||
FedWikiPage >> url [
|
||||
^ url
|
||||
]
|
||||
|
||||
{ #category : #accessing }
|
||||
FedWikiPage >> url: aString [
|
||||
url := aString asZnUrl
|
||||
]
|
@ -86,6 +86,15 @@ Tiddler >> fromMarkdownParsedItems: aCollection [
|
||||
]
|
||||
]
|
||||
|
||||
{ #category : #accessing }
|
||||
Tiddler >> importFedWikiPage: pageViewUrlString [
|
||||
| pageTitle pageViewUrl pageData |
|
||||
pageViewUrl := pageViewUrlString asZnUrl.
|
||||
pageTitle := pageViewUrl segments second.
|
||||
pageData := (pageViewUrl scheme, '://', pageViewUrl host, '/', pageTitle, '.json') asZnUrl.
|
||||
^ STONJSON fromString: pageData retrieveContents
|
||||
]
|
||||
|
||||
{ #category : #utilities }
|
||||
Tiddler >> itemContentsStringFor: item into: stream [
|
||||
stream
|
||||
|
Loading…
Reference in New Issue
Block a user