From 3f10487c9ee1d5d35baf8047850a136df809b1ca Mon Sep 17 00:00:00 2001 From: Offray Luna Date: Sun, 5 Mar 2023 20:43:32 -0500 Subject: [PATCH] Moving out to MiniDocs --- .../Grafoscopio-Utils/HedgeDoc.class.st | 124 ------------------ 1 file changed, 124 deletions(-) delete mode 100644 repository/Grafoscopio-Utils/HedgeDoc.class.st diff --git a/repository/Grafoscopio-Utils/HedgeDoc.class.st b/repository/Grafoscopio-Utils/HedgeDoc.class.st deleted file mode 100644 index ee4f39c..0000000 --- a/repository/Grafoscopio-Utils/HedgeDoc.class.st +++ /dev/null @@ -1,124 +0,0 @@ -" -I model the interface between a CodiMD (https://demo.codimd.org) documentation -server and Grafoscopio. -I enable the interaction between Grafoscopio notebooks and CodiMD documents, -so one document can start online (as a CodiMD pad) and continue as a Grafoscopio -notebook or viceversa. -" -Class { - #name : #HedgeDoc, - #superclass : #Object, - #instVars : [ - 'server', - 'pad', - 'contents', - 'url' - ], - #category : #'Grafoscopio-Utils-Core' -} - -{ #category : #'as yet unclassified' } -HedgeDoc class >> newDefault [ - ^ self new - defaultServer. -] - -{ #category : #accessing } -HedgeDoc >> asMarkdownTiddler [ - self url ifNil: [ ^ self ]. - ^ Tiddler new - title: self url segments first; - text: (self contents ifNil: [ self retrieveContents]); - type: 'text/x-markdown'; - created: Tiddler nowLocal. -] - -{ #category : #accessing } -HedgeDoc >> contents [ - ^ contents -] - -{ #category : #accessing } -HedgeDoc >> contents: anObject [ - contents := anObject -] - -{ #category : #'as yet unclassified' } -HedgeDoc >> defaultServer [ - self server: 'https://docutopia.tupale.co'. -] - -{ #category : #'as yet unclassified' } -HedgeDoc >> htmlUrl [ - | link | - link := self url copy. - link segments insert: 's' before: 1. - ^ link -] - -{ #category : #'as yet unclassified' } -HedgeDoc >> importContents [ - self contents: self retrieveContents -] - -{ #category : #accessing } -HedgeDoc >> pad [ - ^ pad -] - -{ #category : #accessing } -HedgeDoc >> pad: anObject [ - pad := anObject -] - -{ #category : #accessing } -HedgeDoc >> retrieveContents [ - self url ifNil: [ ^ self ]. - self contents: (self url addPathSegment: 'download') retrieveContents. - ^ self contents. -] - -{ #category : #'as yet unclassified' } -HedgeDoc >> retrieveHtmlContents [ - | htmlContents | - self url ifNil: [ ^ self ]. - htmlContents := self htmlUrl. - ^ htmlContents retrieveContents -] - -{ #category : #'as yet unclassified' } -HedgeDoc >> saveContentsToFile: aFileLocator [ - self url ifNil: [ ^ self ]. - ^ (self url addPathSegment: 'download') saveContentsToFile: aFileLocator -] - -{ #category : #'as yet unclassified' } -HedgeDoc >> saveHtmlContentsToFile: aFileLocator [ - self url ifNil: [ ^ self ]. - ^ self htmlUrl saveContentsToFile: aFileLocator -] - -{ #category : #accessing } -HedgeDoc >> server [ - ^ server -] - -{ #category : #accessing } -HedgeDoc >> server: aUrlString [ - server := aUrlString -] - -{ #category : #accessing } -HedgeDoc >> url [ - ^ url asUrl -] - -{ #category : #accessing } -HedgeDoc >> url: anObject [ - url := anObject -] - -{ #category : #visiting } -HedgeDoc >> visit [ - WebBrowser openOn: self server, '/', self pad. -]