Skip to content
This repository was archived by the owner on Feb 6, 2026. It is now read-only.
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions graphdoc/docs/.nojekyll
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@

27 changes: 27 additions & 0 deletions graphdoc/docs/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@
"sphinx.ext.autodoc",
"sphinx.ext.napoleon",
"sphinx.ext.viewcode",
"sphinx.ext.intersphinx", # Add intersphinx for better cross-referencing
]

# Add Napoleon settings for Google-style docstrings
Expand Down Expand Up @@ -53,3 +54,29 @@
import sys

sys.path.insert(0, os.path.abspath(".."))

# Configure autodoc settings to handle duplicate signatures
autodoc_default_options = {
"members": True,
"undoc-members": True,
"show-inheritance": True,
"member-order": "bysource",
}

# Configure intersphinx mapping for external projects
intersphinx_mapping = {
"python": ("https://docs.python.org/3", None),
}

# Ensure that objects are documented only once at their canonical location
canonical_module_mapping = {}


# Configure nitpicky mode to be less strict
nitpicky = False


def setup(app):
# Create static directory if it doesn't exist to avoid the warning
if not os.path.exists(os.path.join(os.path.dirname(__file__), "_static")):
os.makedirs(os.path.join(os.path.dirname(__file__), "_static"))
102 changes: 102 additions & 0 deletions graphdoc/docs/generate_docs.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,102 @@
#!/usr/bin/env python
"""
Script to automatically generate Sphinx documentation RST files.
Run this script before building the documentation to ensure all RST files are up-to-date.
"""
import os
import shutil
import subprocess
import sys


def main():
# Get the directory where this script is located
docs_dir = os.path.dirname(os.path.abspath(__file__))

# The path to the module we want to document
module_dir = os.path.abspath(os.path.join(docs_dir, ".."))

# Where to output the rst files
output_dir = docs_dir

# Clean up existing RST files except for special ones
preserve_files = ["index.rst", "conf.py", "generate_docs.py", "links.rst"]
for filename in os.listdir(output_dir):
filepath = os.path.join(output_dir, filename)
if (
filename.endswith(".rst")
and filename not in preserve_files
and os.path.isfile(filepath)
):
print(f"Removing {filepath}")
os.unlink(filepath)

# Run sphinx-apidoc
subprocess.run(
[
"sphinx-apidoc",
"-f", # Force overwriting of existing files
"-e", # Put module documentation before submodule documentation
"-M", # Put module documentation before member documentation
"-o",
output_dir, # Output directory
module_dir, # Module directory
"setup.py", # Exclude these files/patterns
"*tests*",
"*venv*",
"*docs*",
]
)

# Add custom content to the module RST files
customize_rst_files(output_dir)

print("\nRST files have been generated successfully!")
print("You can now build the documentation with: cd docs && make html")


def customize_rst_files(output_dir):
"""Add custom content to the RST files."""
# Example: Add a note about auto-generation to each RST file
for filename in os.listdir(output_dir):
if filename.endswith(".rst") and filename != "index.rst":
filepath = os.path.join(output_dir, filename)
with open(filepath, "r") as f:
content = f.read()

# Add noindex to submodules to prevent duplicates
content = content.replace(
":show-inheritance:", ":show-inheritance:\n :noindex:"
)

with open(filepath, "w") as f:
f.write(content)

# Create or update index.rst if it doesn't exist
index_path = os.path.join(output_dir, "index.rst")
if not os.path.exists(index_path):
with open(index_path, "w") as f:
f.write(
""".. GraphDoc documentation master file

Welcome to GraphDoc's documentation
==================================

.. toctree::
:maxdepth: 2
:caption: Contents:

modules

Indices and tables
==================

* :ref:`genindex`
* :ref:`modindex`
* :ref:`search`
"""
)


if __name__ == "__main__":
main()
8 changes: 8 additions & 0 deletions graphdoc/docs/graphdoc.config.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
graphdoc.config module
======================

.. automodule:: graphdoc.config
:members:
:undoc-members:
:show-inheritance:
:noindex:
8 changes: 8 additions & 0 deletions graphdoc/docs/graphdoc.data.dspy_data.dspy_data_helper.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
graphdoc.data.dspy\_data.dspy\_data\_helper module
==================================================

.. automodule:: graphdoc.data.dspy_data.dspy_data_helper
:members:
:undoc-members:
:show-inheritance:
:noindex:
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
graphdoc.data.dspy\_data.generation\_data\_helper module
========================================================

.. automodule:: graphdoc.data.dspy_data.generation_data_helper
:members:
:undoc-members:
:show-inheritance:
:noindex:
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
graphdoc.data.dspy\_data.quality\_data\_helper module
=====================================================

.. automodule:: graphdoc.data.dspy_data.quality_data_helper
:members:
:undoc-members:
:show-inheritance:
:noindex:
37 changes: 9 additions & 28 deletions graphdoc/docs/graphdoc.data.dspy_data.rst
Original file line number Diff line number Diff line change
@@ -1,37 +1,18 @@
graphdoc.data.dspy\_data package
================================

Submodules
----------

graphdoc.data.dspy\_data.dspy\_data\_helper module
--------------------------------------------------

.. automodule:: graphdoc.data.dspy_data.dspy_data_helper
:members:
:undoc-members:
:show-inheritance:

graphdoc.data.dspy\_data.generation\_data\_helper module
--------------------------------------------------------

.. automodule:: graphdoc.data.dspy_data.generation_data_helper
.. automodule:: graphdoc.data.dspy_data
:members:
:undoc-members:
:show-inheritance:
:noindex:

graphdoc.data.dspy\_data.quality\_data\_helper module
-----------------------------------------------------

.. automodule:: graphdoc.data.dspy_data.quality_data_helper
:members:
:undoc-members:
:show-inheritance:
Submodules
----------

Module contents
---------------
.. toctree::
:maxdepth: 4

.. automodule:: graphdoc.data.dspy_data
:members:
:undoc-members:
:show-inheritance:
graphdoc.data.dspy_data.dspy_data_helper
graphdoc.data.dspy_data.generation_data_helper
graphdoc.data.dspy_data.quality_data_helper
8 changes: 8 additions & 0 deletions graphdoc/docs/graphdoc.data.helper.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
graphdoc.data.helper module
===========================

.. automodule:: graphdoc.data.helper
:members:
:undoc-members:
:show-inheritance:
:noindex:
8 changes: 8 additions & 0 deletions graphdoc/docs/graphdoc.data.local.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
graphdoc.data.local module
==========================

.. automodule:: graphdoc.data.local
:members:
:undoc-members:
:show-inheritance:
:noindex:
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
graphdoc.data.mlflow\_data.mlflow\_data\_helper module
======================================================

.. automodule:: graphdoc.data.mlflow_data.mlflow_data_helper
:members:
:undoc-members:
:show-inheritance:
:noindex:
21 changes: 8 additions & 13 deletions graphdoc/docs/graphdoc.data.mlflow_data.rst
Original file line number Diff line number Diff line change
@@ -1,21 +1,16 @@
graphdoc.data.mlflow\_data package
==================================

Submodules
----------

graphdoc.data.mlflow\_data.mlflow\_data\_helper module
------------------------------------------------------

.. automodule:: graphdoc.data.mlflow_data.mlflow_data_helper
.. automodule:: graphdoc.data.mlflow_data
:members:
:undoc-members:
:show-inheritance:
:noindex:

Submodules
----------

Module contents
---------------
.. toctree::
:maxdepth: 4

.. automodule:: graphdoc.data.mlflow_data
:members:
:undoc-members:
:show-inheritance:
graphdoc.data.mlflow_data.mlflow_data_helper
8 changes: 8 additions & 0 deletions graphdoc/docs/graphdoc.data.parser.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
graphdoc.data.parser module
===========================

.. automodule:: graphdoc.data.parser
:members:
:undoc-members:
:show-inheritance:
:noindex:
50 changes: 12 additions & 38 deletions graphdoc/docs/graphdoc.data.rst
Original file line number Diff line number Diff line change
@@ -1,6 +1,12 @@
graphdoc.data package
=====================

.. automodule:: graphdoc.data
:members:
:undoc-members:
:show-inheritance:
:noindex:

Subpackages
-----------

Expand All @@ -13,42 +19,10 @@ Subpackages
Submodules
----------

graphdoc.data.helper module
---------------------------

.. automodule:: graphdoc.data.helper
:members:
:undoc-members:
:show-inheritance:

graphdoc.data.local module
--------------------------

.. automodule:: graphdoc.data.local
:members:
:undoc-members:
:show-inheritance:

graphdoc.data.parser module
---------------------------

.. automodule:: graphdoc.data.parser
:members:
:undoc-members:
:show-inheritance:

graphdoc.data.schema module
---------------------------

.. automodule:: graphdoc.data.schema
:members:
:undoc-members:
:show-inheritance:

Module contents
---------------
.. toctree::
:maxdepth: 4

.. automodule:: graphdoc.data
:members:
:undoc-members:
:show-inheritance:
graphdoc.data.helper
graphdoc.data.local
graphdoc.data.parser
graphdoc.data.schema
8 changes: 8 additions & 0 deletions graphdoc/docs/graphdoc.data.schema.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
graphdoc.data.schema module
===========================

.. automodule:: graphdoc.data.schema
:members:
:undoc-members:
:show-inheritance:
:noindex:
8 changes: 8 additions & 0 deletions graphdoc/docs/graphdoc.eval.doc_generator_eval.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
graphdoc.eval.doc\_generator\_eval module
=========================================

.. automodule:: graphdoc.eval.doc_generator_eval
:members:
:undoc-members:
:show-inheritance:
:noindex:
Loading