sphinx 따라하기
pip install sphinx
로 설치하고 나서
sphinx-quickstart doc -m
이렇게 안하면 내 프로젝트 루트와 같은 위치에 생성됨.
cd ./doc
make html 명령어를 통해서 정적 html을 생성.
index.rst 파일을 기반으로 만들어지고 _build 디렉토리에 남게 된다.
/doc/conf.py 에서 경로 잡아주고, 확장모듈 다음과 같이 설치
extensions = [‘sphinx.ext.autodoc’, ‘sphinx.ext.napoleon’, ‘sphinx.ext.doctest’]
autodoc 을 이용하면
commons
================
.. automodule:: commons.conf
:members:
.. automodule:: commons.utils
:members:
.. automodule:: commons.cipher
:members:
이런식으로 모듈명을 입력해주고 :members: 라고 입력해주면 해당 모듈내 멤버에 docstring으로 문서화가 되어있는 함수나 클래스에 한해서
The post sphinx 따라하기 appeared first on LAB84.
Array