Skip to content

Commit

Permalink
updates
Browse files Browse the repository at this point in the history
  • Loading branch information
arnoudbuzing committed Feb 13, 2018
1 parent e70299d commit fc1070a
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 1 deletion.
3 changes: 2 additions & 1 deletion Prototypes/PacletInfo.m
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,8 @@
"Prototypes`Ultimate",
"Prototypes`Penultimate",
"Prototypes`Antepenultimate",
"Prototypes`ElapsedTime"
"Prototypes`ElapsedTime",
"Prototypes`CreateNotebookIndex"
},
Context -> {"Prototypes`"} }
}
Expand Down
4 changes: 4 additions & 0 deletions Prototypes/Prototypes.wl
Original file line number Diff line number Diff line change
Expand Up @@ -88,6 +88,8 @@ Antepenultimate::usage = "Antepenultimate[expr] gives Part[expr,-3]";

ElapsedTime::usage = "ElapsedTime[unit,expr] evaluates 'expr' and returns the elapsed time in the specified unit";

CreateNotebookIndex::usage = "CreateNotebookIndex[] creates a SearchIndexObject of all notebooks located in $InstallationDirectory";

Begin["`Private`"];

(* general extensions *)
Expand Down Expand Up @@ -188,6 +190,8 @@ Get[ FileNameJoin[{DirectoryName[$InputFileName], "Client.wl"}] ];
(* load resource prototype functions *)
Get[ FileNameJoin[{DirectoryName[$InputFileName], "Resources.wl"}] ];

(* load search utilities *)
Get[ FileNameJoin[{DirectoryName[$InputFileName], "Search.wl"}] ];

(* random extensions *)
RandomGeoPosition[] := GeoPosition[{RandomReal[{-90, 90}], RandomReal[{-180, 180}]}];
Expand Down
5 changes: 5 additions & 0 deletions Prototypes/Search.wl
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
CreateNotebookIndex[] := Module[ {},
files = FileNames["*.nb", $InstallationDirectory, \[Infinity]];
PrintTemporary[ "Creating index of all notebooks under $InstallationDirectory (this will take a few minutes): ", ProgressIndicator[Appearance -> "Percolate"] ];
CreateSearchIndex[files, "NotebookIndex"]
]

0 comments on commit fc1070a

Please sign in to comment.