SPHINX 설치는 ReadTHEDOCS와 통합합니다.
SPHINX를 사용하여 ReadThedocs를 결합하고 REST 및 Markdown 형식을 지원하여 전문 PHP 프로젝트 문서를 쉽게 만들 수 있습니다. 권장 폴더 구조 : 프로젝트 조직을 최적화하려면 문서와 프로젝트 코드를 동일한 폴더에 배치하거나 프로젝트 크기를 기반으로 독립 코드 리포지토리를 작성하는 것이 좋습니다.
sphinx_rtd_theme
sphinxcontrib-phpdomain
권장 폴더 구조 :
프로세스에서는 기본 문서 파일 이름 (일반적으로 )을 지정해야합니다. 기본 문서는
PHP 구문 강조 표시 :
install PHP 구문 강조 표시를 활성화하려면 다음 코드를 파일에 추가합니다.
<strong>
</strong>
source/conf.py
확장 된 향상된 php 언어 지원 :
소스 코드보기 : sudo pip install sphinx sphinx-autobuild sphinx_rtd_theme sphinxcontrib-phpdomain
mkdir docs
cd docs
sphinx-quickstart
wget https://gist.githubusercontent.com/Swader/b16b18d50b8224f83d74/raw/b3c1d6912aefc390da905c8b2bb3660f513af713/requirements.txt
<p>에 다음 코드를 추가하여 문서에 GitHub 소스 코드 링크를 표시합니다.
<img src="/static/imghw/default1.png" data-src="https://img.php.cn/upload/article/000/000/000/173975942118201.jpg" class="lazy" alt="Using Sphinx for PHP Project Documentation " />
</p> <<> <p>
<strong> <<> 휴식과 마크 다운 : <🎜 🎜> <🎜 🎜>
Sphinx는 REST 및 Markdown을 지원합니다. 마크 다운을 지원하기 위해 <🎜 🎜> 확장자를 설치하고 <🎜 </strong> : <🎜 🎜>를 구성하십시오.
</p>
<p> <<> ReadTheCs 배포 : <🎜 🎜> <code>sphinxcontrib-phpdomain
sudo pip install sphinxcontrib-phpdomain
conf.py
<<> READTHEDOCS EXTENSION : <🎜 🎜> extensions = ["sphinxcontrib.phpdomain"]
파일을 만듭니다. <<> faqs : <🎜 🎜>
<<> (기사가 너무 길고 콘텐츠가 기존 콘텐츠에서 복제되거나 기본적이기 때문에 원본 문서의 FAQ 부분은 여기서 생략됩니다. 필요한 경우 FAQ 질문을 별도로 요청할 수 있습니다.) > conf.py
<🎜 🎜> <<> 요약 :
sed -i '/extensions = \[\]/ c\extensions = \["sphinxcontrib.phpdomain"\]' source/conf.py echo ' import sphinx_rtd_theme html_theme = "sphinx_rtd_theme" html_theme_path = [sphinx_rtd_theme.get_html_theme_path()] # 设置PHP语法高亮 from sphinx.highlighting import lexers from pygments.lexers.web import PhpLexer lexers["php"] = PhpLexer(startinline=True, linenos=1) lexers["php-annotations"] = PhpLexer(startinline=True, linenos=1) primary_domain = "php" ' >> source/conf.py
위 내용은 PHP 프로젝트 문서에 스핑크스 사용의 상세 내용입니다. 자세한 내용은 PHP 중국어 웹사이트의 기타 관련 기사를 참조하세요!