【问题标题】:How to include a webix table into a sphinx html document?如何将 webix 表包含到 sphinx html 文档中?
【发布时间】:2016-06-02 12:03:02
【问题描述】:

我想将诸如 one 之类的 webix 表包含到 sphinx 文档中。

我找到了那个指令:

.. raw::
    :file: data.html

很遗憾,它不起作用,因为 head 应该包含在 <head> 中。此外,相关链接应根据 sphinx 生成的 html 进行更新。

<head>
    <title>"Find" API</title>
    <link rel="stylesheet" href="webix.css" type="text/css" charset="utf-8">
    <script src="webix.js" type="text/javascript" charset="utf-8"></script>

    <link rel="stylesheet" type="text/css" href="samples.css">
    <script src="testdata.js" type="text/javascript" charset="utf-8"></script>
</head> 

如何将 webix 小部件包含到静态 sphinx 页面中?

一种可能的解决方案是使用 jquery 完全包含 html:

<html> 
  <head> 
    <script src="jquery.js"></script> 
    <script> 
    $(function(){
      $("#includedContent").load("b.html"); 
    });
    </script> 
  </head> 

  <body> 
     <div id="includedContent"></div>
  </body> 
</html>

但这需要在页面的&lt;head&gt; 中添加内容

【问题讨论】:

    标签: html python-sphinx webix


    【解决方案1】:

    听起来您想做的是创建一个自定义 HTML 主题以在 Sphinx 中使用。这比听起来的工作要少,因为您可能只是从现有主题继承,并且只在新主题中覆盖其中的一小部分。请参阅 Sphinx 文档回复:templatingtheming

    另外,请参阅此答案,这可能会有所帮助: Adding a javascript script tag some place so that it works for every file in sphinx documentation

    【讨论】:

      猜你喜欢
      • 2014-07-30
      • 1970-01-01
      • 1970-01-01
      • 2013-09-28
      • 1970-01-01
      • 2023-03-25
      • 1970-01-01
      • 1970-01-01
      • 2010-12-05
      相关资源
      最近更新 更多