Doxygen: Support for golang (Origin: bugzilla #697933)

Created on 2 Jul 2018  路  4Comments  路  Source: doxygen/doxygen

status NEW severity enhancement in component general for ---
Reported in version unspecified on platform Other
Assigned to: Dimitri van Heesch

On 2013-04-13 03:45:19 +0000, Pete Morgan wrote:

It would be neat if doxygen supported golang.

Most helpful comment

I have the same problem, I think godoc is no good, I want my Doxygen golang html and pdf output please.

All 4 comments

I'm fairly new to Doxygen, but having support for Go would be great. If I were interested in contributing support for the Go language where would the best place to start be?

I have the same problem, I think godoc is no good, I want my Doxygen golang html and pdf output please.

Since go is often used to document REST APIs that should also be considered - see https://github.com/doxygen/doxygen/issues/6613

Doxygen would ideally need a go parser https://www.stack.nl/~dimitri/doxygen/manual/arch.html
to generate a list of functions etc.
See also https://www.stack.nl/~dimitri/doxygen/manual/faq.html

My favorite programming language is X. Can I still use doxygen?

No, not as such; doxygen needs to understand the structure of what it reads. If you don't mind spending some time on it, there are several options:

If the grammar of X is close to C or C++, then it is probably not too hard to tweak src/scanner.l a bit so the language is supported. This is done for all other languages directly supported by doxygen (i.e. Java, IDL, C#, PHP).
If the grammar of X is somewhat different than you can write an input filter that translates X into something similar enough to C/C++ for doxygen to understand (this approach is taken for VB, Object Pascal, and Javascript, see http://www.stack.nl/~dimitri/doxygen/download.html#helpers).
If the grammar is completely different one could write a parser for X and write a backend that produces a similar syntax tree as is done by src/scanner.l (and also by src/tagreader.cpp while reading tag files).
Was this page helpful?
0 / 5 - 0 ratings