diff --git a/tools/documentation/matnwb_exportTutorials.m b/tools/documentation/matnwb_exportTutorials.m index b514a56f..7e18faa4 100644 --- a/tools/documentation/matnwb_exportTutorials.m +++ b/tools/documentation/matnwb_exportTutorials.m @@ -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)