Skip to main content

No project description provided

Project description

DunderLab's Documentation Guide

This Python module facilitates the creation of Sphinx Documentation directly from Jupyter Notebooks. Essentially, it provides a preconfigured environment that utilizes nbsphinx in the background, complete with custom styles and preloaded modules.

Installation

$ pip install -U dunderlab-docs

To generate Sphinx documentation, start with the sphinx-quickstart command. Then, in the Sphinx conf.py file, add 'sphinx' and dunderlab.docs to the extensions list.

extensions = [
    'nbsphinx',
    'dunderlab.docs',
]

Configuration

dunderlab_custom_index

This setting allows you to insert a custom ReStructuredText into the index.rst file. This custom index will be rendered following the main index and will also appear in the sidebar.

dunderlab_custom_index = f"""
.. toctree::
   :glob:
   :maxdepth: 2
   :name: mastertoc3
   :caption: Submodule 1

   notebooks/submodule1/*


.. toctree::
   :glob:
   :maxdepth: 2
   :name: mastertoc3
   :caption: Submodule 2

   notebooks/submodule2/*
    """

dunderlab_color_links

Customize your documentation's appearance by altering the link colors. For instance, setting dunderlab_color_links to #4db6ac changes all links to a blue shade, adding a unique touch to your documentation. Remember, changes to the stylesheet impact the entire documentation, so test thoroughly before publishing.

dunderlab_color_links = '#4db6ac'

dunderlab_code_reference

This configuration value can be used to disable the generation of certain index inputs in Sphinx documentation. Specifically, setting to True will enable the generation of the index inputs genindex, modindex, and search, while setting it to False will disable their generation.

dunderlab_code_reference = False

dunderlab_github_repository

This configuration specifies the project repository, which will be used to adjust the URLs of the images in the README.md file.

Notebooks

In the first build, for example make clean html, the system will create (if not yet exist) the folder notebooks with some files in it.

docs/
    build/
    source/
        conf.py
        index.rst
        _modules/
        _static/
        _templates/
->      notebooks/
->          01-getting_started.ipynb
->          readme.ipynb
->          __sandbox.ipynb

The readme.ipynb notebook is mandatory, as it generates the README.md file in the root of the Python package. Documentation notebooks should be named with numeric prefixes for sorting purposes. Notebooks named with __ prefixes won't be rendered into the documentation.

Special Notebooks names

readme.ipynb

This notebook is used to generate the main documentation page, which is typically the index.rst file. The notebook is converted into a ReStructuredText file, which is then rendered as HTML to create the main documentation page. Additionally, the readme.ipynb notebook is also used to generate the README.md file that is typically found in the root of your project. This file can provide a brief overview of your project and its purpose, along with any relevant installation or usage instructions.

license.ipynb

This notebook is used to generate the LICENSE file that is typically found in the root of your project. This file specifies the terms under which your code is licensed and provides information about how others can use and modify your code. It is recommended that the license.ipynb notebook contain a single Markdown or plain text cell that includes the full text of your project's license. This can help ensure that the license text is accurate and up-to-date, and can simplify the process of updating the license if needed.

footer.ipynb

This notebook is used to generate a footer that appears at the bottom of the main documentation page and the project's README.md file. It can contain any content you want to include in the footer, such as copyright information, acknowledgments, or links to related resources. During the documentation build process, the notebook is converted into HTML and added to the bottom of the main documentation page and README.md file.

Features

  • Automatic generation of README.md
  • Automatic index in html view
  • Compatibe with Read the Docs

Troubleshooting

If the Index and Module Index appear empty:
Resolve this by adding the target module's path to the PATH variable in the conf.py file

import os
import sys

sys.path.insert(0, os.path.abspath('relative_path_to_module'))

If images aren't visible in the readmereadme.md file:
Verify their paths to ensure they're accessible from the GitHub repository. Relative paths must be correctly set relative to the README.md file's location.
The images used in the readme.ipynb notebook should be placed in a folder called _images.

test_image

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

dunderlab_docs-1.17.tar.gz (13.8 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

dunderlab_docs-1.17-py3-none-any.whl (12.3 kB view details)

Uploaded Python 3

File details

Details for the file dunderlab_docs-1.17.tar.gz.

File metadata

  • Download URL: dunderlab_docs-1.17.tar.gz
  • Upload date:
  • Size: 13.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.0.1.dev0+g94f810c.d20240510 CPython/3.12.4

File hashes

Hashes for dunderlab_docs-1.17.tar.gz
Algorithm Hash digest
SHA256 544e72e1e3cc9a1e90a021a54a8570943938f8d6739b9f89d53060e882af45c5
MD5 f5bde52d6e91fea83f0a58ac79a32925
BLAKE2b-256 f0f368e0a9b5b51d369b6cfbf316c78ef02acf1b2df8164c20dbfc1bc728ff42

See more details on using hashes here.

File details

Details for the file dunderlab_docs-1.17-py3-none-any.whl.

File metadata

  • Download URL: dunderlab_docs-1.17-py3-none-any.whl
  • Upload date:
  • Size: 12.3 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.0.1.dev0+g94f810c.d20240510 CPython/3.12.4

File hashes

Hashes for dunderlab_docs-1.17-py3-none-any.whl
Algorithm Hash digest
SHA256 07d2be5b36ad1b30302d7194d6a3c21e79518c69841249c0c9649c4d50a1ccc8
MD5 7a4d5d9b3b3731f97bc55b72915dd465
BLAKE2b-256 8c0c3c894a57afd9a9cc323d88742c69c0e6e53b4b7909a950035d88b3e5cfbe

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page