diff --git a/docs/source/_config/tutorial_config.json b/docs/source/_config/tutorial_config.json new file mode 100644 index 00000000..6ee7d734 --- /dev/null +++ b/docs/source/_config/tutorial_config.json @@ -0,0 +1,19 @@ +{ + "intro": "Getting Started with MatNWB", + "read_demo": "Reading NWB Files with MatNWB", + "basicUsage": "Basic Usage of MatNWB", + "dimensionMapNoDataPipes": "Mapping Dimensions without DataPipes", + "dimensionMapWithDataPipes": "Mapping Dimensions with DataPipes", + "convertTrials": "Converting Trials to NWB Format", + "dynamic_tables": "Using Dynamic Tables in MatNWB", + "scratch": "Working with Scratch Space in MatNWB", + "behavior": "Behavior Data Processing", + "ecephys": "Electrophysiology", + "icephys": "Intracellular Electrophysiology", + "images": "Image Data", + "ogen": "Optogenetics", + "ophys": "Optical Physiology", + "dataPipe": "Advanced Writing Using DataPipes", + "dynamically_loaded_filters": "Implementing Dynamically Loaded Filters", + "remote_read": "Reading NWB Files from Remote Locations" +} diff --git a/docs/source/pages/tutorials/basicUsage.rst b/docs/source/pages/tutorials/basicUsage.rst index 5e1c8f10..b6d45886 100644 --- a/docs/source/pages/tutorials/basicUsage.rst +++ b/docs/source/pages/tutorials/basicUsage.rst @@ -1,6 +1,10 @@ -basicUsage -=============================== +Basic Usage of MatNWB +===================== + +.. image:: https://www.mathworks.com/images/responsive/global/open-in-matlab-online.svg + :target: https://matlab.mathworks.com/open/github/v1?repo=NeurodataWithoutBorders/matnwb&file=tutorials/basicUsage.mlx + :alt: Open in MATLAB Online .. raw:: html - + diff --git a/docs/source/pages/tutorials/behavior.rst b/docs/source/pages/tutorials/behavior.rst index c15fe726..ad0192c5 100644 --- a/docs/source/pages/tutorials/behavior.rst +++ b/docs/source/pages/tutorials/behavior.rst @@ -1,6 +1,10 @@ -behavior -=============================== +Behavior Data Processing +======================== + +.. image:: https://www.mathworks.com/images/responsive/global/open-in-matlab-online.svg + :target: https://matlab.mathworks.com/open/github/v1?repo=NeurodataWithoutBorders/matnwb&file=tutorials/behavior.mlx + :alt: Open in MATLAB Online .. raw:: html - + diff --git a/docs/source/pages/tutorials/convertTrials.rst b/docs/source/pages/tutorials/convertTrials.rst index 313e15ca..873d7023 100644 --- a/docs/source/pages/tutorials/convertTrials.rst +++ b/docs/source/pages/tutorials/convertTrials.rst @@ -1,6 +1,10 @@ -convertTrials +Converting Trials to NWB Format =============================== +.. image:: https://www.mathworks.com/images/responsive/global/open-in-matlab-online.svg + :target: https://matlab.mathworks.com/open/github/v1?repo=NeurodataWithoutBorders/matnwb&file=tutorials/convertTrials.mlx + :alt: Open in MATLAB Online + .. raw:: html - + diff --git a/docs/source/pages/tutorials/dataPipe.rst b/docs/source/pages/tutorials/dataPipe.rst index 8f7436a3..2376c019 100644 --- a/docs/source/pages/tutorials/dataPipe.rst +++ b/docs/source/pages/tutorials/dataPipe.rst @@ -1,6 +1,10 @@ -dataPipe -=============================== +Advanced Writing Using DataPipes +================================ + +.. image:: https://www.mathworks.com/images/responsive/global/open-in-matlab-online.svg + :target: https://matlab.mathworks.com/open/github/v1?repo=NeurodataWithoutBorders/matnwb&file=tutorials/dataPipe.mlx + :alt: Open in MATLAB Online .. raw:: html - + diff --git a/docs/source/pages/tutorials/dimensionMapNoDataPipes.rst b/docs/source/pages/tutorials/dimensionMapNoDataPipes.rst index 8fb67911..3e88f879 100644 --- a/docs/source/pages/tutorials/dimensionMapNoDataPipes.rst +++ b/docs/source/pages/tutorials/dimensionMapNoDataPipes.rst @@ -1,6 +1,10 @@ -dimensionMapNoDataPipes -=============================== +Mapping Dimensions without DataPipes +==================================== + +.. image:: https://www.mathworks.com/images/responsive/global/open-in-matlab-online.svg + :target: https://matlab.mathworks.com/open/github/v1?repo=NeurodataWithoutBorders/matnwb&file=tutorials/dimensionMapNoDataPipes.mlx + :alt: Open in MATLAB Online .. raw:: html - + diff --git a/docs/source/pages/tutorials/dimensionMapWithDataPipes.rst b/docs/source/pages/tutorials/dimensionMapWithDataPipes.rst index 27f0e4f6..3b8a1f64 100644 --- a/docs/source/pages/tutorials/dimensionMapWithDataPipes.rst +++ b/docs/source/pages/tutorials/dimensionMapWithDataPipes.rst @@ -1,6 +1,10 @@ -dimensionMapWithDataPipes -=============================== +Mapping Dimensions with DataPipes +================================= + +.. image:: https://www.mathworks.com/images/responsive/global/open-in-matlab-online.svg + :target: https://matlab.mathworks.com/open/github/v1?repo=NeurodataWithoutBorders/matnwb&file=tutorials/dimensionMapWithDataPipes.mlx + :alt: Open in MATLAB Online .. raw:: html - + diff --git a/docs/source/pages/tutorials/dynamic_tables.rst b/docs/source/pages/tutorials/dynamic_tables.rst index a74dbe21..65094ae2 100644 --- a/docs/source/pages/tutorials/dynamic_tables.rst +++ b/docs/source/pages/tutorials/dynamic_tables.rst @@ -1,6 +1,10 @@ -dynamic_tables -=============================== +Using Dynamic Tables in MatNWB +============================== + +.. image:: https://www.mathworks.com/images/responsive/global/open-in-matlab-online.svg + :target: https://matlab.mathworks.com/open/github/v1?repo=NeurodataWithoutBorders/matnwb&file=tutorials/dynamic_tables.mlx + :alt: Open in MATLAB Online .. raw:: html - + diff --git a/docs/source/pages/tutorials/dynamically_loaded_filters.rst b/docs/source/pages/tutorials/dynamically_loaded_filters.rst index e7600fea..a9791692 100644 --- a/docs/source/pages/tutorials/dynamically_loaded_filters.rst +++ b/docs/source/pages/tutorials/dynamically_loaded_filters.rst @@ -1,6 +1,10 @@ -dynamically_loaded_filters -=============================== +Implementing Dynamically Loaded Filters +======================================= + +.. image:: https://www.mathworks.com/images/responsive/global/open-in-matlab-online.svg + :target: https://matlab.mathworks.com/open/github/v1?repo=NeurodataWithoutBorders/matnwb&file=tutorials/dynamically_loaded_filters.mlx + :alt: Open in MATLAB Online .. raw:: html - + diff --git a/docs/source/pages/tutorials/ecephys.rst b/docs/source/pages/tutorials/ecephys.rst index 4e476bc2..39d7ca27 100644 --- a/docs/source/pages/tutorials/ecephys.rst +++ b/docs/source/pages/tutorials/ecephys.rst @@ -1,6 +1,10 @@ -ecephys -=============================== +Electrophysiology +================= + +.. image:: https://www.mathworks.com/images/responsive/global/open-in-matlab-online.svg + :target: https://matlab.mathworks.com/open/github/v1?repo=NeurodataWithoutBorders/matnwb&file=tutorials/ecephys.mlx + :alt: Open in MATLAB Online .. raw:: html - + diff --git a/docs/source/pages/tutorials/icephys.rst b/docs/source/pages/tutorials/icephys.rst index a1f3eb78..3e851463 100644 --- a/docs/source/pages/tutorials/icephys.rst +++ b/docs/source/pages/tutorials/icephys.rst @@ -1,6 +1,10 @@ -icephys +Intracellular Electrophysiology =============================== +.. image:: https://www.mathworks.com/images/responsive/global/open-in-matlab-online.svg + :target: https://matlab.mathworks.com/open/github/v1?repo=NeurodataWithoutBorders/matnwb&file=tutorials/icephys.mlx + :alt: Open in MATLAB Online + .. raw:: html - + diff --git a/docs/source/pages/tutorials/images.rst b/docs/source/pages/tutorials/images.rst index bc088579..c1de5f9a 100644 --- a/docs/source/pages/tutorials/images.rst +++ b/docs/source/pages/tutorials/images.rst @@ -1,6 +1,10 @@ -images -=============================== +Image Data +========== + +.. image:: https://www.mathworks.com/images/responsive/global/open-in-matlab-online.svg + :target: https://matlab.mathworks.com/open/github/v1?repo=NeurodataWithoutBorders/matnwb&file=tutorials/images.mlx + :alt: Open in MATLAB Online .. raw:: html - + diff --git a/docs/source/pages/tutorials/index.rst b/docs/source/pages/tutorials/index.rst index 1b349ecf..a93692f9 100644 --- a/docs/source/pages/tutorials/index.rst +++ b/docs/source/pages/tutorials/index.rst @@ -1,24 +1,37 @@ Tutorials ========= +General Tutorials +----------------- .. toctree:: :maxdepth: 1 - :caption: Tutorials + intro + read_demo basicUsage - behavior - convertTrials - dataPipe dimensionMapNoDataPipes dimensionMapWithDataPipes + convertTrials dynamic_tables - dynamically_loaded_filters + scratch + +Domain-Specific Tutorials +------------------------- +.. toctree:: + :maxdepth: 1 + + behavior ecephys icephys images - intro ogen ophys - read_demo + +Advanced I/O +------------ +.. toctree:: + :maxdepth: 1 + + dataPipe + dynamically_loaded_filters remote_read - scratch \ No newline at end of file diff --git a/docs/source/pages/tutorials/intro.rst b/docs/source/pages/tutorials/intro.rst index 24aadfa2..5be8616d 100644 --- a/docs/source/pages/tutorials/intro.rst +++ b/docs/source/pages/tutorials/intro.rst @@ -1,6 +1,10 @@ -intro -=============================== +Getting Started with MatNWB +=========================== + +.. image:: https://www.mathworks.com/images/responsive/global/open-in-matlab-online.svg + :target: https://matlab.mathworks.com/open/github/v1?repo=NeurodataWithoutBorders/matnwb&file=tutorials/intro.mlx + :alt: Open in MATLAB Online .. raw:: html - + diff --git a/docs/source/pages/tutorials/ogen.rst b/docs/source/pages/tutorials/ogen.rst index ede496c7..20afd1ae 100644 --- a/docs/source/pages/tutorials/ogen.rst +++ b/docs/source/pages/tutorials/ogen.rst @@ -1,6 +1,10 @@ -ogen -=============================== +Optogenetics +============ + +.. image:: https://www.mathworks.com/images/responsive/global/open-in-matlab-online.svg + :target: https://matlab.mathworks.com/open/github/v1?repo=NeurodataWithoutBorders/matnwb&file=tutorials/ogen.mlx + :alt: Open in MATLAB Online .. raw:: html - + diff --git a/docs/source/pages/tutorials/ophys.rst b/docs/source/pages/tutorials/ophys.rst index 511360ae..506b7b0f 100644 --- a/docs/source/pages/tutorials/ophys.rst +++ b/docs/source/pages/tutorials/ophys.rst @@ -1,6 +1,10 @@ -ophys -=============================== +Optical Physiology +================== + +.. image:: https://www.mathworks.com/images/responsive/global/open-in-matlab-online.svg + :target: https://matlab.mathworks.com/open/github/v1?repo=NeurodataWithoutBorders/matnwb&file=tutorials/ophys.mlx + :alt: Open in MATLAB Online .. raw:: html - + diff --git a/docs/source/pages/tutorials/read_demo.rst b/docs/source/pages/tutorials/read_demo.rst index 7cb5392c..a2e22c59 100644 --- a/docs/source/pages/tutorials/read_demo.rst +++ b/docs/source/pages/tutorials/read_demo.rst @@ -1,6 +1,10 @@ -read_demo -=============================== +Reading NWB Files with MatNWB +============================= + +.. image:: https://www.mathworks.com/images/responsive/global/open-in-matlab-online.svg + :target: https://matlab.mathworks.com/open/github/v1?repo=NeurodataWithoutBorders/matnwb&file=tutorials/read_demo.mlx + :alt: Open in MATLAB Online .. raw:: html - + diff --git a/docs/source/pages/tutorials/remote_read.rst b/docs/source/pages/tutorials/remote_read.rst index 5b920117..259ac823 100644 --- a/docs/source/pages/tutorials/remote_read.rst +++ b/docs/source/pages/tutorials/remote_read.rst @@ -1,6 +1,10 @@ -remote_read -=============================== +Reading NWB Files from Remote Locations +======================================= + +.. image:: https://www.mathworks.com/images/responsive/global/open-in-matlab-online.svg + :target: https://matlab.mathworks.com/open/github/v1?repo=NeurodataWithoutBorders/matnwb&file=tutorials/remote_read.mlx + :alt: Open in MATLAB Online .. raw:: html - + diff --git a/docs/source/pages/tutorials/scratch.rst b/docs/source/pages/tutorials/scratch.rst index bcd17732..86292af4 100644 --- a/docs/source/pages/tutorials/scratch.rst +++ b/docs/source/pages/tutorials/scratch.rst @@ -1,6 +1,10 @@ -scratch -=============================== +Working with Scratch Space in MatNWB +==================================== + +.. image:: https://www.mathworks.com/images/responsive/global/open-in-matlab-online.svg + :target: https://matlab.mathworks.com/open/github/v1?repo=NeurodataWithoutBorders/matnwb&file=tutorials/scratch.mlx + :alt: Open in MATLAB Online .. raw:: html - + diff --git a/tools/documentation/_rst_templates/tutorial.rst.template b/tools/documentation/_rst_templates/tutorial.rst.template index 5c1b30fe..ecb9a0a3 100644 --- a/tools/documentation/_rst_templates/tutorial.rst.template +++ b/tools/documentation/_rst_templates/tutorial.rst.template @@ -1,6 +1,10 @@ -{{tutorial_name}} -=============================== +{{tutorial_title}} +{{tutorial_title_underline}} + +.. image:: https://www.mathworks.com/images/responsive/global/open-in-matlab-online.svg + :target: https://matlab.mathworks.com/open/github/v1?repo=NeurodataWithoutBorders/matnwb&file=tutorials/{{tutorial_name}}.mlx + :alt: Open in MATLAB Online .. raw:: html - + diff --git a/tools/documentation/private/generateRstForTutorials.m b/tools/documentation/private/generateRstForTutorials.m index 977d9a60..c1339cfa 100644 --- a/tools/documentation/private/generateRstForTutorials.m +++ b/tools/documentation/private/generateRstForTutorials.m @@ -7,6 +7,9 @@ function generateRstForTutorials() tutorialRstTargetDir = fullfile(docsSourceRootDir, 'pages', 'tutorials'); if ~isfolder(tutorialRstTargetDir); mkdir(tutorialRstTargetDir); end + tutorialConfigFilePath = fullfile(docsSourceRootDir, '_config', 'tutorial_config.json'); + S = jsondecode(fileread(tutorialConfigFilePath)); + rstTemplate = fileread( getRstTemplateFile('tutorial') ); % List all html files in source dir @@ -17,9 +20,12 @@ function generateRstForTutorials() relPath = strrep(thisFilePath, docsSourceRootDir, '../..'); [~, name] = fileparts(relPath); + title = S.(name); rstOutput = replace(rstTemplate, '{{static_html_path}}', relPath); rstOutput = replace(rstOutput, '{{tutorial_name}}', name); + rstOutput = replace(rstOutput, '{{tutorial_title}}', title); + rstOutput = replace(rstOutput, '{{tutorial_title_underline}}', repmat('=', 1, numel(title))); rstOutputFile = fullfile(tutorialRstTargetDir, [name, '.rst']); fid = fopen(rstOutputFile, 'wt'); @@ -34,5 +40,5 @@ function generateRstForTutorials() thisRst = fillTemplate(indexTemplate, data); rstFilePath = fullfile(tutorialRstTargetDir, ['index', '.rst']); - filewrite(rstFilePath, thisRst); + %filewrite(rstFilePath, thisRst); end \ No newline at end of file