Nim file exporter as a core utility belonging to MiniDocs.

This commit is contained in:
Offray Vladimir Luna Cárdenas 2023-01-17 17:24:08 -05:00
parent 8422570ebd
commit b60fa8b2e5

View File

@ -202,8 +202,8 @@ Tiddler >> exportSTONFileOptimized [
| exporter wikiFolder tiddlersFolder |
wikiFolder := self wiki folder.
exporter := wikiFolder / 'scripts' / 'stringAsFileInto'.
exporter exists ifFalse: [ self installTiddlerExporter ].
exporter := MiniDocs appFolder / 'scripts' / 'stringAsFileInto'.
exporter exists ifFalse: [ self installNimFileExporter ].
tiddlersFolder := wikiFolder / 'tiddlers'.
tiddlersFolder exists ifFalse: [ tiddlersFolder ensureCreateDirectory ].
@ -291,29 +291,6 @@ Tiddler >> importFedWikiPage: pageViewUrlString [
^ STONJSON fromString: pageData retrieveContents
]
{ #category : #accessing }
Tiddler >> installTiddlerExporter [
| folder |
folder := (self wiki folder).
folder := (folder / 'scripts') ensureCreateDirectory.
ZnClient new
url: 'https://mutabit.com/repos.fossil/mutabit/uv/wiki/scripts/stringAsFileInto';
downloadTo: folder / 'stringAsFileInto'.
ZnClient new
url: 'https://mutabit.com/repos.fossil/mutabit/doc/trunk/wiki/scripts/stringAsFileInto.nim';
downloadTo: folder / 'stringAsFileInto.nim'.
OSSUnixSubprocess new
command: 'chmod';
arguments: { '+x' . (folder / 'stringAsFileInto') fullName };
workingDirectory: folder fullName;
redirectStdout;
redirectStderr;
runAndWaitOnExitDo: [ :process :outString | ^ outString ]
]
{ #category : #testing }
Tiddler >> isImage [