github - 使用 GitHub wiki 中的引用和重构文本

标签 github wiki restructuredtext

我正在尝试使用内部引用将我的 wiki 页面顶部的索引与文档中的多个部分链接起来。这是一个例子:

 * `My index`_
    + Foreword_
    + `Technical details`_


 My index
 --------

 Foreword
 ~~~~~~~~

 Technical details
 ~~~~~~~~~~~~~~~~~

如果我通过rest2html 生成HTML 页面,我会得到正确的结果。然而,GitHub wiki 在引用文献中插入了额外的单词,并且链接不起作用。例如:

 https://github.com/myaccount/myproject/wiki/Page#wiki-my-index
 https://github.com/myaccount/myproject/wiki/Page#wiki-foreword
 https://github.com/myaccount/myproject/wiki/Page#wiki-technical-details

我在 GitHub 页面中找不到任何相关文档,所以我有点迷失了。

最佳答案

生成的 div 中似乎缺少类 ID。检查页面源以(不)看到它们。我认为它应该是这样的:

<ul>
  <li><dl class="first docutils">
    <dt><a class="reference internal" href="#my-index">My index</a></dt>
  <li><a class="reference internal" href="#foreword">Foreword</a></li>
  <li><a class="reference internal" href="#technical-details">Technical details</a></li>
</ul>

<div class="section" id="my-index">
  <h1>My index</h1>
</div>
<div class="section" id="foreword">
  <h2>Foreword</h2>
</div>
<div class="section" id="technical-details">
  <h2>Technical details</h2>
</div>

编辑:用户凭直觉在 a GitHub markup issue 中提到了同样的问题

I've noticed this problem with README.rst files as well. As well as headings, inline targets in .rst files, e.g. _some target, don't work. The inline target text gets wrapped in a but doesn't get made into any sort of link target. Should I file this as a separate issue?

关于github - 使用 GitHub wiki 中的引用和重构文本,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/9672049/

相关文章:

latex - 将 latex 转换为 rst/sphinx

python - Sphinx - 从父方法插入参数文档

git - 我更改了我的 github 用户名。如何更新本地存储库以指向新位置?

github - 使 github 中的 jira 链接可点击

c - Git 作为存储后端

sqlite - 有基于 SQLite 的 wiki 吗?

python - 如何使用 Python 以编程方式生成 Sphinx 文档的一部分?

javascript - 如何重新触发 GitHub 的语法荧光笔、Linguist?

Github 提交消息转义 "@"字符

svn - 最佳项目管理工具、源代码控制、构建器和 wiki