Repackaging functionality.
This commit is contained in:
parent
294fa5bde3
commit
6a022aca13
8
src/Markdeep/LePage.extension.st
Normal file
8
src/Markdeep/LePage.extension.st
Normal file
@ -0,0 +1,8 @@
|
||||
Extension { #name : #LePage }
|
||||
|
||||
{ #category : #'*Markdeep' }
|
||||
LePage >> markdeepFileName [
|
||||
| sanitized |
|
||||
sanitized := self title asDashedLowercase copyWithoutAll: #($/).
|
||||
^ sanitized, '--',(self uidString copyFrom: 1 to: 5), '.md.html'.
|
||||
]
|
12
src/Markdeep/LeSnippet.extension.st
Normal file
12
src/Markdeep/LeSnippet.extension.st
Normal file
@ -0,0 +1,12 @@
|
||||
Extension { #name : #LeSnippet }
|
||||
|
||||
{ #category : #'*Markdeep' }
|
||||
LeSnippet class >> fromMetaMarkdeep: div [
|
||||
| className metadata snippet |
|
||||
className := (div xpath: '@st-class') stringValue.
|
||||
metadata := STON fromString:(div xpath: '@st-data') stringValue.
|
||||
snippet := className asClass new.
|
||||
snippet injectMetadataFrom: metadata.
|
||||
snippet contentFrom: div.
|
||||
^ snippet.
|
||||
]
|
11
src/Markdeep/LeTextualSnippet.extension.st
Normal file
11
src/Markdeep/LeTextualSnippet.extension.st
Normal file
@ -0,0 +1,11 @@
|
||||
Extension { #name : #LeTextualSnippet }
|
||||
|
||||
{ #category : #'*Markdeep' }
|
||||
LeTextualSnippet >> markdeepCustomCloser [
|
||||
^ ''
|
||||
]
|
||||
|
||||
{ #category : #'*Markdeep' }
|
||||
LeTextualSnippet >> markdeepCustomOpener [
|
||||
^ ''
|
||||
]
|
@ -7,14 +7,14 @@ Class {
|
||||
#instVars : [
|
||||
'title',
|
||||
'body',
|
||||
'tocStyle',
|
||||
'comments',
|
||||
'tail',
|
||||
'language',
|
||||
'config',
|
||||
'metadata',
|
||||
'head',
|
||||
'navTop'
|
||||
'navTop',
|
||||
'options'
|
||||
],
|
||||
#category : #Markdeep
|
||||
}
|
||||
@ -238,6 +238,19 @@ Markdeep >> navTop: aString [
|
||||
navTop:= aString.
|
||||
]
|
||||
|
||||
{ #category : #accessing }
|
||||
Markdeep >> options [
|
||||
^ options ifNil: [
|
||||
"Setting defaults accoding to: https://casual-effects.com/markdeep/#api"
|
||||
options := Dictionary new
|
||||
at: 'mode' put: nil;
|
||||
at: 'lang' put: nil;
|
||||
at: 'tocStyle' put: 'auto';
|
||||
at: 'autoLinkImages' put: true;
|
||||
yourself
|
||||
]
|
||||
]
|
||||
|
||||
{ #category : #printing }
|
||||
Markdeep >> printOn: aStream [
|
||||
|
||||
@ -288,12 +301,13 @@ Markdeep >> title: anObject [
|
||||
|
||||
{ #category : #accessing }
|
||||
Markdeep >> tocStyle [
|
||||
^ tocStyle ifNil: [ tocStyle := 'short' ]
|
||||
^ self options at: 'tocStyle' ifAbsent: [ 'short' ]
|
||||
]
|
||||
|
||||
{ #category : #accessing }
|
||||
Markdeep >> tocStyle: anObject [
|
||||
tocStyle := anObject
|
||||
Markdeep >> tocStyle: aString [
|
||||
"A string can be: 'auto' 'none' 'short' 'medium' or 'long'"
|
||||
self options at: 'tocStyle' put: aString
|
||||
]
|
||||
|
||||
{ #category : #'instance creation' }
|
||||
|
Loading…
Reference in New Issue
Block a user