diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index ef6b2a56..d243bfb1 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -29,7 +29,7 @@ jobs: EMBEDDING_AZURE_API_VERSION: ${{ secrets.CHAT_AZURE_API_VERSION }} EMBEDDING_MODEL: ${{ secrets.EMBEDDING_MODEL }} name: lint test docs and build - run: make lint test docs build + run: make lint test docs build sphinx strategy: matrix: python-version: diff --git a/Makefile b/Makefile index 19ff05e0..a2dadb58 100644 --- a/Makefile +++ b/Makefile @@ -83,6 +83,11 @@ constraints: deepclean black: $(PIPRUN) python -m black --check . --extend-exclude test/scripts --extend-exclude git_ignore_folder -l 120 +sphinx: + cd docs + $(PIPRUN) sphinx-build -W --keep-going -b html . _build + cd .. + # Check lint with isort. isort: $(PIPRUN) python -m isort --check . -s git_ignore_folder -s test/scripts diff --git a/README.md b/README.md index 3775fc12..167cf00f 100644 --- a/README.md +++ b/README.md @@ -32,7 +32,7 @@ In this project, we are aiming to build a Data-Centric R\&D Agent that can + Further propose new ideas based on current knowledge and observations. -![Data-Centric R&D Overview](docs/images/overview.png) +![Data-Centric R&D Overview](docs/_static/overview.png) ### 🛣️ Brief Roadmap In this section, we will briefly introduce the roadmap/technical type of this project. diff --git a/docs/Makefile b/docs/Makefile new file mode 100644 index 00000000..ed880990 --- /dev/null +++ b/docs/Makefile @@ -0,0 +1,20 @@ +# Minimal makefile for Sphinx documentation +# + +# You can set these variables from the command line, and also +# from the environment for the first two. +SPHINXOPTS ?= +SPHINXBUILD ?= sphinx-build +SOURCEDIR = . +BUILDDIR = build + +# Put it first so that "make" without argument is like "make help". +help: + @$(SPHINXBUILD) -M help "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O) + +.PHONY: help Makefile + +# Catch-all target: route all unknown targets to Sphinx using the new +# "make mode" option. $(O) is meant as a shortcut for $(SPHINXOPTS). +%: Makefile + @$(SPHINXBUILD) -M $@ "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O) diff --git a/docs/images/overview.png b/docs/_static/overview.png similarity index 100% rename from docs/images/overview.png rename to docs/_static/overview.png diff --git a/docs/api_reference.rst b/docs/api_reference.rst new file mode 100644 index 00000000..b1758e0f --- /dev/null +++ b/docs/api_reference.rst @@ -0,0 +1,18 @@ +========================= +API reference +========================= + +title1 +========================= + +content1 + +title2 +========================= + +content2 + +title3 +========================= + +content3 \ No newline at end of file diff --git a/docs/conf.py b/docs/conf.py new file mode 100644 index 00000000..d66ca234 --- /dev/null +++ b/docs/conf.py @@ -0,0 +1,62 @@ +# Configuration file for the Sphinx documentation builder. +# +# For the full list of built-in configuration values, see the documentation: +# 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 importlib.metadata + +project = 'RDAgent' +copyright = '2024, Microsoft' +author = 'Microsoft' + +# -- General configuration --------------------------------------------------- +# https://www.sphinx-doc.org/en/master/usage/configuration.html#general-configuration + +extensions = [] + +autodoc_member_order = "bysource" + +# The suffix of source filenames. +source_suffix = '.rst' + +# The encoding of source files. +source_encoding = 'utf-8' + +# The main toctree document. +master_doc = 'index' + +# The version info for the project you're documenting, acts as replacement for +# |version| and |release|, also used in various other places throughout the +# built documents. +# +# The short X.Y version. +version = importlib.metadata.version("rdagent") +release = importlib.metadata.version("rdagent") + +# The language for content autogenerated by Sphinx. Refer to documentation for +# a list of supported languages. +language = "en" + +# List of patterns, relative to source directory, that match files and +# directories to ignore when looking for source files. +exclude_patterns = ['build'] + +# -- Options for HTML output ------------------------------------------------- +# https://www.sphinx-doc.org/en/master/usage/configuration.html#options-for-html-output +# The name of the Pygments (syntax highlighting) style to use. +pygments_style = 'sphinx' + +try: + import furo + + html_theme = 'furo' + html_theme_options = { + "navigation_with_keys": True, + } +except ImportError: + html_theme = 'default' + +html_static_path = ['_static'] diff --git a/docs/demo_and_introduction.rst b/docs/demo_and_introduction.rst new file mode 100644 index 00000000..8e8102a5 --- /dev/null +++ b/docs/demo_and_introduction.rst @@ -0,0 +1,18 @@ +========================= +Demo and Introduction +========================= + +title1 +========================= + +content1 + +title2 +========================= + +content2 + +title3 +========================= + +content3 \ No newline at end of file diff --git a/docs/development.rst b/docs/development.rst new file mode 100644 index 00000000..cba11b8b --- /dev/null +++ b/docs/development.rst @@ -0,0 +1,18 @@ +========================= +For Development +========================= + +title1 +========================= + +content1 + +title2 +========================= + +content2 + +title3 +========================= + +content3 \ No newline at end of file diff --git a/docs/index.rst b/docs/index.rst new file mode 100644 index 00000000..e313b96d --- /dev/null +++ b/docs/index.rst @@ -0,0 +1,27 @@ +.. RDAgent documentation master file, created by + sphinx-quickstart on Mon Jul 15 04:27:50 2024. + You can adapt this file completely to your liking, but it should at least + contain the root `toctree` directive. + +Welcome to RDAgent's documentation! +=================================== + +.. toctree:: + :maxdepth: 2 + :caption: Doctree: + + installation + development + api_reference + demo_and_introduction + project_framework_introduction + scenarios_and_quickstart + test_dropdown/test1 + + +Indices and tables +================== + +* :ref:`genindex` +* :ref:`modindex` +* :ref:`search` diff --git a/docs/installation.rst b/docs/installation.rst new file mode 100644 index 00000000..3b1b7327 --- /dev/null +++ b/docs/installation.rst @@ -0,0 +1,18 @@ +========================= +Installation +========================= + +title1 +========================= + +content1 + +title2 +========================= + +content2 + +title3 +========================= + +content3 \ No newline at end of file diff --git a/docs/make.bat b/docs/make.bat new file mode 100644 index 00000000..8f56bebd --- /dev/null +++ b/docs/make.bat @@ -0,0 +1,35 @@ +@ECHO OFF + +pushd %~dp0 + +REM Command file for Sphinx documentation + +if "%SPHINXBUILD%" == "" ( + set SPHINXBUILD=sphinx-build +) +set SOURCEDIR=. +set BUILDDIR=build + +%SPHINXBUILD% >NUL 2>NUL +if errorlevel 9009 ( + echo. + echo.The 'sphinx-build' command was not found. Make sure you have Sphinx + echo.installed, then set the SPHINXBUILD environment variable to point + echo.to the full path of the 'sphinx-build' executable. Alternatively you + echo.may add the Sphinx directory to PATH. + echo. + echo.If you don't have Sphinx installed, grab it from + echo.https://www.sphinx-doc.org/ + exit /b 1 +) + +if "%1" == "" goto help + +%SPHINXBUILD% -M %1 %SOURCEDIR% %BUILDDIR% %SPHINXOPTS% %O% +goto end + +:help +%SPHINXBUILD% -M help %SOURCEDIR% %BUILDDIR% %SPHINXOPTS% %O% + +:end +popd diff --git a/docs/project_framework_introduction.rst b/docs/project_framework_introduction.rst new file mode 100644 index 00000000..e665dffa --- /dev/null +++ b/docs/project_framework_introduction.rst @@ -0,0 +1,18 @@ +=============================== +Project framework introduction +=============================== + +title1 +========================= + +content1 + +title2 +========================= + +content2 + +title3 +========================= + +content3 \ No newline at end of file diff --git a/docs/requirements.txt b/docs/requirements.txt new file mode 100644 index 00000000..df024d65 --- /dev/null +++ b/docs/requirements.txt @@ -0,0 +1,4 @@ +sphinx +sphinx_rtd_theme +furo +importlib.metadata \ No newline at end of file diff --git a/docs/scenarios_and_quickstart.rst b/docs/scenarios_and_quickstart.rst new file mode 100644 index 00000000..3bb9c0aa --- /dev/null +++ b/docs/scenarios_and_quickstart.rst @@ -0,0 +1,18 @@ +========================= +Scenarios and Quick Start +========================= + +title1 +========================= + +content1 + +title2 +========================= + +content2 + +title3 +========================= + +content3 \ No newline at end of file diff --git a/docs/test_dropdown/test1.rst b/docs/test_dropdown/test1.rst new file mode 100644 index 00000000..6523ec90 --- /dev/null +++ b/docs/test_dropdown/test1.rst @@ -0,0 +1,28 @@ +========================= +Test dropdown 1 +========================= + +title1 +========================= + +content1 + +title2 +========================= + +content2 + +title3 +========================= + +content3 + + + + +.. toctree:: + :maxdepth: 1 + :caption: Doctree: + :hidden: + + test2 \ No newline at end of file diff --git a/docs/test_dropdown/test2.rst b/docs/test_dropdown/test2.rst new file mode 100644 index 00000000..9cc8f031 --- /dev/null +++ b/docs/test_dropdown/test2.rst @@ -0,0 +1,18 @@ +========================= +Test dropdown 2 +========================= + +title1 +========================= + +content1 + +title2 +========================= + +content2 + +title3 +========================= + +content3 \ No newline at end of file