Fix the handling of module-level namespaces. #49
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Addresses issue #33.
The main part of this patch is to auto-detect the
top level namespace for a given python file. It does
this by walking up the directory tree and scanning for
init files until it locates the top-most one.
This patch also fixes the parsing filter so that it automatically
applies the correct top-level namespace when run on module files
by default. This means no more havingt o put @namespace comments
at the top level of modules. It also suppresses using the @namespace
tag in class definitions, which confuses doxygen into thinking
that classes are namespaces. That's no longer neccessary anyway
because of the module-level namespace.
With this patch, doxypypy produces much better output by default
when run on complex module codebases. There are added options
to suppress the new behavior and get the old behavior back,
for those who don't want namespaces in their documentation
(although I can't imagine why one would want that).
Note that, while it wasn't the original intent, this patch also
makes doxypypy very useful to creating unified documentation
sites -- you can point it at multiple python modules (in a single
doxygen config), and it will create a structured documentation
site combining all of them, organized by namespace. This is a
neat trick for organizations to consolidate internal code
documentation in a single location.