Sync. last work.
This commit is contained in:
parent
9f9bcb08a0
commit
d1320c4717
@ -91,6 +91,16 @@ GrafoscopioUtils class >> getContentsFrom: url withMessage: aString [
|
||||
^ client contents.
|
||||
]
|
||||
|
||||
{ #category : #persistence }
|
||||
GrafoscopioUtils class >> joinLinesFor: aCollection [
|
||||
|
||||
| joinedLines |
|
||||
|
||||
joinedLines := WriteStream on: ''.
|
||||
aCollection do: [ :line | joinedLines nextPutAll: line; crlf ].
|
||||
^ joinedLines contents
|
||||
]
|
||||
|
||||
{ #category : #utilities }
|
||||
GrafoscopioUtils class >> perform: aString on: anObject [
|
||||
|
||||
|
@ -6,6 +6,7 @@ Class {
|
||||
#superclass : #Object,
|
||||
#instVars : [
|
||||
'tocStyle',
|
||||
'comments',
|
||||
'header',
|
||||
'tail',
|
||||
'body',
|
||||
@ -30,14 +31,54 @@ Markdeep >> body: anObject [
|
||||
body := anObject
|
||||
]
|
||||
|
||||
{ #category : #accessing }
|
||||
Markdeep >> comments [
|
||||
^ comments ifNil: [ ^ comments := true ]
|
||||
]
|
||||
|
||||
{ #category : #accessing }
|
||||
Markdeep >> comments: aBoolean [
|
||||
"I tell if comments are enabled by default or not."
|
||||
comments := aBoolean
|
||||
]
|
||||
|
||||
{ #category : #utilities }
|
||||
Markdeep >> commentsProvider [
|
||||
"I return the url of the default service that provides annotation support.
|
||||
I am used to add such support in the contents of the Markdeep page."
|
||||
^ 'https://hypothes.is'
|
||||
]
|
||||
|
||||
{ #category : #utilities }
|
||||
Markdeep >> commentsProviderStrings [
|
||||
"I associate a comments service provider with the string that is required to be added
|
||||
to the document to enable such provider."
|
||||
| providers |
|
||||
providers := Dictionary new.
|
||||
providers at: 'https://hypothes.is' put: '<!-- Hypothesis -->
|
||||
<script src="https://hypothes.is/embed.js" async></script>'.
|
||||
^ providers
|
||||
|
||||
|
||||
]
|
||||
|
||||
{ #category : #utilities }
|
||||
Markdeep >> commentsSupport [
|
||||
"I enable comments of the page."
|
||||
|
||||
self comments ifFalse: [ ^ self ].
|
||||
^ self commentsProviderStrings at: self commentsProvider
|
||||
]
|
||||
|
||||
{ #category : #'instance creation' }
|
||||
Markdeep >> contents [
|
||||
| output |
|
||||
output := '' writeStream.
|
||||
output
|
||||
nextPutAll: self header; crlf;
|
||||
nextPutAll: (self body); crlf;
|
||||
nextPutAll: self tail.
|
||||
nextPutAll: self body; crlf;
|
||||
nextPutAll: self tail; crlf; crlf;
|
||||
nextPutAll: self commentsSupport.
|
||||
^ output contents.
|
||||
]
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user