2012-11-23 3 views
4

Windows에서 Sphinx를 사용하고 있습니다.
대부분의 문서는 일반 사용자 용이지만 관리자 용 콘텐츠가 포함 된 하위 페이지가 있습니다. 그래서 내 설명서의 두 가지 버전, 전체 버전 및 "관리"페이지가 제외 된 두 번째 버전을 만들고 싶습니다.Sphinx의`exclude_patterns`를 명령 행에서 어떻게 설정합니까?

나는 exclude_patterns in the build configuration을 사용했습니다.
지금까지 작동합니다. 이름이 들어 나는 conf.py 파일에이 둘 때 "관리자"가 무시되고 모든 하위 폴더의 모든 파일 :

exclude_patterns = ['**/*admin*'] 

문제는 내가 두 버전을 모두 얻을 수있는 빌드를 번 를 실행하고 싶은 것입니다.

내가 지금하고있는 일은 make.bat을 두 번 실행하고 각 실행마다 다른 매개 변수를 제공합니다.
the documentation에 따르면 BUILDDIRSPHINXOPTS 변수를 설정하여이 작업을 수행 할 수 있습니다.

그래서 지금은이처럼 보이는 build.bat이 : 나는 스핑크스 생성 make.bat 파일에서 라인 set BUILDDIR=build을 삭제할 때 두 개의 다른 디렉토리에

path=%path%;c:\python27\scripts 

rem BUILD ADMIN DOCS 
set SPHINXOPTS= 
set BUILDDIR=c:\build\admin 
call make clean 
call make html 

rem BUILD USER DOCS 
set SPHINXOPTS=-D exclude_patterns=['**/*admin*'] 
set BUILDDIR=c:\build\user 
call make clean 
call make html 

pause 

빌드가 작동합니다.

그러나 제외 패턴은 이 아니며이 작동합니다.
위에 나열된 배치 파일이 두 번째 빌드합니다 (제외 패턴으로 하나)에 대한 출력 : 내가 잘못 뭐하는 거지

Making output directory... 
Running Sphinx v1.1.3 
loading translations [de]... done 
loading pickled environment... not yet created 

Exception occurred: 
    File "C:\Python27\lib\site-packages\sphinx-1.1.3-py2.7.egg\sphinx\environment. 
py", line 495, in find_files 
    ['**/' + d for d in config.exclude_dirnames] + 
TypeError: coercing to Unicode: need string or buffer, list found 
The full traceback has been saved in c:\users\myusername\appdata\local\temp\sphinx-err-kmihxk.log, if you want to report the issue to the developers. 
Please also report this if it was a user error, so that a better error message can be provided next time. 
Either send bugs to the mailing list at <http://groups.google.com/group/sphinx-dev/>, 
or report them in the tracker at <http://bitbucket.org/birkenfeld/sphinx/issues/>. Thanks! 

?
sphinx-build 명령 줄의 exclude_patterns에 대한 구문이 conf.py 파일과 다른가요?
한 단계에서 두 가지 버전을 빌드하는 더 좋은 방법이 있습니까?

답변

관련 문제