-2

Like when you document a function in source file it is hard to put all this documentation inside the code files, what i need is to have clean source code file with documentation references in another documentation tool that compiles and presents both source code and documentation neatly. is that possible and how?

marc_s
  • 732,580
  • 175
  • 1,330
  • 1,459

1 Answers1

2

I'll assume you are using a Unix-based system and are wanting to document C source code.

Use doxygen (http://www.doxygen.nl/index.html).

I'm not sure why you don't want documentation inside your source files, but doxygen allows you to separate the documentation for the interface (.h) and implementation (.c) files for your project cleanly. It uses C-style comments to generate the documentation. It doesn't require too much comment clutter, so they can be used standalone in the source code (that is, without the generated documentation).

After installing doxygen, create a project directory and run $ doxygen -g to create the Doxyfile. This is the configuration file for your documentation. This allows you to specify documentation format options such as HTML, Unix man page, PDF, RTF, etc.

albert
  • 8,285
  • 3
  • 19
  • 32
jdc
  • 680
  • 1
  • 8
  • 11
  • 1
    Coupled with a Makefile, you can generate the documentation and compile the source code from the command line easily. Doxygen will not compile your code. – jdc May 31 '18 at 15:28