Skip to content

Commit c0b66e6

Browse files
committed
Add Sphinx-gallery to doc
1 parent 1852d3e commit c0b66e6

20 files changed

+802
-1
lines changed

.flake8

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
[flake8]
22
max-line-length = 120
33
ignore = E305,E402,E721,E741,F405,W503,W504,F999
4-
exclude = build,docs/source,_ext,third_party
4+
exclude = build,docs/source,_ext,third_party,examples/gallery

.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -69,6 +69,8 @@ instance/
6969
# Sphinx documentation
7070
docs/_build/
7171
docs/src/
72+
docs/source/auto_examples
73+
docs/source/gen_modules
7274

7375
# PyBuilder
7476
target/

docs/requirements.txt

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,3 +4,6 @@ sphinxcontrib.katex
44
sphinxcontrib.bibtex
55
matplotlib
66
pyparsing<3,>=2.0.2
7+
sphinx_gallery
8+
IPython
9+
deep-phonemizer

docs/source/backend.rst

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,8 @@
33
torchaudio.backend
44
==================
55

6+
.. py:module:: torchaudio.backend
7+
68
Overview
79
~~~~~~~~
810

docs/source/compliance.kaldi.rst

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,8 @@ torchaudio.compliance.kaldi
66

77
.. currentmodule:: torchaudio.compliance.kaldi
88

9+
.. py:module:: torchaudio.compliance.kaldi
10+
911
The useful processing operations of kaldi_ can be performed with torchaudio.
1012
Various functions with identical parameters are given so that torchaudio can
1113
produce similar outputs.

docs/source/conf.py

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,7 @@
4242
'sphinx.ext.viewcode',
4343
'sphinxcontrib.katex',
4444
'sphinxcontrib.bibtex',
45+
'sphinx_gallery.gen_gallery',
4546
]
4647

4748
# katex options
@@ -58,6 +59,19 @@
5859

5960
bibtex_bibfiles = ['refs.bib']
6061

62+
sphinx_gallery_conf = {
63+
'examples_dirs': [
64+
'../../examples/gallery/wav2vec2',
65+
],
66+
'gallery_dirs': [
67+
'auto_examples/wav2vec2',
68+
],
69+
'filename_pattern': 'tutorial.py',
70+
'backreferences_dir': 'gen_modules/backreferences',
71+
'doc_module': ('torchaudio',),
72+
}
73+
autosummary_generate = True
74+
6175
napoleon_use_ivar = True
6276
napoleon_numpy_docstring = False
6377
napoleon_google_docstring = True

docs/source/datasets.rst

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
torchaudio.datasets
22
====================
33

4+
.. py:module:: torchaudio.datasets
5+
46
All datasets are subclasses of :class:`torch.utils.data.Dataset`
57
and have ``__getitem__`` and ``__len__`` methods implemented.
68
Hence, they can all be passed to a :class:`torch.utils.data.DataLoader`

docs/source/functional.rst

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,8 @@
44
torchaudio.functional
55
=====================
66

7+
.. py:module:: torchaudio.functional
8+
79
.. currentmodule:: torchaudio.functional
810

911
Functions to perform common audio operations.

docs/source/index.rst

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,11 @@ The :mod:`torchaudio` package consists of I/O, popular datasets and common audio
4242
utils
4343
prototype
4444

45+
.. toctree::
46+
:maxdepth: 2
47+
:caption: Tutorials
48+
49+
auto_examples/wav2vec2/index
4550

4651
.. toctree::
4752
:maxdepth: 1

docs/source/kaldi_io.rst

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,8 @@
44
torchaudio.kaldi_io
55
======================
66

7+
.. py:module:: torchaudio.kaldi_io
8+
79
.. currentmodule:: torchaudio.kaldi_io
810

911
To use this module, the dependency kaldi_io_ needs to be installed.

0 commit comments

Comments
 (0)