问题描述
我看到很多这样的例子
════════ Exception caught by image resource service ════════════════════════════
The following assertion was thrown resolving an image codec:
Unable to load asset: car_android.png
When the exception was thrown,this was the stack
#0 PlatformAssetBundle.load (package:Flutter/src/services/asset_bundle.dart:224:7)
<asynchronous suspension>
#1 AssetBundleImageProvider._loadAsync (package:Flutter/src/painting/image_provider.dart:672:14)
<asynchronous suspension>
Image provider: Assetimage(bundle: null,name: "car_android.png")
Image key: AssetBundleImageKey(bundle: PlatformAssetBundle#243b1(),name: "car_android.png",scale: 1.0)
在 Sphinx 文档中,但我找不到它定义 :ref:`code <target to code>`
和 code
含义的位置。也许其中一个是隐式或显式目标,另一个是文件路径??
如果有人能给我提供如何交叉引用特定 .rst 文件中的标题的示例?
从 Adding a cross-reference to a subheading or anchor in another page 我知道如何使用 <target to code>
角色,但不知道如何对特定文件执行 :any
。
解决方法
来自 Cross-referencing syntax 的文档:
交叉引用由许多语义解释文本角色生成。基本上你只需要写
:role:`target`
并且将创建一个链接到名为 target 的项目,其类型由 role 指示。链接的文本将与 target 相同。
不过,还有一些额外的工具可以使交叉引用角色更加通用:
-
您可以提供明确的标题和参考目标,例如在 reST 直接超链接中:
:role:`title <target>`
将引用target,但链接文本将是title。
请注意,有时 title 也称为 label,具体取决于上下文。