DZone
Thanks for visiting DZone today,
Edit Profile
  • Manage Email Subscriptions
  • How to Post to DZone
  • Article Submission Guidelines
Sign Out View Profile
  • Post an Article
  • Manage My Drafts
Over 2 million developers have joined DZone.
Log In / Join
Refcards Trend Reports Events Over 2 million developers have joined DZone. Join Today! Thanks for visiting DZone today,
Edit Profile Manage Email Subscriptions Moderation Admin Console How to Post to DZone Article Submission Guidelines
View Profile
Sign Out
Refcards
Trend Reports
Events
Zones
Culture and Methodologies Agile Career Development Methodologies Team Management
Data Engineering AI/ML Big Data Data Databases IoT
Software Design and Architecture Cloud Architecture Containers Integration Microservices Performance Security
Coding Frameworks Java JavaScript Languages Tools
Testing, Deployment, and Maintenance Deployment DevOps and CI/CD Maintenance Monitoring and Observability Testing, Tools, and Frameworks
Partner Zones AWS Cloud
by AWS Developer Relations
Culture and Methodologies
Agile Career Development Methodologies Team Management
Data Engineering
AI/ML Big Data Data Databases IoT
Software Design and Architecture
Cloud Architecture Containers Integration Microservices Performance Security
Coding
Frameworks Java JavaScript Languages Tools
Testing, Deployment, and Maintenance
Deployment DevOps and CI/CD Maintenance Monitoring and Observability Testing, Tools, and Frameworks
Partner Zones
AWS Cloud
by AWS Developer Relations

A Guide to Sandcastle - Part 2 - Customizing the build process [Build]

Denzel D. user avatar by
Denzel D.
·
Mar. 24, 11 · Interview
Like (0)
Save
Tweet
Share
6.62K Views

Join the DZone community and get the full member experience.

Join For Free

The default documentation build carries some basic options that might be enough for most cases. However, offers much more than it is offered by default. In today's article I am covering some of the major customization options that are available. Of course, covering each one of them wouldn't make any sense due to the simple fact that a lot of them are self-explanatory and have a pretty decent description on the bottom of the property page.

As I mentioned in the previous article, I am covering the building process in the context of the Sandcastle Help File Builder.

Launch SHFB once again and reference some simple .NET assemblies. These can be any assemblies you want - from DLLs to full-fledged applications. The more complex - the better, since you will have a better understanding of what each option I am talking about does.

BuildLogFile

I am going to start with BuildLogFile - not a lot of people fully appreciate the benefit of having a log. And before one goes looking for external help, looking at the log file is the first thing that should be done.

By default, the log file is stored in the Help folder - right where the actual documentation is compiled. You can, however, change the path to the log file. If you set the IsFixedPath property to True and set a path, it means that the path you are using is an absolute one. If IsFixedPath is set to False then the path to the log file is considered relative.

From my own experience I can say this - since I started using Sandcastle, the log file is the main helper in a lot of situations - of course you can view the build data directly in the Build Output tab, but when it comes to analyzing some additional data (e.g. warnings), a local resource is priceless, especially since it contains XML-formatted data - I can easily build a custom log viewer on top of the existing toolset for better tracking.

CleanIntermediates

While building the documentation tree, Sandcastle is creating a set of secondary files that are used to store Reflection data, documentation structure as well as un-compiled data files (e.g. separate HTML files not bound under a single CHM file).

This particular set of files is not extremely useful unless you want to look under the hood of the actual build process and see what data is used to build a documentation library based on the given assembly (or set of assemblies).

ComponentConfigurations

This is the extensibility point for SHFB that allows the developer (or the person who managed the process) to apply custom documentation formatters and general appearance of the generated help files. For example, via this layer it is possible to add custom images to a document (or a limited subset of those), change the way code is displayed in the context of a specific style and even generate additional files related to the assemblies loaded for analysis.

Build components are not a mandatory part of the build process and can be easily added or eliminated.

The default components are just the tip of the iceberg. You can create your own or download existing ones to improve the overall experience. Here are some resources worth checking:

  • Standalone Components and Tools v1.9.1.0
  • Drawbridge (diagram integration)

DisableCodeBlockComponent

Let's say that in your application you are using the <code> tag in the context of an example:

/// <example>
/// This is an example.
/// <code>
/// SampleCode code = new SampleCode();
/// code.ExecuteAction();
/// </code>
/// </example>

The Code Block Build Component allows the developer to customize the sample code box. For example, to colorize the content or include line numbers. The DisableCodeBlockComponent property was designed to allow a quick switch between modes for the component without the need to go to the build components configuration dialog. The plain result looks like this:

Make sure that the managed assembly passed as a documentation source has an associated XML documentation file for this option to work correctly.

HelpFileFormat

Here is where you can select the way you want the information to be displayed. Generally, there are 4 formats available:

HtmlHelp1 - The very basic (and the oldest) help format. A generated CHM (Compiled HTML) file will contain the tree structure of the namespaces included in the build. It is easy to use and it is quite portable. Also a great benefit related to it is that it can work on older version of Windows (even where the assembly itself might not work).

MSHelp2 - The updated help format used in Visual Studio versions 2002 to 2008. It is not as portable as one would want to due to some platform limitations. The Visual Studio 2008 SDK is required to compile in this format and if you only have Visual Studio 2010 installed, you might want to either skip this format or install the SDK separately.

MSHelpViewer1 - The format used in Visual Studio 2010 (and most likely for the next versions too). It integrates directly in the new Help Viewer application and is installed as a separate package. Can be managed only internally and is not really portable (as in click-and-view). However, to facilitate the addition and removal process, there are two pre-built scripts available for distribution (specifically targeting a help package).

Website - The universal platform-independent format that can be viewed in any JavaScript-enabled browser. Can be used to build a web-based MSDN-like library.

 

Build (game engine) Documentation

Opinions expressed by DZone contributors are their own.

Popular on DZone

  • Test Design Guidelines for Your CI/CD Pipeline
  • What’s New in Flutter 3.7?
  • How To Use Linux Containers
  • How To Set Up and Run Cypress Test Cases in CI/CD TeamCity

Comments

Partner Resources

X

ABOUT US

  • About DZone
  • Send feedback
  • Careers
  • Sitemap

ADVERTISE

  • Advertise with DZone

CONTRIBUTE ON DZONE

  • Article Submission Guidelines
  • Become a Contributor
  • Visit the Writers' Zone

LEGAL

  • Terms of Service
  • Privacy Policy

CONTACT US

  • 600 Park Offices Drive
  • Suite 300
  • Durham, NC 27709
  • support@dzone.com
  • +1 (919) 678-0300

Let's be friends: