From 2b1f55ee373a6d49c36d0955ad1e505852f47f07 Mon Sep 17 00:00:00 2001 From: BO ZHANG Date: Sun, 9 Oct 2022 13:51:02 +0800 Subject: [PATCH] tweaks and added copy button --- doc/latexpdf.sh | 4 ++-- doc/source/conf.py | 8 +++++--- doc/source/csst_common/csst_common.rst | 12 ++++++++++++ setup.py | 2 +- 4 files changed, 20 insertions(+), 6 deletions(-) diff --git a/doc/latexpdf.sh b/doc/latexpdf.sh index 0e4a91d..479f1d5 100644 --- a/doc/latexpdf.sh +++ b/doc/latexpdf.sh @@ -1,5 +1,5 @@ make latexpdf LATEXMKOPTS="-silent" cd build/latex || exit -latexmk -pdf -dvi- -ps- -silent 'guidesforcsstdasdevelopers.tex' +latexmk -pdf -dvi- -ps- -silent 'aguideforcsstdasdevelopers.tex' cd ../.. -open ./build/latex/guidesforcsstdasdevelopers.pdf \ No newline at end of file +open ./build/latex/aguideforcsstdasdevelopers.pdf \ No newline at end of file diff --git a/doc/source/conf.py b/doc/source/conf.py index 0b547f6..1874cb9 100644 --- a/doc/source/conf.py +++ b/doc/source/conf.py @@ -10,9 +10,10 @@ # 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('.')) +import os +import sys +# . = /doc/source +sys.path.insert(0, os.path.abspath('./csst_common')) # -- Project information ----------------------------------------------------- @@ -31,6 +32,7 @@ release = '0.0.1alpha' # extensions coming with Sphinx (named 'sphinx.ext.*') or your custom # ones. extensions = ["recommonmark", + "sphinx_copybutton", "sphinx.ext.autodoc", "sphinx.ext.napoleon", "sphinx.ext.viewcode", diff --git a/doc/source/csst_common/csst_common.rst b/doc/source/csst_common/csst_common.rst index 5ea9b69..981e62f 100644 --- a/doc/source/csst_common/csst_common.rst +++ b/doc/source/csst_common/csst_common.rst @@ -106,6 +106,18 @@ We recommend our developers to use the code structure used in the example interf e.g., ``process_single_image`` and ``process_multiple_images``. The example code is shown below. +Source code +^^^^^^^^^^^ + .. literalinclude:: example_interface.py + :caption: ``example_interface.py`` + :emphasize-lines: 36-40,81-82,85-86,89-90,94-97,143-144,147,150-151,154-155 :linenos: :language: python + + +Rendered ``docstring`` +^^^^^^^^^^^^^^^^^^^^^^ + +.. automodule:: example_interface + :members: diff --git a/setup.py b/setup.py index 07e255f..f20748e 100644 --- a/setup.py +++ b/setup.py @@ -7,7 +7,7 @@ with open("README.md", "r") as fh: setuptools.setup( name='csst_proto', version=csst_proto.__version__, - author='CSST Team', + author='Bo Zhang', author_email='bozhang@nao.cas.cn', description='The CSST L1 pipeline - prototype', # short description long_description=long_description, -- GitLab