diff --git a/docs/source/_static/html/tutorials/basicUsage.html b/docs/source/_static/html/tutorials/basicUsage.html index c9cab5d2..d5b51d3f 100644 --- a/docs/source/_static/html/tutorials/basicUsage.html +++ b/docs/source/_static/html/tutorials/basicUsage.html @@ -428,4 +428,13 @@ end ##### SOURCE END ##### --> - \ No newline at end of file + + \ No newline at end of file diff --git a/docs/source/_static/html/tutorials/behavior.html b/docs/source/_static/html/tutorials/behavior.html index 4f70f592..b44de917 100644 --- a/docs/source/_static/html/tutorials/behavior.html +++ b/docs/source/_static/html/tutorials/behavior.html @@ -366,4 +366,13 @@ fprintf('Exported NWB file to "%s"\n', 'behavior_tutorial.nwb') ##### SOURCE END ##### --> - \ No newline at end of file + + \ No newline at end of file diff --git a/docs/source/_static/html/tutorials/dimensionMapNoDataPipes.html b/docs/source/_static/html/tutorials/dimensionMapNoDataPipes.html index 34e8d692..c5c619d0 100644 --- a/docs/source/_static/html/tutorials/dimensionMapNoDataPipes.html +++ b/docs/source/_static/html/tutorials/dimensionMapNoDataPipes.html @@ -89,4 +89,13 @@ % ##### SOURCE END ##### --> - \ No newline at end of file + + \ No newline at end of file diff --git a/docs/source/_static/html/tutorials/dimensionMapWithDataPipes.html b/docs/source/_static/html/tutorials/dimensionMapWithDataPipes.html index fb17536d..b503d8dd 100644 --- a/docs/source/_static/html/tutorials/dimensionMapWithDataPipes.html +++ b/docs/source/_static/html/tutorials/dimensionMapWithDataPipes.html @@ -107,4 +107,13 @@ % ##### SOURCE END ##### --> - \ No newline at end of file + + \ No newline at end of file diff --git a/docs/source/_static/html/tutorials/dynamic_tables.html b/docs/source/_static/html/tutorials/dynamic_tables.html index af3f6c88..ffa50eda 100644 --- a/docs/source/_static/html/tutorials/dynamic_tables.html +++ b/docs/source/_static/html/tutorials/dynamic_tables.html @@ -574,4 +574,13 @@ % ##### SOURCE END ##### --> - \ No newline at end of file + + \ No newline at end of file diff --git a/docs/source/_static/html/tutorials/dynamically_loaded_filters.html b/docs/source/_static/html/tutorials/dynamically_loaded_filters.html index 7250e315..e41ebef3 100644 --- a/docs/source/_static/html/tutorials/dynamically_loaded_filters.html +++ b/docs/source/_static/html/tutorials/dynamically_loaded_filters.html @@ -138,4 +138,13 @@ % ##### SOURCE END ##### --> - \ No newline at end of file + + \ No newline at end of file diff --git a/docs/source/_static/html/tutorials/ecephys.html b/docs/source/_static/html/tutorials/ecephys.html index 8d82796e..3e84eb39 100644 --- a/docs/source/_static/html/tutorials/ecephys.html +++ b/docs/source/_static/html/tutorials/ecephys.html @@ -1353,4 +1353,13 @@ %% ##### SOURCE END ##### --> - \ No newline at end of file + + \ No newline at end of file diff --git a/docs/source/_static/html/tutorials/icephys.html b/docs/source/_static/html/tutorials/icephys.html index 5b095148..4901d2d7 100644 --- a/docs/source/_static/html/tutorials/icephys.html +++ b/docs/source/_static/html/tutorials/icephys.html @@ -506,4 +506,13 @@ % ##### SOURCE END ##### --> - \ No newline at end of file + + \ No newline at end of file diff --git a/docs/source/_static/html/tutorials/images.html b/docs/source/_static/html/tutorials/images.html index bbdaecdf..50bf1797 100644 --- a/docs/source/_static/html/tutorials/images.html +++ b/docs/source/_static/html/tutorials/images.html @@ -368,4 +368,13 @@ nwbExport(nwb, "images_test.nwb"); ##### SOURCE END ##### --> - \ No newline at end of file + + \ No newline at end of file diff --git a/docs/source/_static/html/tutorials/intro.html b/docs/source/_static/html/tutorials/intro.html index 63ebd0ce..89727651 100644 --- a/docs/source/_static/html/tutorials/intro.html +++ b/docs/source/_static/html/tutorials/intro.html @@ -304,4 +304,13 @@ % documentation> to learn what data types are available. ##### SOURCE END ##### --> - \ No newline at end of file + + \ No newline at end of file diff --git a/docs/source/_static/html/tutorials/ogen.html b/docs/source/_static/html/tutorials/ogen.html index 4e19478b..a0f2ac53 100644 --- a/docs/source/_static/html/tutorials/ogen.html +++ b/docs/source/_static/html/tutorials/ogen.html @@ -198,4 +198,13 @@ nwbExport(nwb, 'ogen_tutorial.nwb'); ##### SOURCE END ##### --> - \ No newline at end of file + + \ No newline at end of file diff --git a/docs/source/_static/html/tutorials/ophys.html b/docs/source/_static/html/tutorials/ophys.html index c9cab142..72271094 100644 --- a/docs/source/_static/html/tutorials/ophys.html +++ b/docs/source/_static/html/tutorials/ophys.html @@ -476,4 +476,13 @@ %% ##### SOURCE END ##### --> - \ No newline at end of file + + \ No newline at end of file diff --git a/docs/source/_static/html/tutorials/read_demo.html b/docs/source/_static/html/tutorials/read_demo.html index 46c9dafb..60d29ef1 100644 --- a/docs/source/_static/html/tutorials/read_demo.html +++ b/docs/source/_static/html/tutorials/read_demo.html @@ -353,4 +353,13 @@ % out the DANDI breakout session later in this event. ##### SOURCE END ##### --> - \ No newline at end of file + + \ No newline at end of file diff --git a/docs/source/_static/html/tutorials/remote_read.html b/docs/source/_static/html/tutorials/remote_read.html index 9746120e..b549d092 100644 --- a/docs/source/_static/html/tutorials/remote_read.html +++ b/docs/source/_static/html/tutorials/remote_read.html @@ -55,4 +55,13 @@ % ##### SOURCE END ##### --> - \ No newline at end of file + + \ No newline at end of file diff --git a/docs/source/_static/html/tutorials/scratch.html b/docs/source/_static/html/tutorials/scratch.html index fe467263..5efa82e6 100644 --- a/docs/source/_static/html/tutorials/scratch.html +++ b/docs/source/_static/html/tutorials/scratch.html @@ -161,4 +161,13 @@ % ##### SOURCE END ##### --> - \ No newline at end of file + + \ No newline at end of file diff --git a/tools/documentation/private/postProcessLivescriptHtml.m b/tools/documentation/private/postProcessLivescriptHtml.m new file mode 100644 index 00000000..14b7b138 --- /dev/null +++ b/tools/documentation/private/postProcessLivescriptHtml.m @@ -0,0 +1,54 @@ +function postProcessLivescriptHtml(htmlFile) + %POSTPROCESSLIVESCRIPHTML Update links in an HTML file to open in the top frame + % + % This function reads an HTML file and updates all tags with an + % href attribute starting with "https:" by adding or updating the + % target attribute to "top". The modified HTML content is written + % back to the same file. + % + % Syntax: + % postProcessLivescriptHtml(htmlFile) + % + % Input: + % htmlFile - (1,1) string: Path to the HTML file to process. + % + % Example: + % postProcessLivescriptHtml("example.html"); + % + % This will ensure that links in "example.html" with href="https:" + % open in the top frame when clicked. + + % The purpose of this function is to ensure links open in the top frame + % and not an iframe if tutorial htmls are embedded in an iframe. + + arguments + htmlFile (1,1) string {mustBeFile} + end + + % Read the content of the HTML file + htmlContent = fileread(htmlFile); + + % % Add target="top" to links with href starting with https + % updatedHtmlContent = regexprep(htmlContent, ... + % '", ... + sprintf("%s", str)); + + % Write the modified content back to the HTML file + try + fid = fopen(htmlFile, 'wt'); + if fid == -1 + error('Could not open the file for writing: %s', htmlFile); + end + fwrite(fid, updatedHtmlContent, 'char'); + fclose(fid); + catch + error('Could not write to the file: %s', htmlFile); + end +end