Renaming to support new HedgeDoc rebranding and improving Markdown metada.
This commit is contained in:
parent
5bb4c29bac
commit
887cdb0743
@ -6,7 +6,7 @@ so one document can start online (as a CodiMD pad) and continue as a Grafoscopio
|
||||
notebook or viceversa.
|
||||
"
|
||||
Class {
|
||||
#name : #CodiMD,
|
||||
#name : #HedgeDoc,
|
||||
#superclass : #Object,
|
||||
#instVars : [
|
||||
'server',
|
||||
@ -18,28 +18,28 @@ Class {
|
||||
}
|
||||
|
||||
{ #category : #'as yet unclassified' }
|
||||
CodiMD class >> newDefault [
|
||||
HedgeDoc class >> newDefault [
|
||||
^ self new
|
||||
defaultServer.
|
||||
]
|
||||
|
||||
{ #category : #accessing }
|
||||
CodiMD >> contents [
|
||||
HedgeDoc >> contents [
|
||||
^ contents
|
||||
]
|
||||
|
||||
{ #category : #accessing }
|
||||
CodiMD >> contents: anObject [
|
||||
HedgeDoc >> contents: anObject [
|
||||
contents := anObject
|
||||
]
|
||||
|
||||
{ #category : #'as yet unclassified' }
|
||||
CodiMD >> defaultServer [
|
||||
HedgeDoc >> defaultServer [
|
||||
self server: 'https://docutopia.tupale.co'.
|
||||
]
|
||||
|
||||
{ #category : #'as yet unclassified' }
|
||||
CodiMD >> htmlUrl [
|
||||
HedgeDoc >> htmlUrl [
|
||||
| link |
|
||||
link := self url copy.
|
||||
link segments insert: 's' before: 1.
|
||||
@ -47,28 +47,28 @@ CodiMD >> htmlUrl [
|
||||
]
|
||||
|
||||
{ #category : #'as yet unclassified' }
|
||||
CodiMD >> importContents [
|
||||
HedgeDoc >> importContents [
|
||||
self contents: self retrieveContents
|
||||
]
|
||||
|
||||
{ #category : #accessing }
|
||||
CodiMD >> pad [
|
||||
HedgeDoc >> pad [
|
||||
^ pad
|
||||
]
|
||||
|
||||
{ #category : #accessing }
|
||||
CodiMD >> pad: anObject [
|
||||
HedgeDoc >> pad: anObject [
|
||||
pad := anObject
|
||||
]
|
||||
|
||||
{ #category : #'as yet unclassified' }
|
||||
CodiMD >> retrieveContents [
|
||||
HedgeDoc >> retrieveContents [
|
||||
self url ifNil: [ ^ self ].
|
||||
^ (self url addPathSegment: 'download') retrieveContents
|
||||
]
|
||||
|
||||
{ #category : #'as yet unclassified' }
|
||||
CodiMD >> retrieveHtmlContents [
|
||||
HedgeDoc >> retrieveHtmlContents [
|
||||
| htmlContents |
|
||||
self url ifNil: [ ^ self ].
|
||||
htmlContents := self htmlUrl.
|
||||
@ -76,38 +76,38 @@ CodiMD >> retrieveHtmlContents [
|
||||
]
|
||||
|
||||
{ #category : #'as yet unclassified' }
|
||||
CodiMD >> saveContentsToFile: aFileLocator [
|
||||
HedgeDoc >> saveContentsToFile: aFileLocator [
|
||||
self url ifNil: [ ^ self ].
|
||||
^ (self url addPathSegment: 'download') saveContentsToFile: aFileLocator
|
||||
]
|
||||
|
||||
{ #category : #'as yet unclassified' }
|
||||
CodiMD >> saveHtmlContentsToFile: aFileLocator [
|
||||
HedgeDoc >> saveHtmlContentsToFile: aFileLocator [
|
||||
self url ifNil: [ ^ self ].
|
||||
^ self htmlUrl saveContentsToFile: aFileLocator
|
||||
]
|
||||
|
||||
{ #category : #accessing }
|
||||
CodiMD >> server [
|
||||
HedgeDoc >> server [
|
||||
^ server
|
||||
]
|
||||
|
||||
{ #category : #accessing }
|
||||
CodiMD >> server: aUrlString [
|
||||
HedgeDoc >> server: aUrlString [
|
||||
server := aUrlString
|
||||
]
|
||||
|
||||
{ #category : #accessing }
|
||||
CodiMD >> url [
|
||||
HedgeDoc >> url [
|
||||
^ url asUrl
|
||||
]
|
||||
|
||||
{ #category : #accessing }
|
||||
CodiMD >> url: anObject [
|
||||
HedgeDoc >> url: anObject [
|
||||
url := anObject
|
||||
]
|
||||
|
||||
{ #category : #visiting }
|
||||
CodiMD >> visit [
|
||||
HedgeDoc >> visit [
|
||||
WebBrowser openOn: self server, '/', self pad.
|
||||
]
|
@ -143,8 +143,12 @@ Markdown >> locateYAMLMetadataClosing [
|
||||
|
||||
{ #category : #accessing }
|
||||
Markdown >> metadata [
|
||||
|
||||
^ PPYAMLGrammar new parse: self extractYAMLMetadata.
|
||||
| rawMeta |
|
||||
rawMeta := PPYAMLGrammar new parse: self extractYAMLMetadata.
|
||||
rawMeta associationsDo: [ :assoc |
|
||||
assoc value = 'false' ifTrue: [ assoc value: false ].
|
||||
assoc value = 'true' ifTrue: [ assoc value: true ] ].
|
||||
^ rawMeta
|
||||
]
|
||||
|
||||
{ #category : #utilities }
|
||||
|
@ -114,8 +114,8 @@ Pandoc class >> luaFilters [
|
||||
{ #category : #converters }
|
||||
Pandoc class >> markdownToHtml: inputFile [
|
||||
|
||||
(Smalltalk os isUnix or: [ Smalltalk os isMacOS ]) ifTrue: [ self markdownToHtmlOnUnix: inputFile ].
|
||||
Smalltalk os isWindows ifTrue: [ self markdownToHtmlOnWindows: inputFile ].
|
||||
(Smalltalk os isUnix or: [ Smalltalk os isMacOS ]) ifTrue: [ ^ self markdownToHtmlOnUnix: inputFile ].
|
||||
Smalltalk os isWindows ifTrue: [ ^ self markdownToHtmlOnWindows: inputFile ].
|
||||
]
|
||||
|
||||
{ #category : #converters }
|
||||
|
Loading…
Reference in New Issue
Block a user