2017-03-21 12 views
1

在使用Sphinx和RTD主題記錄python庫期間,我使用:download: Download Text <_download/the_file.pdf>角色鏈接了一些PDF文件以供下載,但由於某種原因導致鏈接如下所示:防止獅身人面像中的下載鏈接中的粗體文本閱讀文檔

下載文本

第一個字是正常的,但所有下面的話是黑體字。這只是相當煩人。有沒有辦法在下載鏈接文本中停止第二,第三等字詞的粗體字?

回答

0

回答我的問題在這裏...

我以前覆蓋的主題風格,所以我在這裏也做了同樣的事情。

我添加了一個名爲theme_overrides.css到_static文件夾中的獅身人面像根目錄與內容的CSS文件:

/* override the bold words in download links */ 
@media screen and (min-width:767px) { 

    .rst-content code.xref { 
    /* !important prevents the common CSS stylesheets from overriding 
     this as on RTD they are loaded after this stylesheet */ 
     font-weight: inherit !important; 
    } 
} 

令我擔心的是,這可能會刪除加粗的字體在其他地方唯一令使用.rst-content code.xref樣式。但到目前爲止我還沒有找到任何。

然後添加以下爲獅身人面像設置的conf.py文件:

html_context = { 
    'css_files': [ 
     '_static/theme_overrides.css', # override bold download text in RTD theme 
     ], 
    } 

感謝Rackspace的文檔指南上http://rackerlabs.github.io/docs-rackspace/tools/rtd-tables.html此解決方案。

相關問題