【问题标题】:Why are my code blocks not rendering in the Sandcastle Help File?为什么我的代码块没有在 Sandcastle 帮助文件中呈现?
【发布时间】:2013-03-19 19:44:29
【问题描述】:

我正在使用 Codeplex 与 VS.NET 2012 集成的当前版本的 Sandcastle 来构建 .cmh 帮助文件。正在创建帮助文件,但我似乎无法在帮助文件中发出任何 <code> 块。我一直在使用以下简单示例:

/// <summary>
/// This is the summary 
/// </summary>
/// <code>var s;</code>
public string SomeValue { get; set; }

当我查看输出 .chm 文件时,var s; 代码不存在任何地方。我做了以下事情:

该示例显然是一个简化版本,但我只是想在这里完成基础工作。我做错了什么或遗漏了什么?

【问题讨论】:

  • 我不认为code标签可以单独使用,试着把它放在&lt;example&gt;标签里面,比如&lt;example&gt;&lt;code&gt;var s;&lt;/code&gt;&lt;/example&gt;
  • @vcsjones - 不错的电话,我发誓我之前尝试过,但我必须有一些解释。我建议将您的建议作为答案提供一个完整的示例,以便我标记它。有趣的是,“驯服沙堡”的文章并没有这样显示。

标签: c# sandcastle


【解决方案1】:

我认为代码标签不允许单独存在,请尝试将其放在&lt;example&gt; 标签中,例如&lt;example&gt;&lt;code&gt;var s;&lt;/code&gt;&lt;/example&gt;。所以这应该有效:

/// <summary>
/// This is the summary 
/// </summary>
/// <example>
/// <code>var s;</code>
/// </example>
public string SomeValue { get; set; }

【讨论】:

  • 这解决了我遇到的问题,现在在 Examples 部分中已经存在的 Syntax 部分中发出代码。非常感谢。
猜你喜欢
  • 1970-01-01
  • 2014-10-28
  • 1970-01-01
  • 2023-04-07
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
相关资源
最近更新 更多