Click or drag to resize
Sandcastle Help File Builder

Replacing Stock Presentation Style Content

It is possible to replace the stock content files that are included in each help file (style sheets, scripts, icons, images, etc.). The stock content is copied from a presentation style sub-folders which can be found under the .\PresentationStyles folder of the root help file builder installation folder. Each presentation style has its own folder such as .\VS2010, .\VS2013, etc.

The folder structure for the content that gets added to each help file is the typically the same in each and consists of the following:

  • The icons\ folder contains stock help file images (i.e. for property icons, method icons, etc.).

  • The scripts\ folder contains stock JavaScript files.

  • The styles\ folder contains stock style sheets.

In addition, an html\ folder is created when the help file is built to contain the help pages generated from the documented assemblies and conceptual content. You can place additional HTML files to add to the project in a folder by the same name in your project or you can place them in the root of the project. Be sure to use an appropriate relative path on image references or links to other HTML pages based on the folder in which you place the content.

Modifying the Sandcastle copy of the presentation files directly will affect all help files that you build with the help file builder. For example, if you want to modify the style sheet for all projects you create with the help file builder, edit the branding.css files in the .\styles folders. The files do not need to be added to your project in that case. The downside to this approach is that you must maintain the changes with each new release of the help file builder. In such cases, it is better to create your own presentation style based on the existing one.

If you want to modify the files on a per project basis, that is when you would copy them to your project's folder. By adding the file to the project that resides in a like-named folder and has the same filename, you can replace the default file of the same name copied by the presentation style. In the example above, you would do the following:

  1. Right click on the project name in the Solution Explorer window and select the option to add a new folder. Call it styles to match the folder in the presentation style.

  2. Copy the style sheet files from the presentation file folder to the new project folder. For example, if using the VS2013 presentation style, copy the branding.css, branding-Help1.css, branding-HelpViewer.css, and branding-Website.css files from the %ProgramFiles(x86)\EWSoftware\Sandcastle Help File Builder\PresentationStyles\VS2013\styles folder.

  3. Modify the style sheet files as needed. As an example, open the branding.css file in the project and change the collapsibleRegionTitle style's font and add a color entry to make the text green:

    .collapsibleRegionTitle {
            font-family: Arial !important;
            font-style: normal !important;
            font-size: 3em;
            color: green;
            margin-top: 9px;
            margin-bottom: 19px;
            padding-top: 20px;
            padding-bottom: 5px;
            cursor: pointer;
    }
  4. Save the changes, build the help project, and then open the resulting help file. Note that the section headers are now larger and green.

  5. Most of the styles are contained in the branding.css file. The other files are format-specific overrides that change the styles slightly in the help format indicated by the filename suffix so that the topics look fairly consistent across all help formats. You can view the HTML for the rendered topics to determine the elements and/or class names that may need modifying in the style sheet.

Note Note

The presentation styles are all different and their files are not interchangeable. As such, if you change the presentation style, you must copy the matching files from the new presentation style and modify them with your changes.

See Also

Other Resources