[英]Putting comments in XML that is present in my C# XML comment blocks
我在XML注釋中使用代碼示例塊作為一種簡單的方法,讓用戶了解XML的外觀。 這是一個非常粗略的解決方案,最終將為用戶提供xml字符串的XML Schema。 但是,現在我將在我的基於doxygen的文檔中提供這些信息。
例如,我有這樣的事情:
/// <example>
/// <code>
/// <!-- xml will go below this comment, but I can't display the comment! -->
/// </code>
/// </example>
當我查看我的文檔時,任何有注釋的行都會顯示為空白行。
我試過逃避<
和>
,並嘗試使用<CDATA[<!-- comment -->]]>
,但沒有成功。 轉義序列按原樣顯示, CDATA
按原樣顯示,但不顯示字符數據。
我在這里想念的是什么? :)
編輯 - 我需要澄清這不是Intellisense呈現信息的問題。 我希望在Doxygen渲染到CHM時(通過HTML Help Workshop)正確顯示XML注釋。
當你嘗試使用<
轉義時 和>
,你使用這種語法嗎?
/// <example>
/// <code>
/// <!-- xml will go below this comment, but I can't display the comment! -->
/// </code>
/// </example>
它適用於IntelliSense,我認為沒有任何理由不應該在其他地方工作。
編輯 :你能試試下面的版本嗎?
/// <example>
/// <pre lang='xml'>
/// <!-- xml will go below this comment, but I can't display the comment! -->
/// </pre>
/// </example>
我不確定你的XML源出現在哪里,是在函數或類的文檔中? 如果是這樣,請嘗試將XML包裝在verbatim
和\\endverbatim
標記中。 對於以下示例
/** A test class with some XML in the documentation.
\verbatim
<example>
<code>
<!-- xml will go below this comment, but I can't display the comment! -->
</code>
</example>
\endverbatim
*/
class Test
...
我得到了doxygen輸出:
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.