DOCSを追加する
All checks were successful
Python Test / python-test (push) Successful in 19s

This commit is contained in:
ry.yamafuji 2025-12-05 01:25:24 +09:00
parent b6e6546bd7
commit c38992d942
10 changed files with 186 additions and 1 deletions

20
docs/Makefile Normal file
View File

@ -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)

35
docs/conf.py Normal file
View File

@ -0,0 +1,35 @@
# 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 os
import sys
sys.path.insert(0, os.path.abspath('../src'))
project = 'プロジェクト名を設定してください'
copyright = '2025, 作成者名を設定してください'
author = '作成者名を設定してください'
release = '1.0.0'
# -- General configuration ---------------------------------------------------
# https://www.sphinx-doc.org/en/master/usage/configuration.html#general-configuration
extensions = [
'sphinx.ext.autodoc',
'sphinx.ext.napoleon', # GoogleスタイルやNumPyスタイルのdocstring対応
'sphinx.ext.viewcode', # ソースコードへのリンク
'sphinx_rtd_theme']
templates_path = ['_templates']
exclude_patterns = ['_build', 'Thumbs.db', '.DS_Store']
language = 'ja'
# -- Options for HTML output -------------------------------------------------
# https://www.sphinx-doc.org/en/master/usage/configuration.html#options-for-html-output
html_theme = 'sphinx_rtd_theme'
html_static_path = ['_static']

20
docs/index.rst Normal file
View File

@ -0,0 +1,20 @@
.. プロジェクト名を設定してください documentation master file, created by
sphinx-quickstart on Fri Dec 5 01:02:07 2025.
You can adapt this file completely to your liking, but it should at least
contain the root `toctree` directive.
プロジェクト名を設定してください documentation
==============================================
Add your content using ``reStructuredText`` syntax. See the
`reStructuredText <https://www.sphinx-doc.org/en/master/usage/restructuredtext/index.html>`_
documentation for details.
.. toctree::
:maxdepth: 2
:caption: Contents:
modules

7
docs/main.rst Normal file
View File

@ -0,0 +1,7 @@
main module
===========
.. automodule:: main
:members:
:show-inheritance:
:undoc-members:

35
docs/make.bat Normal file
View File

@ -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

9
docs/modules.rst Normal file
View File

@ -0,0 +1,9 @@
src
===
.. toctree::
:maxdepth: 4
main
utils

29
docs/utils.rst Normal file
View File

@ -0,0 +1,29 @@
utils package
=============
Submodules
----------
utils.custom\_logger module
---------------------------
.. automodule:: utils.custom_logger
:members:
:show-inheritance:
:undoc-members:
utils.singleton module
----------------------
.. automodule:: utils.singleton
:members:
:show-inheritance:
:undoc-members:
Module contents
---------------
.. automodule:: utils
:members:
:show-inheritance:
:undoc-members:

View File

@ -80,3 +80,28 @@ ruff check . --output-format json --output-file ruff-report.json
`--output-file``github`など様々な形式が指定できます `--output-file``github`など様々な形式が指定できます
コメントを生成する方法を検討が必要 コメントを生成する方法を検討が必要
## Doc
初期設定を行う
```sh
mkdir docs
cd docs
sphinx-quickstart
```
rstファイルを自動生成する
```sh
cd docs
sphinx-apidoc -o . ../src
```
Docsを自動生成する
```
cd docs
make html
```

View File

@ -4,3 +4,8 @@ pytest-cov
coverage-badge coverage-badge
# Linting tool # Linting tool
ruff==0.14.7 ruff==0.14.7
# Docs
sphinx
sphinx-rtd-theme
autodoc

0
src/utils/__init__.py Normal file
View File