在 reStructuredText 中插入相对链接

发布于 2024-09-17 11:47:41 字数 570 浏览 0 评论 0原文

我正在记录一个包含 Python 组件和 JavaScript 组件的库。整个用户文档和 Python API 文档位于 reStructuredText 中,并使用 Sphinx 进行处理。 JavaScript API 位于 jsdoc 中,并使用 jsdoc-toolkit 进行处理。主要输出格式为 HTML。我是 reST、Sphinx 和 jsdoc 的新手。

我已经设置了一个构建系统,因此所有生成的 html 页面都被转储到一个目录树中。我现在需要在主页(从 reST 生成)中插入指向生成的 Javascript 文档的链接。这需要是相对链接,因为文档可能位于不同安装的不同位置。 reST 会自动解析完整的 URL,但我不知道如何让它插入相对链接。类似于 :ref::doc: 似乎没有帮助,因为他们希望目标是休息的。

有什么想法吗?

I am documenting a library that has a Python component and a JavaScript component. The overall user documentation, and the Python API documentation are in reStructuredText, processed with Sphinx. The JavaScript API is in jsdoc and is processed with jsdoc-toolkit. The principal output format will be HTML. I am new to reST, Sphinx and jsdoc.

I have set up a build system so all the generated html pages are dumped into a single directory tree. I now need to insert into the main page (generated from reST) a link to the generated Javascript documentation. This needs to be a relative link, since the docs may be located in different places on different installations. reST will automatically parse a full URL, but I can't figure out how to make it insert a relative link. Constructs like :ref: and :doc: don't seem to help, because they expect the target to be reST.

Any ideas?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

洒一地阳光 2024-09-24 11:47:41

想通了。以下插入对文档 js/index.html 的相对引用:

`Javascript API <js/index.html>`_

Figured it out. The following inserts a relative reference to the document js/index.html:

`Javascript API <js/index.html>`_
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文