module helpgen.utils_sphinx_config
¶
Short summary¶
module pyquickhelper.helpgen.utils_sphinx_config
Check various settings.
Functions¶
function |
truncated documentation |
---|---|
Overwrites function getsitepackages which does not work for a virtual environment. |
|
Tries to local an image in the module for help generation in a folder |
|
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.
- pyquickhelper.helpgen.utils_sphinx_config.NbImage(*name, repository=None, force_github=False, width=None, branch='master', row_height=200, background=(255, 255, 255))[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) (or multiple names)
force_github – force the system to retrieve the image from GitHub
repository – repository, see below
width – to modify the width
branch – branch
row_height – row height if there are multiple images
background – background color (only if there multiple images)
- 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.See notebook Image and Images.
- pyquickhelper.helpgen.utils_sphinx_config._NbImage_path(name, repository=None, force_github=False, branch='master')[source]¶
- pyquickhelper.helpgen.utils_sphinx_config.getsitepackages()[source]¶
Overwrites function getsitepackages which does not work for a virtual environment.
- Returns:
site-package somewhere
- pyquickhelper.helpgen.utils_sphinx_config.locate_image_documentation(image_name)[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.