Starting FedWiki modelling.

This commit is contained in:
Offray Vladimir Luna Cárdenas 2021-08-04 11:36:20 -05:00
parent 5f36628190
commit f317287ed6
2 changed files with 42 additions and 0 deletions

View 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
]

View File

@ -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 } { #category : #utilities }
Tiddler >> itemContentsStringFor: item into: stream [ Tiddler >> itemContentsStringFor: item into: stream [
stream stream