module helpgen.utils_sphinx_config

Short summary

module pyquickhelper.helpgen.utils_sphinx_config

Check various settings.

source on GitHub

Functions

function

truncated documentation

getsitepackages

Overwrites function getsitepackages which does not work for a virtual environment.

ie_layout_html

The layout produced by sphinx does not always work with Internet Explorer. See Issue with some Sphinx themes and Internet Explorer. …

locate_image_documentation

Tries to local an image in the module for help generation in a folder _doc.

NbImage

Retrieves a name or a url of the image if it is not found in the local folder or a subfolder.

Documentation

Check various settings.

source on GitHub

pyquickhelper.helpgen.utils_sphinx_config.NbImage(name, repository=None, force_github=False, width=None)[source][source]

Retrieves a name or a url of the image if it is not found in the local folder or a subfolder.

Parameters
  • name – image name (name.png)

  • force_github – force the system to retrieve the image from GitHub

  • repository – repository, see below

  • width – to modify the width

Returns

an Image object

We assume the image is retrieved from a notebook. This function will display an image even though the notebook is not run from the sources. IPython must be installed.

if repository is None, then the function will use the variable module.__github__ to guess the location of the image. The function is able to retrieve an image in a subfolder. Displays a better message if __github__ was not found.

source on GitHub

pyquickhelper.helpgen.utils_sphinx_config.getsitepackages()[source][source]

Overwrites function getsitepackages which does not work for a virtual environment.

Returns

site-package somewhere

source on GitHub

pyquickhelper.helpgen.utils_sphinx_config.ie_layout_html()[source][source]

The layout produced by sphinx does not always work with Internet Explorer. See Issue with some Sphinx themes and Internet Explorer.

Returns

boolean

If False, raises a warning.

source on GitHub

pyquickhelper.helpgen.utils_sphinx_config.locate_image_documentation(image_name)[source][source]

Tries to local an image in the module for help generation in a folder _doc.

Parameters

image_name – path

Returns

local file

When a notebook is taken out from the sources, the image using NbImage cannot be displayed because the function cannot guess from which project it was taken. The function was entering an infinite loop. The function can deal with subfolder and not only the folder which contains the notebook.

source on GitHub