Click here to Skip to main content
15,885,890 members
Articles / Programming Languages / Visual Basic
Article

Natural Docs Wizard

Rate me:
Please Sign up or sign in to vote.
4.69/5 (12 votes)
30 Sep 20043 min read 42.1K   803   21   4
A small wizard application to create and edit Natural Docs batch files.

Sample Image - NaturalDocsWizard.jpg

Introduction

I just recently began programming in C++ (VB.NET is my is how I earn my wages) and have taken a stab at writing some small classes and programs. Being one who likes to share, I think it's a good idea to include some documentation with the programs that you share online, so people have some idea of what is going on in your code without having to pick it apart piece by piece.

I asked some folks in the programming community what the best documentation software was for C++, and of course, I got a lot of answers. But the two most popular packages were DoxyGen and Natural Docs. Both are excellent products, but I happened to like the style of Natural Doc's comment syntax, and so I chose to try that out first.

The Problem

Natural Docs makes commenting your code very easy and natural. But in order to run Natural Docs, you need to first create a batch file (unless you're a sucker for punishment) to run the program with all of its required paths and options. DoxyGen requires the same thing, but has a nice little wizard to do the dirty work for you. I know the author of Natural Docs is hard at work expanding the program's features, and probably hasn't had time to get around to doing this kind of stuff yet, so I just rolled my own.

The Solution

Natural Docs Wizard is a simple GUI to create, edit, and save Natural Docs batch files. It includes all the possible options as of Natural Docs v1.22, including the ability to have multiple input and output files and formats. It can read batch files written in either shorthand or longhand option notation (i.e., -i or --input or --source). You can specify your own *.css files as well - anything in the /Styles folder will be read by the program and offered up for your use. Tool tips have been used to death in the program in order to give you an idea of what options do what, in case you forgot. Overall, the program is very self explanatory, and will always show you a "live" copy of the batch file as you work. You can choose to run the batch file right from the wizard.

A Few Comments

I included both the executable and the source code downloads above. All you need is the executable, which should be run from your Natural Docs folder. If it is not run from the Natural Docs folder, the program will prompt you to input the location of the /Styles folder (although it remembers where that is, afterwards).

The wizard was pretty much thrown together in an evening, and as such, there are no comments in the source code. I apologize for that, however, this being a free tool, I'm not really attempting to teach anyone anything. Besides, the tool isn't rocket science. If I get a chance, I'll comment the code. Until then, just a few minutes of perusing the code should make its operation clear.

By supplying the source code, you should be able to update the wizard for any new versions that are released (if I don't). Be aware that the code is in VB.NET, so you need the .NET framework in order to run the program. Perhaps, some enterprising person will take the time to make a more platform independent version.

Oh, one more quick note - this is mentioned in the Natural Docs documentation, but I feel it bears repeating here - you should either add the Natural Docs folder to your PATH, or run the batch files from the Natural Docs folder. Otherwise, the NaturalDocs.bat file won't be found.

License

This article has no explicit license attached to it but may contain usage terms in the article text or the download files themselves. If in doubt please contact the author via the discussion board below.

A list of licenses authors might use can be found here


Written By
Systems Engineer Virtual RadioLogic
United States United States
Todd Davis has been working in web and application development for several years, using Silverlight, ASP.NET, VB.NET, C#, C++ and Javascript, as well as a great deal of work with SQL server and IIS.

He currently works for Virtual Radiologic in Eden Prairie, MN, however he is better known for his varied work in the open source community, especially the DotNetNuke project for which he provided several world-renowned training videos and modules. A huge advocate of open source and open knowledge sharing, everything on his website (www.SeaburyDesign.com) is always offered for free.

Whenever he is not actively coding at his laptop (a rarity to be sure), he can be found woodworking, walking with his wife and kids, or motoring along the back roads of MN on his Harley Davidson Fatboy.

Comments and Discussions

 
GeneralHelp - Natural Docs Pin
Preetib9-Feb-09 19:55
Preetib9-Feb-09 19:55 
Hi Todd

I found our exe very useful. However, I need some help in using Naturaldocs. Can you please help me with the same?

I followed the below steps to use natural docs:

1. I downloaded Natural Docs and Active Perl 5.10.
2. I edited the batch file stored in Natural Docs folder. This seems as below:

@echo off
set NaturalDocsParams= -i C:\VT100Automation\Nat\Input -o Framedhtml C:\VT100Automation\Nat\Output -p C:\VT100Automation\Nat\NaturalDocsproject
Rem Shift and loop so we can get more than nine parameters.
Rem This is especially important if we have spaces in file names.
:MORE
if "%1"=="" goto NOMORE
set NaturalDocsParams=%NaturalDocsParams% %1
shift
goto MORE
:NOMORE
c:\Perl\bin\perl.exe "C:\Program Files\NaturalDocs\NaturalDocs " %NaturalDocsParams%
set NaturalDocsParams=
On run this displays an error as: ‘Can’t open Perl script “C:\Program Files\NaturalDocs\NaturalDocs”: Permission denied

Can you please help me in this?

Another thing is how does perl help me in generating the index files. I am a bit confused here in interaction of Natural Docs with Perl and then with my vbs files.
Not really sure about the configurations to be done. Help of Natural Docs is a bit confusing.

Please guide me in this as I urjently need to finish my task..

Regards,

Preeti
Generalquestion on Natural DOcs Wizard Pin
conie_966915-Jan-09 21:00
conie_966915-Jan-09 21:00 
GeneralExcellent Pin
Toni Petrina30-Sep-04 8:31
Toni Petrina30-Sep-04 8:31 
GeneralRe: Excellent Pin
Todd Davis30-Sep-04 8:35
Todd Davis30-Sep-04 8:35 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.