Skip to content

Commit

Permalink
docs: improved docs config, fixed warnings, build in strict mode in C…
Browse files Browse the repository at this point in the history
…I (no warning allowed)
  • Loading branch information
ErikBjare committed Sep 26, 2024
1 parent a106d5c commit ae45141
Show file tree
Hide file tree
Showing 11 changed files with 47 additions and 18 deletions.
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ docs/.clean: docs/conf.py
touch docs/.clean

docs: docs/conf.py docs/*.rst docs/.clean
poetry run make -C docs html
poetry run make -C docs html SPHINXOPTS="-W --keep-going"

.PHONY: site
site: site/dist/index.html site/dist/docs
Expand Down
8 changes: 8 additions & 0 deletions docs/_static/custom.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
/* Make attributes less spacy */
dl.py.attribute {
margin-bottom: 1rem;
}

dl.py.attribute + dl.py.method {
margin-top: 3rem;
}
2 changes: 1 addition & 1 deletion docs/arewetiny.rst
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ Lines of code
-------------

LoC Core
*******
********

.. command-output:: make -C .. cloc-core

Expand Down
27 changes: 22 additions & 5 deletions docs/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@
# https://www.sphinx-doc.org/en/master/usage/configuration.html
# -- Project information -----------------------------------------------------
# https://www.sphinx-doc.org/en/master/usage/configuration.html#project-information

import re

from docutils import nodes
Expand Down Expand Up @@ -83,6 +82,7 @@ def setup(app):

extensions = [
"myst_parser",
"sphinx.ext.napoleon",
"sphinx.ext.autodoc",
"sphinx.ext.extlinks",
"sphinx.ext.autosectionlabel",
Expand All @@ -98,12 +98,29 @@ def setup(app):
"issue": ("https://github.com/ErikBjare/gptme/issues/%s", "issue #"),
}

# Prefix each section label with the name of the document it is in, followed by a colon.
# For example, index:Introduction for a section called Introduction that appears in document index.rst.
# Useful for avoiding ambiguity when the same section heading appears in different documents.
autosectionlabel_prefix_document = True

autodoc_typehints_format = "short"
autodoc_class_signature = "separated"
napoleon_attr_annotations = False

nitpicky = True
nitpick_ignore = [
("py:class", "collections.abc.Generator"),
("py:class", "pathlib.Path"),
("py:class", "flask.app.Flask"),
("py:class", "gptme.tools.python.T"),
]

# -- Options for HTML output -------------------------------------------------
# https://www.sphinx-doc.org/en/master/usage/configuration.html#options-for-html-output

html_theme = "sphinx_book_theme"
html_static_path = ["_static"]
html_css_files = ["custom.css"]

html_title = "gptme"
html_logo = "../media/logo.png"
Expand All @@ -114,10 +131,10 @@ def setup(app):
"path_to_docs": "docs",
"use_repository_button": True,
"use_edit_page_button": True,
"extra_navbar": """
<p>
Back to <a href="https://github.com/ErikBjare/gptme">GitHub</a>
</p>""",
# "extra_navbar": """
# <p>
# Back to <a href="https://github.com/ErikBjare/gptme">GitHub</a>
# </p>""",
}

show_navbar_depth = 2
2 changes: 1 addition & 1 deletion docs/examples.rst
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ Examples

A list of things you can do with gptme.

To see example output without running the commands yourself, check out the :ref:`demos`.
To see example output without running the commands yourself, check out the :doc:`demos`.


.. code-block:: bash
Expand Down
2 changes: 1 addition & 1 deletion docs/getting-started.rst
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ We can also start chats and request changes directly from the command line. The
Other tools
***********

You can read about other tools in the :ref:`Tools` section.
You can read about other tools on the :doc:`tools` page.

Other interfaces
****************
Expand Down
4 changes: 2 additions & 2 deletions docs/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,9 @@ Welcome to the documentation for ``gptme``!

``gptme`` is a tiny command-line application that allows you to interact with AI agent equipped with powerful local tools, acting as a copilot for your computer, via the terminal. It can execute python and bash, edit local files, search and browse the web.

To get an understanding about how it works, the easiest way is to try it out yourself by following the :ref:`Getting Started` guide. If you want to see some examples of what you can do with it, check out the :ref:`Examples`, :ref:`Demos`, and :ref:`Tools`.
To get an understanding about how it works, the easiest way is to try it out yourself by following the :doc:`getting-started` guide. If you want to see some examples of what you can do with it, check out the :doc:`examples`, :doc:`demos`, and :doc:`tools`.

It is designed to be easy to use and extend, and can be used as a library or a standalone application. It also has a tiny :ref:`Web UI` with basic functionality.
It is designed to be easy to use and extend, and can be used as a library or a standalone application. It also has a tiny :ref:`server:Web UI` with basic functionality.

See the `README <https://github.com/ErikBjare/gptme/blob/master/README.md>`_ file for more general information about the project.

Expand Down
File renamed without changes.
3 changes: 3 additions & 0 deletions docs/server.rst
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,9 @@ It can be started by running the following command:
gptme-server
Web UI
------

You can then access the web UI by visiting http://localhost:5000 in your browser.

For more usage, see `the CLI documentation <cli.html#gptme-server>`_.
14 changes: 7 additions & 7 deletions docs/tools.rst
Original file line number Diff line number Diff line change
Expand Up @@ -7,22 +7,22 @@ The main tools can be grouped in the following categories:

- execution

- :ref:`Shell`
- :ref:`Python`
- :ref:`Tmux`
- `Shell`_
- `Python`_
- `Tmux`_

- filesystem

- :ref:`Save`
- :ref:`Patch`
- `Save`_
- `Patch`_

- network

- :ref:`Browser`
- `Browser`_

- chat management

- :ref:`Chats`
- `Chats`_

Shell
-----
Expand Down
1 change: 1 addition & 0 deletions gptme/tools/chats.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
if TYPE_CHECKING:
from ..logmanager import LogManager


logger = logging.getLogger(__name__)


Expand Down

0 comments on commit ae45141

Please sign in to comment.