removed namespace title (#8208)

This change compacts the left-side Navbar (ToC) of the [API
Reference](https://api.python.langchain.com/en/latest/api_reference.html).
Now almost each namespace item is split into two lines. For example
`langchain.chat_models: Chat Models`
We remove the `Chat Models` and leave one the `langchain.chat_models`. 
This effectively compacts the navbar and increases the main page's
usability. On my screen, it reduces # of lines in Toc from 28 t to 18,
which is huge.

Removing the namespace "title" (like `Chat Models`) does not remove any
information because the title is composed directly from the namespace.
API Reference users are developers. Usability for them is very
important. We see less text => we find faster.
This commit is contained in:
Leonid Ganeline 2023-07-26 16:45:23 -07:00 committed by GitHub
parent c5988c1d4b
commit ed24de8467
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -40,11 +40,7 @@ API Reference
functions = _members["functions"] functions = _members["functions"]
if not (classes or functions): if not (classes or functions):
continue continue
section = f":mod:`langchain.{module}`"
module_title = module.replace("_", " ").title()
if module_title == "Llms":
module_title = "LLMs"
section = f":mod:`langchain.{module}`: {module_title}"
full_doc += f"""\ full_doc += f"""\
{section} {section}
{'=' * (len(section) + 1)} {'=' * (len(section) + 1)}