diff --git a/docs/conf.py b/docs/conf.py index 218cd3531..6b1bae97c 100755 --- a/docs/conf.py +++ b/docs/conf.py @@ -16,60 +16,61 @@ # directory, add these directories to sys.path here. If the directory is # relative to the documentation root, use os.path.abspath to make it # absolute, like shown here. -# import os import sys -sys.path.insert(0, os.path.abspath('..')) -from sphinx import __version__ as sphinxversion + +sys.path.insert(0, os.path.abspath("..")) + import cubids -from packaging import version as pver # Avoid distutils.LooseVersion which is deprecated # If extensions (or modules to document with autodoc) are in another directory, # add these directories to sys.path here. If the directory is relative to the # documentation root, use os.path.abspath to make it absolute, like shown here. -sys.path.append(os.path.abspath('sphinxext')) -sys.path.insert(0, os.path.abspath('../wrapper')) +sys.path.append(os.path.abspath("sphinxext")) +sys.path.insert(0, os.path.abspath("../wrapper")) # -- General configuration --------------------------------------------- # If your documentation needs a minimal Sphinx version, state it here. # -needs_sphinx = '1.5.3' +needs_sphinx = "1.5.3" # Add any Sphinx extension module names here, as strings. They can be # extensions coming with Sphinx (named 'sphinx.ext.*') or your custom # ones. extensions = [ - 'sphinx.ext.autodoc', - 'sphinx.ext.doctest', - 'sphinx.ext.intersphinx', - 'sphinx.ext.coverage', - 'sphinx.ext.mathjax', - 'sphinxarg.ext', # argparse extension - 'sphinx.ext.viewcode' + "nbsphinx", + "sphinx.ext.autodoc", + "sphinx.ext.doctest", + "sphinx.ext.intersphinx", + "sphinx.ext.coverage", + "sphinx.ext.mathjax", + "sphinxarg.ext", # argparse extension + "sphinx.ext.viewcode", + "sphinx_gallery.load_style", ] # Mock modules in autodoc: autodoc_mock_imports = [ - 'numpy', - 'nitime', - 'matplotlib', + "numpy", + "nitime", + "matplotlib", ] # Add any paths that contain templates here, relative to this directory. -templates_path = ['_templates'] +templates_path = ["_templates"] # The suffix(es) of source filenames. # You can specify multiple suffix as a list of string: # # source_suffix = ['.rst', '.md'] -source_suffix = '.rst' +source_suffix = ".rst" # The master toctree document. -master_doc = 'index' +master_doc = "index" # General information about the project. -project = 'CuBIDS' +project = "CuBIDS" copyright = "2020, PennLINC" author = "PennLINC" @@ -87,15 +88,15 @@ # # This is also used if you do content translation via gettext catalogs. # Usually you set "language" from the command line for these cases. -language = 'en' +language = "en" # List of patterns, relative to source directory, that match files and # directories to ignore when looking for source files. # This patterns also effect to html_static_path and html_extra_path -exclude_patterns = ['_build', 'Thumbs.db', '.DS_Store'] +exclude_patterns = ["_build", "Thumbs.db", ".DS_Store"] # The name of the Pygments (syntax highlighting) style to use. -pygments_style = 'sphinx' +pygments_style = "sphinx" # If true, `todo` and `todoList` produce output, else they produce nothing. todo_include_todos = False @@ -106,8 +107,10 @@ # The theme to use for HTML and HTML Help pages. See the documentation for # a list of builtin themes. # -html_theme = 'sphinx_rtd_theme' -html_theme_path = ["_themes", ] +html_theme = "sphinx_rtd_theme" +html_theme_path = [ + "_themes", +] # Theme options are theme-specific and customize the look and feel of a # theme further. For a list of options available for each theme, see the @@ -118,13 +121,13 @@ # Add any paths that contain custom static files (such as style sheets) here, # relative to this directory. They are copied after the builtin static files, # so a file named "default.css" will overwrite the builtin "default.css". -html_static_path = ['_static'] +html_static_path = ["_static"] # -- Options for HTMLHelp output --------------------------------------- # Output file base name for HTML help builder. -htmlhelp_basename = 'cubidsdoc' +htmlhelp_basename = "cubidsdoc" # -- Options for LaTeX output ------------------------------------------ @@ -133,15 +136,12 @@ # The paper size ('letterpaper' or 'a4paper'). # # 'papersize': 'letterpaper', - # The font size ('10pt', '11pt' or '12pt'). # # 'pointsize': '10pt', - # Additional stuff for the LaTeX preamble. # # 'preamble': '', - # Latex figure (float) alignment # # 'figure_align': 'htbp', @@ -151,9 +151,7 @@ # (source start file, target name, title, author, documentclass # [howto, manual, or own class]). latex_documents = [ - (master_doc, 'cubids.tex', - 'CuBIDS Documentation', - 'PennLINC', 'manual'), + (master_doc, "cubids.tex", "CuBIDS Documentation", "PennLINC", "manual"), ] @@ -161,11 +159,7 @@ # One entry per manual page. List of tuples # (source start file, name, description, authors, manual section). -man_pages = [ - (master_doc, 'cubids', - 'CuBIDS Documentation', - [author], 1) -] +man_pages = [(master_doc, "cubids", "CuBIDS Documentation", [author], 1)] # -- Options for Texinfo output ---------------------------------------- @@ -174,14 +168,16 @@ # (source start file, target name, title, author, # dir menu entry, description, category) texinfo_documents = [ - (master_doc, 'cubids', - 'CuBIDS Documentation', - author, - 'cubids', - 'One line description of project.', - 'Miscellaneous'), + ( + master_doc, + "cubids", + "CuBIDS Documentation", + author, + "cubids", + "One line description of project.", + "Miscellaneous", + ), ] # -- Fix automodule config add_module_names = False - diff --git a/docs/examples.rst b/docs/examples.rst new file mode 100644 index 000000000..a9ed3a6ae --- /dev/null +++ b/docs/examples.rst @@ -0,0 +1,14 @@ +Thumbnails gallery +================== + +.. nbgallery:: + notebooks/Fieldmaps + notebooks/FirstProofofConcept + notebooks/HTML_param_groups + notebooks/JSON_PoC_read_write + notebooks/Key_and_Param_Groups + notebooks/keyparamgrouptest + notebooks/metadata_image_param + notebooks/PofC_Key_Values2 + notebooks/rename_files_work + notebooks/workwithtestdata diff --git a/notebooks/Fieldmaps.ipynb b/docs/notebooks/Fieldmaps.ipynb similarity index 100% rename from notebooks/Fieldmaps.ipynb rename to docs/notebooks/Fieldmaps.ipynb diff --git a/notebooks/FirstProofofConcept.ipynb b/docs/notebooks/FirstProofofConcept.ipynb similarity index 100% rename from notebooks/FirstProofofConcept.ipynb rename to docs/notebooks/FirstProofofConcept.ipynb diff --git a/notebooks/HTML_param_groups.ipynb b/docs/notebooks/HTML_param_groups.ipynb similarity index 100% rename from notebooks/HTML_param_groups.ipynb rename to docs/notebooks/HTML_param_groups.ipynb diff --git a/notebooks/JSON_PoC_read_write.ipynb b/docs/notebooks/JSON_PoC_read_write.ipynb similarity index 100% rename from notebooks/JSON_PoC_read_write.ipynb rename to docs/notebooks/JSON_PoC_read_write.ipynb diff --git a/notebooks/Key_and_Param_Groups.ipynb b/docs/notebooks/Key_and_Param_Groups.ipynb similarity index 100% rename from notebooks/Key_and_Param_Groups.ipynb rename to docs/notebooks/Key_and_Param_Groups.ipynb diff --git a/notebooks/PofC_Key_Values2.ipynb b/docs/notebooks/PofC_Key_Values2.ipynb similarity index 100% rename from notebooks/PofC_Key_Values2.ipynb rename to docs/notebooks/PofC_Key_Values2.ipynb diff --git a/notebooks/Tests/datatype-anat_reconstruction-refaced_suffix-T1w.csv b/docs/notebooks/Tests/datatype-anat_reconstruction-refaced_suffix-T1w.csv similarity index 100% rename from notebooks/Tests/datatype-anat_reconstruction-refaced_suffix-T1w.csv rename to docs/notebooks/Tests/datatype-anat_reconstruction-refaced_suffix-T1w.csv diff --git a/notebooks/Tests/datatype-func_run-1_suffix-bold_task-rest.csv b/docs/notebooks/Tests/datatype-func_run-1_suffix-bold_task-rest.csv similarity index 100% rename from notebooks/Tests/datatype-func_run-1_suffix-bold_task-rest.csv rename to docs/notebooks/Tests/datatype-func_run-1_suffix-bold_task-rest.csv diff --git a/notebooks/Tests/datatype-func_run-2_suffix-bold_task-rest.csv b/docs/notebooks/Tests/datatype-func_run-2_suffix-bold_task-rest.csv similarity index 100% rename from notebooks/Tests/datatype-func_run-2_suffix-bold_task-rest.csv rename to docs/notebooks/Tests/datatype-func_run-2_suffix-bold_task-rest.csv diff --git a/notebooks/keyparamgrouptest.ipynb b/docs/notebooks/keyparamgrouptest.ipynb similarity index 100% rename from notebooks/keyparamgrouptest.ipynb rename to docs/notebooks/keyparamgrouptest.ipynb diff --git a/notebooks/metadata_image_param.ipynb b/docs/notebooks/metadata_image_param.ipynb similarity index 100% rename from notebooks/metadata_image_param.ipynb rename to docs/notebooks/metadata_image_param.ipynb diff --git a/notebooks/rename_files_work.ipynb b/docs/notebooks/rename_files_work.ipynb similarity index 100% rename from notebooks/rename_files_work.ipynb rename to docs/notebooks/rename_files_work.ipynb diff --git a/notebooks/workwithtestdata.ipynb b/docs/notebooks/workwithtestdata.ipynb similarity index 100% rename from notebooks/workwithtestdata.ipynb rename to docs/notebooks/workwithtestdata.ipynb diff --git a/pyproject.toml b/pyproject.toml index 0c25e9bf6..804b05f71 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -44,11 +44,12 @@ Paper = "https://doi.org/10.1016/j.neuroimage.2022.119609" doc = [ "nbsphinx", "packaging", + "recommonmark", "sphinx >= 2.2", "sphinx-argparse", - "sphinx_rtd_theme", + "sphinx_gallery", "sphinx_markdown_tables", - "recommonmark", + "sphinx_rtd_theme", ] tests = [ "codespell",