객체 문서화 및 상호 참조 (C, C++, others)
Sphinx는 다른 프로그래밍 언어로 작성된 문서화 및 상호 참조 개체도 지원한다. C, C++, JavaScript 및 reStructuredText의 4가지 추가 기본 제공 도메인이 있다. 타사 확장은 다음과 같은 더 많은 언어에 대한 도메인을 정의할 수 있다.
예를 들어, C++ 유형 정의를 문서화하려면 cpp:type 다음과 같이 내장 지시문을 사용한다.
.. cpp:type:: std::vector<int> CustomList
A typedef-like declaration of a type.
다음과 같은 결과가 나타난다.
# typedef 형식과 같은 선언
typedef std :: 벡터 < int > CustomList
그런 다음 모든 지시문은 해당 역할을 사용하여 상호 참조할 수 있는 참조를 생성한다. cpp:type 예를 들어, 이전 유형 정의를 참조하기 위해 다음과 같이 역할을 사용할 수 있다.
Cross reference to :cpp:type:`CustomList`.
이는 이전 정의에 대한 하이퍼링크를 생성한다 (CustomList).
https://www.sphinx-doc.org/en/master/tutorial/describing-code.html#other-languages-c-c-others
Describing code in Sphinx — Sphinx documentation
Describing code in Sphinx In the previous sections of the tutorial you can read how to write narrative or prose documentation in Sphinx. In this section you will describe code objects instead. Sphinx supports documenting code objects in several languages,
www.sphinx-doc.org
'Python Library' 카테고리의 다른 글
[Sphinx] 코드에서 자동 문서 생성 (2) (0) | 2022.05.02 |
---|---|
[Sphinx] 코드에서 자동 문서 생성 (1) (0) | 2022.05.02 |
[Sphinx] Describing code in Sphinx (Python) (1) (0) | 2022.05.02 |
[Sphinx] Narrative documentation in Sphinx (2) (0) | 2022.05.02 |
[Sphinx] Narrative documentation in Sphinx (1) (0) | 2022.05.02 |