Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

If module named "modules",it will get wrong content #5362

Closed
ghost opened this issue Aug 29, 2018 · 2 comments
Closed

If module named "modules",it will get wrong content #5362

ghost opened this issue Aug 29, 2018 · 2 comments

Comments

@ghost
Copy link

ghost commented Aug 29, 2018

Problem

If module named "modules",it will got wrong content.

dev
===

.. toctree::
   :maxdepth: 4

   conf
   handlers

Title "dev" is the directory name which I want to using sphinx to generating API documentation.

"conf" / "handlers" and "modules" in the same directory("dev").Directory structure like:

dev
├── conf
│   ├── a
│   └── b
├── handlers
│   ├── c
│   └── d
├── modules
│   ├── e
│   └── f

But,if rename "modules" to "module",it will work fine:

module package
==============

Submodules
----------

module.e
---------------------------

.. automodule:: module.e
    :members:
    :undoc-members:
    :show-inheritance:

Expected results

Do it no matter module's name.

Reproducible project / your project

Make a directory named "modules",and using sphinx-apidoc command to parsing it.

Environment info

  • OS: Ubuntu18.04 LTS
  • Python version:3.6.5
  • Sphinx version:1.7.8
@ghost ghost changed the title If module named "modules",it will got wrong content If module named "modules",it will get wrong content Aug 29, 2018
@tk0miya tk0miya added this to the 1.8.0 milestone Aug 29, 2018
@tk0miya
Copy link
Member

tk0miya commented Sep 2, 2018

This is minimum reproducible steps:

$ ls
$ touch modules.py
$ sphinx-apidoc -o docs .
Creating file docs/modules.rst.
File docs/modules.rst already exists, skipping.

modules.rst is a default filename of index file which apidoc generates. So it is conflicted with target python module.

tk0miya added a commit to tk0miya/sphinx that referenced this issue Sep 2, 2018
tk0miya added a commit to tk0miya/sphinx that referenced this issue Sep 6, 2018
tk0miya added a commit that referenced this issue Sep 6, 2018
Fix #5362: apidoc: Add ``--toc`` option to change the filename of ToC
@tk0miya
Copy link
Member

tk0miya commented Sep 6, 2018

I just added --tocfile option for renaming modules.rst (see #5375).
Thank you for reporting!

@tk0miya tk0miya closed this as completed Sep 6, 2018
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Aug 11, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

1 participant