2017-03-27 1 views
11

나는 make html로 Sphinx 문서를 생성합니다. 모든 것은 괜찮습니다. 하지만 검색 기능을 사용할 때, 나는이 같은 추가 검색어와 링크를 얻을 :html 출력에서 ​​강조 표시를 비활성화하는 방법

http://url/search.html?q=searched&check_keywords=yes&area=default 
http://url/module.html?highlight=searched 

것은이 하이라이트입니다 (위 "검색") 항상있다. 비활성화하는 유일한 방법은 브라우저에서 URL을 수동으로 편집하는 것입니다.

하이라이트 부분이없는 문서로 연결되는 다른 방법이 있습니까?

Platform: windows 
Sphinx version: 1.1.3 

감사합니다, 로버트

답변

0

강조 표시된 텍스트가 <span class="highlighted">searched</span> 요소로 렌더링됩니다. (basic.css에서) 기본 CSS 규칙이 있습니다 :

/* Assume that the 'alabaster' theme is used */ 
@import url("alabaster.css"); 

/* No search term highlighting */ 
span.highlighted { 
    background-color: transparent; 

넣어 : 당신은 사용자 정의 CSS 파일에이 규칙을 재정의 할 수 있습니다

dt:target, span.highlighted { 
    background-color: #fbe54e; 
} 

이 컨텐츠 (의이 custom.css를 부르 자) 당신의 스핑크스 프로젝트의 _static 폴더에 custom.css 및 추가 또는 the following lines in conf.py을 수정은 "검색 결과"페이지에서 각 링크 된 페이지에 강조

html_static_path = ["_static"] 
html_style = "custom.css" 

위의 비활성화를.

스핑크스 1.6.5 (1.1.3은 상당히 오래된 버전)로 테스트되었습니다.

관련 문제