Hai Vu
Hai Vu

Reputation: 40698

Doxygen-how to document files with non-standard extension (.INI)

I have a simple question: how do I document .INI file?

I have a C++ project with the following layout:

readme.txt
src
    main.cpp
data
    simple.ini

I have no problem generating document from readme.txt and main.cpp, but the document in simple.ini does not show in the html output at all. I have fixed the Doxygen file to include the following:

INPUT = . src data
FILE_PATTERNS = *.cpp *.txt *.ini

That did not help. I also explicitly specify simple.ini:

INPUT = readme.txt data/simple.ini src

But it did not work either. Within simple.ini, I use ';' for comment:

; @file simple.ini
; This file will do blah blah blah
[section1]
key1 = foo
key2 = bar
...

I also tried to use '#' for comment char, but it did not work, either. How do I make doxygen to process simple.ini?

Upvotes: 9

Views: 4656

Answers (3)

LikeTheRock
LikeTheRock

Reputation: 101

To add custom file extensions to doxygen you must edit two things in the config file:

  • FILE_PATTERNS to include the extension often *.extension \
  • EXTENSION_MAPPING to be .extension=parser where parser is C, C#, C++, Python etc.

In your case set '.extension' as '.ini' and 'parser' as C. Doxygen expects two lines of either the following /// or //!. It also accepts multi-line /** and /*!.
OR
set 'parser' to 'Python' to use ## style comments as # is accepted by .ini as a comment although not recommended. This should remove your need for ;s

Upvotes: 6

user877329
user877329

Reputation: 6200

I would say Doxygen lacks the feature of documenting

  • build scripts
  • configuration files
  • custom scripts for use in your own vm

So the ultimate solution is to fork Doxygen, and add ability to process arbitrary language, like Notepad++ or Kate. On the way, you should also clean up its messy 2002-style HTML output, so it no longer generates a div soup.

Upvotes: -1

mouviciel
mouviciel

Reputation: 67829

Doxygen expects /** or /// for starting a doxygen-aware comment block. I don't know if it works, but I would try to comment with:

; /// @file simple.ini
; /// This file will do blah blah blah
...

Upvotes: 4

Related Questions