Repository: Lightning-Universe/lightning-bolts

Issue:
Documentation theme
## 🚀 Feature

Align documentation (template) with Pytorch-Lightning

### Additional context

use https://github.com/PyTorchLightning/lightning_sphinx_theme



Discussion:
Hi! thanks for your contribution!, great first issue!

Resolving patch:
diff --git a/docs/source/conf.py b/docs/source/conf.py
--- a/docs/source/conf.py
+++ b/docs/source/conf.py
@@ -15,8 +15,12 @@
 import glob
 import shutil
 import inspect
+import re
+# import m2r
 import builtins
 
+import pt_lightning_sphinx_theme
+
 PATH_HERE = os.path.abspath(os.path.dirname(__file__))
 PATH_ROOT = os.path.join(PATH_HERE, '..', '..')
 sys.path.insert(0, os.path.abspath(PATH_ROOT))
@@ -42,6 +46,23 @@
 github_repo = project
 
 
+# -- Project documents -------------------------------------------------------
+
+# export the documentation
+with open('intro.rst', 'w') as fp:
+    fp.write(pytorch_lightning_bolts.__long_doc__)
+
+# export the READme
+with open(os.path.join(PATH_ROOT, 'README.md'), 'r') as fp:
+    readme = fp.read()
+# TODO: temp fix removing SVG badges and GIF, because PDF cannot show them
+readme = re.sub(r'(\[!\[.*\))', '', readme)
+readme = re.sub(r'(!\[.*.gif\))', '', readme)
+for dir_name in (os.path.basename(p) for p in glob.glob(os.path.join(PATH_ROOT, '*')) if os.path.isdir(p)):
+    readme = readme.replace('](%s/' % dir_name, '](%s/%s/' % (PATH_ROOT, dir_name))
+with open('readme.md', 'w') as fp:
+    fp.write(readme)
+
 # -- General configuration ---------------------------------------------------
 
 # If your documentation needs a minimal Sphinx version, state it here.
@@ -64,6 +85,7 @@
     'sphinx.ext.napoleon',
     'recommonmark',
     'sphinx.ext.autosectionlabel',
+    # 'm2r',
     'nbsphinx',
     'sphinx_autodoc_typehints',
     'sphinx_paramlinks',
@@ -119,19 +141,25 @@
 # The theme to use for HTML and HTML Help pages.  See the documentation for
 # a list of builtin themes.
 #
-html_theme = 'alabaster'
+html_theme = 'pt_lightning_sphinx_theme'
+html_theme_path = [pt_lightning_sphinx_theme.get_html_theme_path()]
 
 # 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
 # documentation.
 
 html_theme_options = {
+    'pytorch_project': pytorch_lightning_bolts.__homepage__,
+    'canonical_url': pytorch_lightning_bolts.__homepage__,
+    'collapse_navigation': False,
+    'display_version': True,
+    'logo_only': False,
 }
 
 # 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 = ['_templates']  # '_static'
 
 # -- Options for HTMLHelp output ---------------------------------------------
 
@@ -176,7 +204,8 @@
 #  dir menu entry, description, category)
 texinfo_documents = [
     (master_doc, project, project + ' Documentation', author, project,
-     'One line description of project.', 'Miscellaneous'),
+     'The lightweight PyTorch wrapper for ML researchers. Scale your models. Write less boilerplate.',
+     'Miscellaneous'),
 ]
 
 # -- Options for Epub output -------------------------------------------------
@@ -199,7 +228,11 @@
 # -- Options for intersphinx extension ---------------------------------------
 
 # Example configuration for intersphinx: refer to the Python standard library.
-intersphinx_mapping = {'https://docs.python.org/': None}
+intersphinx_mapping = {
+    'python': ('https://docs.python.org/3', None),
+    'torch': ('https://pytorch.org/docs/stable/', None),
+    'numpy': ('https://docs.scipy.org/doc/numpy/', None),
+}
 
 # -- Options for todo extension ----------------------------------------------
 
@@ -309,7 +342,7 @@ def find_source():
     'methods': None,
     # 'attributes': None,
     'special-members': '__call__',
-    # 'exclude-members': '__weakref__',
+    'exclude-members': '_abc_impl',
     'show-inheritance': True,
     'private-members': True,
     'noindex': True,
diff --git a/pytorch_lightning_bolts/__init__.py b/pytorch_lightning_bolts/__init__.py
--- a/pytorch_lightning_bolts/__init__.py
+++ b/pytorch_lightning_bolts/__init__.py
@@ -9,6 +9,33 @@
 __copyright__ = 'Copyright (c) 2020-2020, %s.' % __author__
 __homepage__ = 'https://github.com/PyTorchLightning/pytorch-lightning-bolts'
 __docs__ = "PyTorch Lightning Bolts is a community contribution for ML researchers."
+__long_doc__ = """
+What is it?
+-----------
+Bolts is a collection of useful models and templates to bootstrap your DL research even faster.
+It's designed to work  with PyTorch Lightning
+
+Example
+-------
+
+.. code-block:: python
+
+    from pytorch_lightning_bolts.vaes import VAE
+    from pytorch_lightning import Trainer
+
+    vae = VAE()
+
+    # train VAE
+    trainer = Trainer()
+    trainer.fit(vae)
+
+How to add a model
+------------------
+
+This repository is meant for model contributions from the community.
+To add a model, you can start with the MNIST template (or any other model in the repo).
+Please organize the functions of your lightning module.
+"""
 
 PACKAGE_ROOT = os.path.dirname(__file__)
 


Test patch: