Creating install template method and LePage modified as html.
This commit is contained in:
parent
1443293763
commit
7a704d517d
@ -2,8 +2,16 @@ Extension { #name : #LePage }
|
|||||||
|
|
||||||
{ #category : #'*MiniDocs' }
|
{ #category : #'*MiniDocs' }
|
||||||
LePage >> asHtmlFile [
|
LePage >> asHtmlFile [
|
||||||
|
|
||||||
self asMarkdownFile.
|
self asMarkdownFile.
|
||||||
"pandoc" self htmlFileName
|
self defaultPandocTemplate exists
|
||||||
|
ifFalse: [ MarkupFile installTemplate: 'https://mutabit.com/repos.fossil/mutabit/doc/trunk/plantillas/Pandoc/clean-menu-mod.html' into: self defaultPandocTemplate parent ].
|
||||||
|
|
||||||
|
OSSUnixSubprocess new
|
||||||
|
command: 'pandoc' ;
|
||||||
|
arguments: { self markdownFileName. '-o'. self htmlFileName};
|
||||||
|
workingDirectory: self storage;
|
||||||
|
runAndWaitOnExitDo: [ :process :outString | ^ self storage / self htmlFileName].
|
||||||
]
|
]
|
||||||
|
|
||||||
{ #category : #'*MiniDocs' }
|
{ #category : #'*MiniDocs' }
|
||||||
@ -67,6 +75,12 @@ LePage >> asMarkdownFile [
|
|||||||
^ MarkupFile exportAsFileOn: folder / self markdownFileName containing: self asMarkdown contents
|
^ MarkupFile exportAsFileOn: folder / self markdownFileName containing: self asMarkdown contents
|
||||||
]
|
]
|
||||||
|
|
||||||
|
{ #category : #'*MiniDocs' }
|
||||||
|
LePage >> defaultPandocTemplate [
|
||||||
|
|
||||||
|
^ FileLocator home / '.pandoc' / 'templates' / 'clean-menu-mod.html'
|
||||||
|
]
|
||||||
|
|
||||||
{ #category : #'*MiniDocs' }
|
{ #category : #'*MiniDocs' }
|
||||||
LePage >> exportedFileName [
|
LePage >> exportedFileName [
|
||||||
| sanitized |
|
| sanitized |
|
||||||
@ -97,3 +111,10 @@ LePage >> preorderTraversal [
|
|||||||
self withDeepCollect: [:each | each allChildrenBreadthFirstDo: [:child | output add: child ] ].
|
self withDeepCollect: [:each | each allChildrenBreadthFirstDo: [:child | output add: child ] ].
|
||||||
^ output.
|
^ output.
|
||||||
]
|
]
|
||||||
|
|
||||||
|
{ #category : #'*MiniDocs' }
|
||||||
|
LePage >> storage [
|
||||||
|
|
||||||
|
^ self optionAt: 'storage'
|
||||||
|
ifAbsent: [ ^ FileLocator temp ]
|
||||||
|
]
|
||||||
|
@ -21,3 +21,17 @@ MarkupFile class >> exportAsFileOn: aFileReferenceOrFileName containing: text [
|
|||||||
self inform: 'Exported as: ', String cr, file fullName.
|
self inform: 'Exported as: ', String cr, file fullName.
|
||||||
^ file
|
^ file
|
||||||
]
|
]
|
||||||
|
|
||||||
|
{ #category : #accessing }
|
||||||
|
MarkupFile class >> installTemplate: anUrl into: aFolder [
|
||||||
|
|
||||||
|
| fileName |
|
||||||
|
fileName := anUrl asUrl segments last.
|
||||||
|
(aFolder / fileName) exists
|
||||||
|
ifTrue: [ (aFolder / fileName) ensureDeleteFile ]
|
||||||
|
ifFalse: [ aFolder ensureCreateDirectory ].
|
||||||
|
ZnClient new
|
||||||
|
url: anUrl;
|
||||||
|
downloadTo: aFolder.
|
||||||
|
^ aFolder
|
||||||
|
]
|
||||||
|
Loading…
Reference in New Issue
Block a user