【问题标题】:Grid table does not word-wrap网格表不自动换行
【发布时间】:2021-09-28 10:23:20
【问题描述】:

这是关于 Sphinx 和阅读文档的问题。我有如下所示的网格表。任何人都可以帮助我,因为它不自动换行吗?表格变得比屏幕宽度宽得多,并且有一个水平滚动条。我希望表格适合我的屏幕。

+-------------------------------------------------------------+-----------------------------------------------------+
| Credentials factory and extra properties                    | Explanation                                         |
+=============================================================+=====================================================+
| ``nl.nn.credentialprovider.PropertyFileCredentialFactory``  | Credentials from properties file.                   |
|   with ``credentialFactory.map.properties``                 |   ``credentialFactory.map.properties`` holds the    |
|                                                             |   name of the file with usernames and passwords.    |
|                                                             |   See above example for file contents.              |
+-------------------------------------------------------------+-----------------------------------------------------+
| ``nl.nn.credentialprovider.FileSystemCredentialFactory``    | Username and password in separate text files.       |
|   with ``credentialFactory.filesystem.usernamefile``,       |   The properties are names of files holding the     |
|   ``credentialFactory.filesystem.passwordfile`` and         |   username and the password. The paths in           |
|   ``credentialFactory.filesystem.root``. Default values     |   ``credentialFactory.filesystem.usernamefile``     |
|   ``username``, ``password`` and ``/etc/secrets``.          |   and ``credentialFactory.filesystem.passwordfile`` |
|                                                             |   are relative to the path in                       |
|                                                             |   ``credentialFactory.filesystem.root``.            |
+-------------------------------------------------------------+-----------------------------------------------------+
| ``nl.nn.credentialprovider.AnsibleVaultCredentialFactory``  | Credentials in Ansible vault. The extra             |
|   with ``credentialFactory.ansibleVault.vaultFile`` and     |   properties hold the vault file and the key file.  |
|   ``credentialFactory.keyFile``.                            |                                                     |
+-------------------------------------------------------------+-----------------------------------------------------+
| ``nl.nn.credentialprovider.WebSphereCredentialFactory``,    | Credentials configured in Websphere Application     |
|   no additional properties.                                 |   Server.                                           |
+-------------------------------------------------------------+-----------------------------------------------------+

在我写这篇文章的时候,你可以在https://frank-manual.readthedocs.io/en/credentials/deploying/credentials.html 看到渲染的表格。我打算至少在 2021 年 10 月 5 日星期二之前将其保持在线状态。包含nl.nn.credentialprovider.FileSystemCredentialFactory 的单元格似乎是罪魁祸首。

我有 Sphinx 4.0.0 版和 sphinx-rtd-theme 0.5.2 版

致以诚挚的问候,

马丁·德克塞

【问题讨论】:

    标签: read-the-docs


    【解决方案1】:

    您需要使用自定义样式覆盖默认样式表。

    来自Adding Custom CSS or JavaScript to Sphinx Documentation

    如果您的自定义样式表是 _static/css/custom.css,您可以使用 Sphinx 选项 html_css_files 将该 CSS 文件添加到文档中:

    conf.py

    # These folders are copied to the documentation's HTML output
    html_static_path = ['_static']
    
    # These paths are either relative to html_static_path
    # or fully qualified paths (eg. https://...)
    html_css_files = [
        'css/custom.css',
    ]
    

    css/custom.css

    .wy-table-responsive table td, .wy-table-responsive table th {
        white-space: inherit;
    }
    

    【讨论】:

    猜你喜欢
    • 2020-12-13
    • 1970-01-01
    • 2011-08-17
    • 1970-01-01
    • 1970-01-01
    • 2011-01-07
    • 1970-01-01
    • 1970-01-01
    • 2010-11-18
    相关资源
    最近更新 更多