Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

What rules are applied to SHFB's IntelliSenseComponent's output folder?

Noda Time has an issue against it that the XML documentation file it ships contains all the internal and private members too - which is a shame.

Fortunately, Sandcastle Help File Builder has a custom build component - IntelliSenseComponent - which does exactly the right thing... in theory. Unfortunately, I can't work out how on earth to configure it properly.

The documentation gives this example:

 <output includeNamespaces="false" namespacesFile="Namespaces"
   folder="{@OutputFolder}" />

and states:

The example given above is taken from the Sandcastle Help File Builder's configuration file. When used with it, the replacement tags {@SHFBFolder} and {@OutputFolder} are used to insert the help file builder's folder and the project's output folder in the file paths. These are replaced at build time with the appropriate values. If using the component in your own build scripts, replace the tags with a relative or absolute path to the component assembly and output folder respectively.

Well, I am using SHFB, so I'd expect that to work. However, I can't get anything other than an absolute path to work. I've tried:

folder="."
folder="{@OutputFolder}"
folder="{@OutputFolder}XYZZY"
folder="{@OutputFolder}\XYZZY"
folder="{@OutputFolder}/XYZZY"
folder="{@OutputFolder}/XYZZY/"

(I'm just using XYZZY as something that's easy to search for.)

Looking at the source code, I'd hoped that I could use an environment variable, but this didn't work:

folder="%CD%\XYZZY"

although this did...

folder="%USERPROFILE%\XYZZY"

This works:

folder="c:\users\jon\test\xyzzy"

... but I really don't want an absolute path-name there.

The documentation suggests that all of this should be really easy... what am I missing?

Versions involved:

  • SHFB: 1.9.3.0
  • Sandcastle: 2.6.10621.1
like image 397
Jon Skeet Avatar asked Feb 15 '12 21:02

Jon Skeet


1 Answers

My experiments showed that SHFB's IntelliSenseComponent did treat {@OutputFolder} correctly, but there's a nuance.

If the folder attribute specified in

<output includeNamespaces="false" namespacesFile="Namespaces"         folder="..." /> 

points to a folder inside a project's OutputPath folder (.\docs\api in your case) then SHFB's build process creates the folder, but then deletes it before generating website contents:

Last step completed in 00:00:34.5875 ------------------------------- Combining conceptual and API intermediate TOC files...  Clearing any prior web output     Last step completed in 00:00:00.2360 ------------------------------- Extracting HTML info for HTML Help 1 and/or website... 

The problem is that the default value of the {@OutputFolder} is exactly the same as the value of $(OutputPath), therefore if you put something like {@OutputFolder}\foo in the folder attribute then you'll never see foo after build has finished.

The solution is simple: specify a folder that is located outside of your project's output folder, like this:

<output includeNamespaces="false" namespacesFile="Namespaces"         folder="{@OutputFolder}\..\distilledApi" /> <!--                            ^^       --> 

Hope this helps.

like image 56
Igor Korkhov Avatar answered Oct 05 '22 22:10

Igor Korkhov