Commit de828313 authored by BO ZHANG's avatar BO ZHANG 🏀
Browse files

added sphinx doc

parent 2bb37aa0
Pipeline #44 passed with stages
in 8 seconds
# 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 = source
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)
rm -rf source/api/*
sphinx-apidoc -o source/api ../csst_proto --ext-viewcode --ext-githubpages
@ECHO OFF
pushd %~dp0
REM Command file for Sphinx documentation
if "%SPHINXBUILD%" == "" (
set SPHINXBUILD=sphinx-build
)
set SOURCEDIR=source
set BUILDDIR=build
if "%1" == "" goto help
%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
)
%SPHINXBUILD% -M %1 %SOURCEDIR% %BUILDDIR% %SPHINXOPTS% %O%
goto end
:help
%SPHINXBUILD% -M help %SOURCEDIR% %BUILDDIR% %SPHINXOPTS% %O%
:end
popd
make clean html
open ./build/html/index.html
\ No newline at end of file
csst\_proto package
===================
csst\_proto.flip\_image
-----------------------
.. automodule:: csst_proto.flip_image
:members:
:undoc-members:
:show-inheritance:
csst\_proto.some\_other\_modules
--------------------------------
.. automodule:: csst_proto.some_other_modules
:members:
:undoc-members:
:show-inheritance:
csst\_proto.top\_level\_interface
---------------------------------
.. automodule:: csst_proto.top_level_interface
:members:
:undoc-members:
:show-inheritance:
# Configuration file for the Sphinx documentation builder.
#
# This file only contains a selection of the most common options. For a full
# list see the documentation:
# https://www.sphinx-doc.org/en/master/usage/configuration.html
# -- Path setup --------------------------------------------------------------
# If extensions (or modules to document with autodoc) are in another directory,
# add these directories to sys.path here. If the directory is relative to the
# documentation root, use os.path.abspath to make it absolute, like shown here.
#
# import os
# import sys
# sys.path.insert(0, os.path.abspath('.'))
# -- Project information -----------------------------------------------------
project = 'csst_proto'
copyright = '2022, CSST Team'
author = 'CSST Team'
# The full version, including alpha/beta/rc tags
release = '0.0.1'
# -- General configuration ---------------------------------------------------
# Add any Sphinx extension module names here, as strings. They can be
# extensions coming with Sphinx (named 'sphinx.ext.*') or your custom
# ones.
extensions = ["recommonmark",
"sphinx.ext.autodoc",
"sphinx.ext.napoleon",
"sphinx.ext.viewcode",
"sphinx.ext.mathjax",
]
# Add any paths that contain templates here, relative to this directory.
templates_path = ['_templates']
# List of patterns, relative to source directory, that match files and
# directories to ignore when looking for source files.
# This pattern also affects html_static_path and html_extra_path.
exclude_patterns = []
# -- Options for HTML output -------------------------------------------------
# The theme to use for HTML and HTML Help pages. See the documentation for
# a list of builtin themes.
#
html_theme = 'sphinx_rtd_theme'
# Add any paths that contain custom static files (such as style sheets) here,
# relative to this directory. They are copied after the builtin static files,
# so a file named "default.css" will overwrite the builtin "default.css".
html_static_path = ['_static']
\ No newline at end of file
.. csst_proto documentation master file, created by
sphinx-quickstart on Tue Aug 23 20:39:04 2022.
You can adapt this file completely to your liking, but it should at least
contain the root `toctree` directive.
csst_proto
==========
.. meta::
:description lang=cn: Automate building, versioning, and hosting of your technical documentation continuously on Read the Docs.
.. image:: https://readthedocs.org/projects/csst/badge/?version=latest
:target: https://csst.readthedocs.io/en/latest/?badge=latest
:alt: Documentation Status
homepage
--------
`csst_proto` is the pipeline package for the **CSST** (Chinese Space Station Telescope).
GitLab:
https://csst-tb.bao.ac.cn/code/csst-l1/csst_proto
.. toctree::
:hidden:
:maxdepth: 2
:caption: unittest
unittest.rst
.. toctree::
:hidden:
:maxdepth: 2
:caption: code style
numpydoc.rst
sphinxdoc.rst
.. toctree::
:hidden:
:maxdepth: 2
:caption: API
api/csst_proto.rst
\ No newline at end of file
Numpydoc
========
Numpydoc style, conf https://numpydoc.readthedocs.io/en/latest/format.html
More specifically,
- PEP 7 – Style Guide for C Code: https://peps.python.org/pep-0007/
- PEP 8 – Style Guide for Python Code: https://peps.python.org/pep-0008/
sphinx-based documentation
==========================
sphinx homepage:
https://www.sphinx-doc.org/en/master/index.html
a tutorial on how to write restructured text (.rst) files:
https://docutils.sourceforge.io/rst.html
Unit test
=========
use
- `unittest` (https://docs.python.org/3.8/library/unittest.html)
- `pytest` (https://docs.pytest.org/en/stable/)
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment