Is there a source code documentation generator for C / C++ like docco? [closed]
-
14-04-2021 - |
سؤال
I would like the get a similar output on documented c++ implementation files (not header files) like the output generated with docco. Is there such a tool?
المحلول
Docco claims to support this now - https://github.com/jashkenas/docco/pull/96
نصائح أخرى
the docco source (git repo) has c support. if you clone it you can install it locally with npm. however:
i had to compile the docco.coffee to javascript:
cd docco/src coffee -c docco.coffee cp docco.js ../lib
if you have header and c files with matching names, in the same directory, one overwrites the other.
for some reason everything node.js related is segfaulting like crazy, but i think this must be something wrong with my install (luckily, docco segfaults at the end, after generating the output).
update - as a fix for the overwrite issue i cloned the repo and dropped the removal of the file extension. so foo.h
now goes to foo.h.html
which doesn't over-write foo.c.html
. you can grab a copy from https://github.com/andrewcooke/docco
i also recompiled the javascript, so to use do something like:
git clone git://github.com/andrewcooke/docco.git
npm install docco
docco src/*.c src/*.h
I'm not familiar with docco, but it looks like a form of literate programming. If this is the case, you might want to look at cweb. The syntax is probably different, but it does work with C++ (even if it was designed with C in mind).