Renaming to support new HedgeDoc rebranding and improving Markdown metada.

This commit is contained in:
Offray Vladimir Luna Cárdenas 2020-11-19 19:02:37 -05:00
parent 5bb4c29bac
commit 887cdb0743
3 changed files with 26 additions and 22 deletions

View File

@ -6,7 +6,7 @@ so one document can start online (as a CodiMD pad) and continue as a Grafoscopio
notebook or viceversa. notebook or viceversa.
" "
Class { Class {
#name : #CodiMD, #name : #HedgeDoc,
#superclass : #Object, #superclass : #Object,
#instVars : [ #instVars : [
'server', 'server',
@ -18,28 +18,28 @@ Class {
} }
{ #category : #'as yet unclassified' } { #category : #'as yet unclassified' }
CodiMD class >> newDefault [ HedgeDoc class >> newDefault [
^ self new ^ self new
defaultServer. defaultServer.
] ]
{ #category : #accessing } { #category : #accessing }
CodiMD >> contents [ HedgeDoc >> contents [
^ contents ^ contents
] ]
{ #category : #accessing } { #category : #accessing }
CodiMD >> contents: anObject [ HedgeDoc >> contents: anObject [
contents := anObject contents := anObject
] ]
{ #category : #'as yet unclassified' } { #category : #'as yet unclassified' }
CodiMD >> defaultServer [ HedgeDoc >> defaultServer [
self server: 'https://docutopia.tupale.co'. self server: 'https://docutopia.tupale.co'.
] ]
{ #category : #'as yet unclassified' } { #category : #'as yet unclassified' }
CodiMD >> htmlUrl [ HedgeDoc >> htmlUrl [
| link | | link |
link := self url copy. link := self url copy.
link segments insert: 's' before: 1. link segments insert: 's' before: 1.
@ -47,28 +47,28 @@ CodiMD >> htmlUrl [
] ]
{ #category : #'as yet unclassified' } { #category : #'as yet unclassified' }
CodiMD >> importContents [ HedgeDoc >> importContents [
self contents: self retrieveContents self contents: self retrieveContents
] ]
{ #category : #accessing } { #category : #accessing }
CodiMD >> pad [ HedgeDoc >> pad [
^ pad ^ pad
] ]
{ #category : #accessing } { #category : #accessing }
CodiMD >> pad: anObject [ HedgeDoc >> pad: anObject [
pad := anObject pad := anObject
] ]
{ #category : #'as yet unclassified' } { #category : #'as yet unclassified' }
CodiMD >> retrieveContents [ HedgeDoc >> retrieveContents [
self url ifNil: [ ^ self ]. self url ifNil: [ ^ self ].
^ (self url addPathSegment: 'download') retrieveContents ^ (self url addPathSegment: 'download') retrieveContents
] ]
{ #category : #'as yet unclassified' } { #category : #'as yet unclassified' }
CodiMD >> retrieveHtmlContents [ HedgeDoc >> retrieveHtmlContents [
| htmlContents | | htmlContents |
self url ifNil: [ ^ self ]. self url ifNil: [ ^ self ].
htmlContents := self htmlUrl. htmlContents := self htmlUrl.
@ -76,38 +76,38 @@ CodiMD >> retrieveHtmlContents [
] ]
{ #category : #'as yet unclassified' } { #category : #'as yet unclassified' }
CodiMD >> saveContentsToFile: aFileLocator [ HedgeDoc >> saveContentsToFile: aFileLocator [
self url ifNil: [ ^ self ]. self url ifNil: [ ^ self ].
^ (self url addPathSegment: 'download') saveContentsToFile: aFileLocator ^ (self url addPathSegment: 'download') saveContentsToFile: aFileLocator
] ]
{ #category : #'as yet unclassified' } { #category : #'as yet unclassified' }
CodiMD >> saveHtmlContentsToFile: aFileLocator [ HedgeDoc >> saveHtmlContentsToFile: aFileLocator [
self url ifNil: [ ^ self ]. self url ifNil: [ ^ self ].
^ self htmlUrl saveContentsToFile: aFileLocator ^ self htmlUrl saveContentsToFile: aFileLocator
] ]
{ #category : #accessing } { #category : #accessing }
CodiMD >> server [ HedgeDoc >> server [
^ server ^ server
] ]
{ #category : #accessing } { #category : #accessing }
CodiMD >> server: aUrlString [ HedgeDoc >> server: aUrlString [
server := aUrlString server := aUrlString
] ]
{ #category : #accessing } { #category : #accessing }
CodiMD >> url [ HedgeDoc >> url [
^ url asUrl ^ url asUrl
] ]
{ #category : #accessing } { #category : #accessing }
CodiMD >> url: anObject [ HedgeDoc >> url: anObject [
url := anObject url := anObject
] ]
{ #category : #visiting } { #category : #visiting }
CodiMD >> visit [ HedgeDoc >> visit [
WebBrowser openOn: self server, '/', self pad. WebBrowser openOn: self server, '/', self pad.
] ]

View File

@ -143,8 +143,12 @@ Markdown >> locateYAMLMetadataClosing [
{ #category : #accessing } { #category : #accessing }
Markdown >> metadata [ Markdown >> metadata [
| rawMeta |
^ PPYAMLGrammar new parse: self extractYAMLMetadata. 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 } { #category : #utilities }

View File

@ -114,8 +114,8 @@ Pandoc class >> luaFilters [
{ #category : #converters } { #category : #converters }
Pandoc class >> markdownToHtml: inputFile [ Pandoc class >> markdownToHtml: inputFile [
(Smalltalk os isUnix or: [ Smalltalk os isMacOS ]) ifTrue: [ self markdownToHtmlOnUnix: inputFile ]. (Smalltalk os isUnix or: [ Smalltalk os isMacOS ]) ifTrue: [ ^ self markdownToHtmlOnUnix: inputFile ].
Smalltalk os isWindows ifTrue: [ self markdownToHtmlOnWindows: inputFile ]. Smalltalk os isWindows ifTrue: [ ^ self markdownToHtmlOnWindows: inputFile ].
] ]
{ #category : #converters } { #category : #converters }