This project has moved and is read-only. For the latest updates, please go here.

For HtmlHelp1 it's /html and /media, but for HtmlHelp2 and WebSite it's /html and /html/media

Mar 25, 2011 at 6:51 PM

If you look at the structure of an SC-built CHM file, the HTML files are in /html and the images and other media are in /media.

If you look at the structure of an SC-built HxS file or the SC-built web site, the HTML files are in /html and the images and other media are in /html/media.

One of the MAML pages in my help file depends on the actual path to the media folder (see below*), so I can can make the page work for CHM or Hxs/Web, but not both.

My questions are:

  • Can you control the path to the media folder (and thus make it the same for all build types)?
  • Is it possible to conditionally include different files depending on the build type?

*I am embedding a PDF file inside my CHM file and linking to it from a topic. I include the file by adding the PDF to the project and specifying the Image BuildAction. The link is generated using this MAML:

    <markup> <a href="media/PCConfigGuide.pdf">PC Config Guide</a> <br/></markup>

Which generates this HTML
<a href="/media/PCConfigGuide.pdf" xmlns="">PC Config Guide</a>

Which works in the CHM, but not the HxS or website.




Mar 25, 2011 at 8:32 PM

I don't see it creating an html/media folder.  If you've got something with a build action of Content in your project that resides in an html/media folder off the root folder of the project, that would cause it to get copied to that location in the built help file.  For the PDF file, you can use an <externalLink> element rather than <markup> to embed an anchor tag.  It can point to local resources, not just those external to the help file.  See the Sandcastle MAML Guide for information on its options.  The Image build action is technically only for MAML image files used in mediaLink and mediaLinkInline elements.  If you put the PDF in a folder called .\Media at the root of the SHFB project and set it's build action to Content, it will get copied to the .\Media folder at the root of the built help file.