-
Notifications
You must be signed in to change notification settings - Fork 49
/
Copy pathdeploy.m
executable file
·35 lines (29 loc) · 1.08 KB
/
deploy.m
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
(* ::Package:: *)
ClearAll[DeployDocumentation];
DeployDocumentation[root_String, target_String, setperm : True | False : False] := (
Parallelize@Scan[
With[{relpath =
First@StringCases[#, root ~~ "/" ... ~~ relative__ :> relative,
1]},
PrintTemporary["Copying " <> relpath];
CopyFile[#, CloudObject[FileNameJoin[{target,relpath}]],
OverwriteTarget -> True];
If[setperm,
SetOptions[CloudObject[FileNameJoin[{target,relpath}]],
Permissions -> "Public"]
];
]
&,
FileNames[{"*.js", "*.html", "*.css", "*.png", "*.svg"}, root, Infinity]
];
If[setperm,
SetOptions[CloudObject[target],Permissions -> "Public"]
];
CloudObject[FileNameJoin[{target,"index.html"}]]
);
$doc = "/Users/dorianb/Work/Mathematica/Workspaces/WolframClientForPython/docs";
$root = FileNameJoin[{$doc, "_build","html"}]
DeployDocumentation[$root, "lcl/python/doc/", True]
$doc = "/Users/dorianb/Work/Matematica/Workspaces/wxfparser/doc";
DeployDocumentation[$doc,"wxf/java/doc/", True]
SetPermissions[CloudObject["wxf/java/doc"],"Public"]