Skip to content

Commit

Permalink
Update export location for tutorial html files
Browse files Browse the repository at this point in the history
  • Loading branch information
ehennestad committed Dec 6, 2024
1 parent 48ba248 commit 8dddf6e
Showing 1 changed file with 10 additions and 5 deletions.
15 changes: 10 additions & 5 deletions tools/documentation/matnwb_exportTutorials.m
Original file line number Diff line number Diff line change
Expand Up @@ -18,17 +18,22 @@ function matnwb_exportTutorials(options)
options.IgnoreFiles (1,:) string = ["basicUsage", "read_demo", "remote_read"];
options.RunLivescript (1,1) logical = true
end

EXPORT_FOLDERS = dictionary(...
'.m', fullfile(misc.getMatnwbDir, "tutorials", "private", "mcode"), ...
'.html', fullfile(misc.getMatnwbDir, "docs", "source", "_static", "html", "tutorials") );

[exportFormat, targetFolderNames] = deal(options.ExportFormat);

targetFolderNames = extractAfter(targetFolderNames, ".");
targetFolderNames(strcmp(targetFolderNames, "m")) = fullfile("private", "mcode");

nwbTutorialDir = fullfile(misc.getMatnwbDir, "tutorials");
targetFolderPaths = fullfile(nwbTutorialDir, targetFolderNames);

for folderPath = targetFolderPaths
if ~isfolder(folderPath); mkdir(folderPath); end

for i = 1:numel(exportFormat)
if isKey(EXPORT_FOLDERS, exportFormat(i))
targetFolderPaths(i) = EXPORT_FOLDERS(exportFormat(i));
end
if ~isfolder(targetFolderPaths(i)); mkdir(targetFolderPaths(i)); end
end

if isempty(options.FilePaths)
Expand Down

0 comments on commit 8dddf6e

Please sign in to comment.