Skip to content
This repository has been archived by the owner on Jan 13, 2024. It is now read-only.

Commit

Permalink
add parameter module_name to distinguish between folder name and modu…
Browse files Browse the repository at this point in the history
…le name (documentation generation)
  • Loading branch information
sdpython committed Feb 12, 2015
1 parent a4bac2e commit a3c1fb0
Showing 1 changed file with 11 additions and 3 deletions.
14 changes: 11 additions & 3 deletions src/pyquickhelper/helpgen/sphinx_main.py
Expand Up @@ -38,7 +38,8 @@ def generate_help_sphinx ( project_var_name,
filter_commit = lambda c : c.strip() != "documentation",
extra_ext = [],
nbformats = ["ipynb", "html", "python", "rst", "pdf"],
layout = [("html", "build", {})]) :
layout = [("html", "build", {})],
module_name = None) :
"""
runs the help generation
- copies every file in another folder
Expand All @@ -54,6 +55,8 @@ def generate_help_sphinx ( project_var_name,
@param nbformats requested formats for the notebooks conversion
@param layout list of formats sphinx should generate such as html, latex, pdf, docx,
it is a list of tuple (layout, build directory, parameters to override)
@param module_name name of the module (must be the folder name src/*name*, if None, *module_name*
will be replaced by *project_var_name*
The result is stored in path: ``root/_doc/sphinxdoc/source``.
We assume the file ``root/_doc/sphinxdoc/source/conf.py`` exists
Expand Down Expand Up @@ -110,6 +113,8 @@ def generate_help_sphinx ( project_var_name,
@code
<meta http-equiv="X-UA-Compatible" content="IE=edge" />
@endcode
.. versionchanged:: 1.0
"""
ie_layout_html()

Expand Down Expand Up @@ -144,15 +149,18 @@ def generate_help_sphinx ( project_var_name,

mapped_function = [ (".*[.]%s$" % ext.strip(".") , None) for ext in extra_ext ]

if module_name is None:
module_name = project_var_name

prepare_file_for_sphinx_help_generation (
{},
root,
"_doc/sphinxdoc/source/",
subfolders = [
("src/" + project_var_name, project_var_name),
("src/" + module_name, module_name),
],
silent = True,
rootrep = ("_doc.sphinxdoc.source.%s." % (project_var_name,), ""),
rootrep = ("_doc.sphinxdoc.source.%s." % (module_name,), ""),
optional_dirs = optional_dirs,
mapped_function = mapped_function,
replace_relative_import = False)
Expand Down

0 comments on commit a3c1fb0

Please sign in to comment.