对于WPF UI应用程序,需要创建CHM帮助文件。

如何创建chm帮助文件?

首先用ms word创建文档并将其转换为chm帮助文件?或其他任何方法?

请帮忙

谢谢

拉姆

最佳答案

我使用Sandcastle Help File Builder (SHFB)生成CHM。

要编写内容,我遵循了《沙堡MAML指南》 available on codeplex中的指导和示例。这涉及到我以一种称为“MAML”的格式编写文档,这是一种用于描述帮助文件的XML方言。

看起来像这样:

<?xml version="1.0" encoding="utf-8"?>
<topic id="4e9fd731-fc2f-4bdf-9ca2-3a8755411b2f" revisionNumber="1">
  <developerConceptualDocument
     xmlns       ="http://ddue.schemas.microsoft.com/authoring/2003/5"
     xmlns:xlink ="http://www.w3.org/1999/xlink">
    <!--
        <summary>
          <para>Optional summary abstract</para>
        </summary>
        -->
    <introduction>
      <!-- Uncomment this to generate an outline of the section and sub-section
           titles.  Specify a numeric value as the inner text to limit it to
           a specific number of sub-topics when creating the outline.  Specify
           zero (0) to limit it to top-level sections only.  -->
      <!-- <autoOutline /> -->
      <para>
      </para>
    </introduction>
    <!-- Add one or more top-level section elements.  These are collapsible.
         If using <autoOutline />, add an address attribute to identify it
         and specify a title so that it can be jumped to with a hyperlink. -->
    <section address="Section1">
      <title>Section Title</title>
      <content>
        <!-- Uncomment this to create a sub-section outline
             <autoOutline /> -->
        <para>
          Lorem ipsum dolor sit amet, consectetuer adipiscing
          elit. Integer vulputate, nibh non rhoncus euismod, erat odio
          pellentesque lacus, sit amet convallis mi augue et
          odio. Phasellus cursus urna facilisis quam. Suspendisse nec
          metus et sapien scelerisque

        </para>
        <para>
          Quisque pharetra lacus quis sapien. Duis id est
          <externalLink>
            <linkText>dictum sed, sapien</linkText>
            <linkAlternateText>alt text</linkAlternateText>
            <linkUri>http://stackoverflow.com/questions/tagged/chm</linkUri>
          </externalLink>
        </para>
      </content>
    </section>
    <relatedTopics/>
  </developerConceptualDocument>
</topic>

除了在各个页面上创作内容之外,您还需要指定大纲-所有页面如何组合在一起。设置好之后,就很容易了。然后,生成CHM只需运行SHFB。

不要被标记名“developerConceptualContent”推迟。生成的.chm没有任何内容使它仅对开发人员有用。

SHFB工具是免费的。

关于chm - 如何为WPF应用程序创建chm帮助文件?,我们在Stack Overflow上找到一个类似的问题:https://stackoverflow.com/questions/1417045/

10-10 03:11