Jelle Druyts .NET Consultant
Just another ignorant weirdo from Antwerp, Belgium trying to make sense out of it all
If you're not using NAnt or another NDoc-enabled build tool for your build cycle, you might find this little batch file useful:
@ECHO OFFREM Set the full path to the NDoc console executable.SET NDOC="C:\Program Files\NDoc 1.3\bin\net\1.1\NDocConsole.exe"REM Set the relative path to the output directory.SET OUTPATH=docREM Loop over the NDoc project files (*.ndoc).FOR %%P IN (*.ndoc) DO ( ECHO Generating documentation for "%%~nP"... ECHO. REM Run NDoc for the project file. %NDOC% -project=%%P REM Copy output files to the current directory. MOVE %OUTPATH%\*.chm . REM Delete output directory. RMDIR %OUTPATH% ECHO.)
This will just loop over all .ndoc files in the current path and build the documentation for it into a 'doc' directory. Then it will move the generated .chm Windows help file to the current directory and delete the output directory again so you only have the .chm file left and not the temporary files.
What I thought was pretty cool is that you can use batch files to loop over a fileset like *.ndoc using the "FOR %%P IN (*.NDOC) DO (...)" syntax. Inside the bracket scope, you have the %%P variable which will be expanded to the current file in the loop, and you can use %%~nP to get just the filename without the extension. There are a lot more of these substitution enhancements, just type "help for" in your favorite command shell.
For some more batch magic, see Raymond Chen's 90-byte solution to search for a file in your PATH. Nifty!