Presentation is loading. Please wait.

Presentation is loading. Please wait.

CS282.  Doxygen is a documentation generator for ◦ C++, C, C#, Java, Objective-C, Python, PHP, …  Doxygen will document your code according to the “tags”

Similar presentations


Presentation on theme: "CS282.  Doxygen is a documentation generator for ◦ C++, C, C#, Java, Objective-C, Python, PHP, …  Doxygen will document your code according to the “tags”"— Presentation transcript:

1 CS282

2  Doxygen is a documentation generator for ◦ C++, C, C#, Java, Objective-C, Python, PHP, …  Doxygen will document your code according to the “tags” you specify  It can also document things that you haven’t really documented yet!

3  You specify options in a configuration file ◦ This file is generated by running doxygen, and is fairly well commented.  Then, inside your source code, you specify “tags” (keywords) which tells Doxygen what kind of documentation you are doing  Finally, you run doxygen, and your html files are automatically generated!

4  Creating a Doxygen configuration file ◦ Editing options in a Doxygen configuration file  Uploading files to your CSE account  Understanding the structure of Doxygen  Documenting your very own class using ◦ Accessing your documentation online ◦ Utilizing common and important tags

5

6

7  Doxygen is already installed on the CSE servers, so we do not have to worry about it ◦ If you want to install on your home computers, there are instructions online (aptitude-get, port, etc.)  First of all, let’s download this week’s framework (available on the class site) ◦ It is basically last week’s completed version, with an additional class.

8  Since the ECC does not have Doxygen, we will need to work on the CSE servers.  Log onto your CSE account ◦ cd ~/public_html ◦ Create a directory called “CS282_Doxygen”  This time we have provided you a configuration file inside the framework called “doxyfile” ◦ This configuration file allows you to specify options and tell Doxygen how you want it to format things

9  Let’s move our framework over to the CSE server ◦ On the ECC side(all one line):  scp –r YourLabFolder username@cse.unr.edu:/cs/username/public_html/CS282_Doxygen /Lab_4  Now on the CSE side… ◦ Go into ~/CS282_Doxygen/Lab_4 ◦ run the command “doxygen doxyfile” ◦ This creates a folder called “doxygen” inside ◦ In order to give Doxygen access to all the packages it needs, you may need to log into YourUserName@banyan.cse.unr.edu in order to run the above commandYourUserName@banyan.cse.unr.edu  Congratulations! You’ve created the base directory for your first Doxygen project

10

11  Open up a web browser ◦ Navigate to your Doxygen documentation ◦ http://www.cse.unr.edu/~YourUserNameHere/ CS282_Doxygen/Lab_4/doxygen/html/ http://www.cse.unr.edu/~YourUserNameHere/ CS282_Doxygen/Lab_4/doxygen/html/  Take a look around ◦ In particular, navigate to the clock class and examine it. (under the classes tab) ◦ Also, look at rigid_body.h (under files tab)  Notice the dependency graph  Notice the difference in its documentation compared to the other classes.

12  Finally, let’s take a look at a major project that uses Doxygen documentation  Navigate to ◦ http://www.openscenegraph.org/documentation/O penSceneGraphReferenceDocs/a00026.html http://www.openscenegraph.org/documentation/O penSceneGraphReferenceDocs/a00026.html  Your project will be using Doxygen documentation. Although it will probably have not nearly as many things as OSG does.

13  At the beginning of every file, you must have a comment code block like so…  @file, @brief, @author, and @date are all tags

14  Tags allow your way of telling Doxygen how you want it to document your text ◦ @file specifies that name of your file ◦ @brief specifies a brief description of your file ◦ @author specifies the author of the file ◦ @date specifies the date of the file ◦ @return specifies what the function is returning ◦ @param specifies the parameters of a function  can be chained (i.e. line after line) for multiple param.  There are many others, but these are most of the ones we will focus on for today.

15  For each function, you should have…

16  Document the rigid_body class(On the ECC computer) ◦ (ignore the vector class for now)  First, delete the source code in the CSE server ◦ rm –rf ~/public_html/CS282_Doxygen/Lab_4  Please document the following using the tags specified below (at the very least) ◦ Beginning of the file (.cpp only)  @file, @author, @brief ◦ Beginning of each function  Description, @brief, @param, @return

17  When you are finished documenting, copy your source over to the CSE server. (Again, all one line) ◦ scp –r YourLabFolder username@cse.unr.edu:/cs/username/public_html/CS28 2_Doxygen/Lab_4  Run doxygen on this folder inside CSE ◦ doxygen doxyfile (assuming you’re in your source)  Call me over when you’re done and it is on your website, or if you need help with anything.

18  Unfortunately, because the ECC does not have Doxygen (yet), we have to do this copying between our local and remote hosts.  If you have doxygen installed on your local host, you would only have to run doxygen on the local host and then copy your html folder into your web server’s public_html  And thus avoid moving your source code over as well.

19  Let’s examine inline documentation now ◦ Example:  int example_number; ///< An integer number ◦ Or,  /* This is also an inline example */ ◦ When using inline doc, be careful its placement ◦ There are many other ways to document inline – if you are interested, Google awaits!  Now let’s document rigid_body.h using inline documentation.

20  Once you are finished document rigid_body.h ◦ Take a look at sphere.h  You will notice it inherits from rigid_body ◦ This relationship is detected by Doxygen ◦ It is visually represented (if the flag is set in the configuration file) as a graph of dependencies  Copy your code over to the CSE server and run Doxygen (like in the last 2 exercises, don’t forget to delete), and show me the final result

21  1) Create a doxygen configuration file ◦ Go to your source code directory, and type in  doxygen –g doxyfile  2) Edit the configuration file options ◦ Heavily commented, so you can look through it at your own discretion. Common tags to edit are:  EXTRACT_ALL = YES (around line 301)  INLINE_SOURCE = YES (around line 705)  HAVE_DOT = YES (around line 1463)  CALL_GRAPH = YES (around line 1546)  GENERATE_LATEX = NO (around line ?)

22  3) Document your code with Doxygen tags  4) Run the command “doxygen doxyfile” ◦ This will create a folder called “html” in your source directory (or wherever you put your config file)  5) Copy this doxygen folder into your CSE account’s (or your webserver if you have one) “public_html/CS282_Doxygen/[project_name]” folder  6) Access your documentation online ◦ http://www.cse.unr.edu/~YourUserNameHere/ CS282_Doxygen/YourProjectNameHere/doxygen/html/ http://www.cse.unr.edu/~YourUserNameHere/ CS282_Doxygen/YourProjectNameHere/doxygen/html/


Download ppt "CS282.  Doxygen is a documentation generator for ◦ C++, C, C#, Java, Objective-C, Python, PHP, …  Doxygen will document your code according to the “tags”"

Similar presentations


Ads by Google