Starting local server for exported documents. Exported pages by default on the same folder as their Lepiter JSON counterparts.
This commit is contained in:
parent
1d58571d39
commit
dbd9a495c2
@ -73,7 +73,7 @@ LePage >> asMarkdown [
|
|||||||
{ #category : #'*MiniDocs' }
|
{ #category : #'*MiniDocs' }
|
||||||
LePage >> asMarkdownFile [
|
LePage >> asMarkdownFile [
|
||||||
| folder |
|
| folder |
|
||||||
folder := self options at: 'storage' ifAbsent: [ FileLocator temp ].
|
folder := self storage.
|
||||||
^ MarkupFile exportAsFileOn: folder / self markdownFileName containing: self asMarkdown contents
|
^ MarkupFile exportAsFileOn: folder / self markdownFileName containing: self asMarkdown contents
|
||||||
]
|
]
|
||||||
|
|
||||||
@ -211,9 +211,9 @@ LePage >> sharedVariablesBindings [
|
|||||||
|
|
||||||
{ #category : #'*MiniDocs' }
|
{ #category : #'*MiniDocs' }
|
||||||
LePage >> storage [
|
LePage >> storage [
|
||||||
| temporal |
|
| current |
|
||||||
temporal := (FileLocator temp / 'lepiter') ensureCreateDirectory.
|
current := self database attachmentsDirectory parent.
|
||||||
self optionAt: 'storage' ifAbsent: [ ^ temporal ].
|
self optionAt: 'storage' ifAbsent: [ ^ current ].
|
||||||
(self optionAt: 'storage') ifNil: [ ^ temporal ].
|
(self optionAt: 'storage') ifNil: [ ^ current ].
|
||||||
^ self optionAt: 'storage'
|
^ self optionAt: 'storage'
|
||||||
]
|
]
|
||||||
|
36
src/MiniDocs/MiniDocsServer.class.st
Normal file
36
src/MiniDocs/MiniDocsServer.class.st
Normal file
@ -0,0 +1,36 @@
|
|||||||
|
Class {
|
||||||
|
#name : #MiniDocsServer,
|
||||||
|
#superclass : #Teapot,
|
||||||
|
#classInstVars : [
|
||||||
|
'storage'
|
||||||
|
],
|
||||||
|
#category : #MiniDocs
|
||||||
|
}
|
||||||
|
|
||||||
|
{ #category : #accessing }
|
||||||
|
MiniDocsServer class >> addStorage: anObject [
|
||||||
|
self storage add: anObject.
|
||||||
|
]
|
||||||
|
|
||||||
|
{ #category : #accessing }
|
||||||
|
MiniDocsServer class >> initialize [
|
||||||
|
self addStorage: FileLocator documents / 'lepiter' / 'default'
|
||||||
|
]
|
||||||
|
|
||||||
|
{ #category : #accessing }
|
||||||
|
MiniDocsServer class >> start [
|
||||||
|
self initialize.
|
||||||
|
^ self superclass on
|
||||||
|
serveStatic: '/lepiter/doc/' from: self storage first pathString;
|
||||||
|
start
|
||||||
|
]
|
||||||
|
|
||||||
|
{ #category : #accessing }
|
||||||
|
MiniDocsServer class >> storage [
|
||||||
|
^ storage ifNil: [ storage := OrderedCollection new]
|
||||||
|
]
|
||||||
|
|
||||||
|
{ #category : #accessing }
|
||||||
|
MiniDocsServer class >> storage: aFoldersOrderedCollection [
|
||||||
|
storage := aFoldersOrderedCollection
|
||||||
|
]
|
Loading…
Reference in New Issue
Block a user