Feneric / doxypypy

A more Pythonic version of doxypy, a Doxygen filter for Python.
GNU General Public License v2.0
149 stars 49 forks source link

Issue with raw docstrings #8

Closed aherrmann closed 11 years ago

aherrmann commented 11 years ago

Hi,

I don't mean to flood you, =) but I also have an issue with raw docstrings.

I'm using doxygen's maths capabilities to document what my maths functions are doing. These are generally quite complicated TeX expressions.

TeX maths contain a lot of backslashes, e.g. \sqrt, \frac, \int, etc. However, since docstrings are regular python strings, the backslash acts as an escape and can trigger unwanted behaviour. This becomes visible when you try to read the docstring in an interactive session, e.g. IPython. Suddenly, it contains non-printable characters.

My fix for this is to use raw strings as doc-strings. I.e. r"""docstring...""". Unfortunately, doxypypy doesn't like this very much. I've forked your repo and added a test to illustrate what I'm talking about.

I'll just link to the commits. The commit messages are descriptive:

Direct links to the files:

Do you have an idea what might cause this problem?

Or, if you have any suggestion how to circumvent this problem I'd be all ears.

Best,

Andy

Feneric commented 11 years ago

Not a problem. I believe I may have found the issue and should have it fixed fairly soon.

aherrmann commented 11 years ago

Thanks! I'm looking forward to that.

Feneric commented 11 years ago

OK, please try now. I believe it was just a matter of the closing quote not being handled properly with the raw doctoring.

aherrmann commented 11 years ago

Thanks!

The problem seems to be fixed.

Feneric commented 11 years ago

Excellent. Please feel free to beef up your current test case a bit (although it doesn't matter much we should probably verify the raw docstrings for classes and modules as well as functions). I'd happily include it in the main branch, and that'd help ensure it doesn't get broken down the road.