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

How to get rid of package and module names in toc? #315

Closed
FeryET opened this issue Dec 15, 2021 · 2 comments
Closed

How to get rid of package and module names in toc? #315

FeryET opened this issue Dec 15, 2021 · 2 comments

Comments

@FeryET
Copy link

FeryET commented Dec 15, 2021

Hello.

I have created a siderbar with autoapi that looks like this:

TOC:

API Reference
        |---- src
                |----- src.package_one
                        |------ src.package_one.module_a
                        |------ src.package_one.module_b
                |----- src.module_one

What I want to see is something line this:


API Reference
     |----- package_one
            |------ module_a
            |------ module_b
     |----- module_one

I want to get rid of:

  1. src in the TOC altogether.
  2. The package.module header formatting in TOC.

The directory is like this:

src
├── cli.py
├── config.py
└── utilities
    ├── argument_checks.py
    ├── __init__.py
    └── schema_checks.py

And the conf.py has these:

autoapi_type = 'python'
# because the conf path is repo/docs/source/conf.py while codes are in repo/src/
autoapi_dirs = ["../../src"] 

Moreover, I would like to also customize my headers, can I add any attribute to the python files to make the header names different from what apidoc generates?

For example, the module is named argument_checks and now it is generated as src.utilities.argument_checks, I want it to become Argument Checks. Is this possible?

Thanks!

@AWhetter
Copy link
Collaborator

Do you have autoapi_python_use_implicit_namespaces set? That should be the only way that you get this behaviour.

@AWhetter
Copy link
Collaborator

AWhetter commented Feb 9, 2022

Closing due to lack of feedback but a solution to #283 may also fix this.

@AWhetter AWhetter closed this as completed Feb 9, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants