Thread: [Doxygen-develop] [PATCH] Word wrapping long class names in DOT diagrams
Brought to you by:
dimitri
From: David W. <da...@te...> - 2005-06-15 03:56:39
|
I have noticed that when using the doxygen-generated inheritance diagrams and collaboration diagrams, class names are always drawn on a single line. This can lead to needlessly large diagrams (4000+ pixels wide) if you have a C++ class with several template arguments, for example. The following patch to doxygen 1.4.3 solves this problem for many of the cases I tried, by trying to word-wrap the class name once it exceeds 30 characters. Line breaks are inserted after space or comma. The same line-breaking method will also be used for arrow labels.=20 One inheritance graph (for a template class instantiated with 8 template parameters) went from 4010 to 979 pixels width after this patch and is much more readable. Also, this patch corrects a small bug with collaboration diagrams. When multiple member variables have the same type, this was showing up in the collaboration diagram as "m_one\nm_two\nm_three" next to the dashed purple arrow, rather than showing "m_one", "m_two", "m_three" on separate lines. Regards Dave diff -ur doxygen-1.4.3.orig/src/dot.cpp doxygen-1.4.3/src/dot.cpp --- doxygen-1.4.3.orig/src/dot.cpp 2005-04-18 02:55:55.000000000 +1000 +++ doxygen-1.4.3/src/dot.cpp 2005-06-14 12:41:17.000000000 +1000 @@ -561,15 +561,27 @@ QCString result; const char *p=3Dl.data(); char c; + int line=3D0; while ((c=3D*p++)) { + ++line; switch(c) { + case '\n': result+=3D"\\n"; line=3D0; break; case '\\': result+=3D"\\\\"; break; case '<': result+=3D"\\<"; break; case '>': result+=3D"\\>"; break; case '|': result+=3D"\\|"; break; case '"': result+=3D"\\\""; break; + case ' ': + case ',': + // these are used to break lines over 30 characters + result +=3D c; + if(line >=3D 30 && strlen(p) > 1) { // orphan control: = don't leave dangling '>' on last line + result +=3D "\\l "; + line =3D 0; + } + break; default: result+=3Dc; break; } } @@ -1446,7 +1458,7 @@ } else { - label+=3DQCString("\\n")+s; + label+=3DQCString("\n")+s; } } addClass(ucd->classDef,n,EdgeInfo::Purple,label,distance,0, |
From: Michael M. <Mic...@tt...> - 2005-06-22 13:33:08
|
Hi there, I'm starting to build up a bit of documentation using Doxygen, and realise that I've made the odd spelling mistake. It would help me if Doxygen would check spellings while generating documentations and produce warnings. Checking the lists archives, I haven't found anything significant about spell checking in Doxygen. Surely this has been considered before? I was thinking that it would be simple to make a DocVisitor that together with something like GNU aspell, could check all the observable text and produce warnings for misspelt words. Particularly this would be better than extracting the comments from the source, and then running a spell checker as things like \a words or \code blocks could automatically be skipped. Anyone have any comments on this? If I made such a DocVisitor, would it be welcomed? Cheers, Mike |
From: Duane E. <dua...@fr...> - 2005-06-22 13:38:57
|
> Anyone have any comments on this? If I made such a DocVisitor, would it be > welcomed? Although - I'm concerned about "feature creep" in a package like doxygen. The people I work with would love for me to us a spell checker on the documentation i write... -Duane |
From: Dimitri v. H. <do...@gm...> - 2005-06-22 14:28:26
|
On 6/22/05, Michael McTernan <Mic...@tt...> wrote: > Hi there, >=20 > I'm starting to build up a bit of documentation using Doxygen, and realis= e > that I've made the odd spelling mistake. It would help me if Doxygen wou= ld > check spellings while generating documentations and produce warnings. >=20 > Checking the lists archives, I haven't found anything significant about > spell checking in Doxygen. Surely this has been considered before? >=20 > I was thinking that it would be simple to make a DocVisitor that together > with something like GNU aspell, could check all the observable text and > produce warnings for misspelt words. >=20 > Particularly this would be better than extracting the comments from the > source, and then running a spell checker as things like \a words or \code > blocks could automatically be skipped. >=20 > Anyone have any comments on this? If I made such a DocVisitor, would it = be > welcomed? I like the idea of using the DocVisitor class in combination with a user-specified external tool. So please go ahead and implement this.=20 I think it would require two new string-type config options, i.e something like: SPELL_CHECKER_CMD - command to execute, empty =3D> no spell checking SPELL_CHECKER_LOG - log file to write the results to. The only issue I see is reporting proper line numbers/context info along with the misspelt words. Regards, Dimitri |
From: Chris C. <do...@ke...> - 2005-06-22 16:43:55
|
On Wed, Jun 22, 2005 at 02:31:11PM +0100, Michael McTernan wrote: > I was thinking that it would be simple to make a DocVisitor that together > with something like GNU aspell, could check all the observable text and > produce warnings for misspelt words. What's a misspelt (or misspelled) word in a program? I must have thousands, just in comments where I refer to variables and functions, hardware, and things in external specifications. > Particularly this would be better than extracting the comments from the > source, and then running a spell checker as things like \a words or \code > blocks could automatically be skipped. That would cut down on some, but by no means all. > Anyone have any comments on this? If I made such a DocVisitor, would it be > welcomed? It sounds like a useful thing if it is optional and doesn't add even more to the bulk. Chris C |
From: Stefan K. <ko...@im...> - 2005-06-24 11:55:26
Attachments:
kost.vcf
|
hi hi, aspell already has a c/c++ comment mode. One idea for improvment I have for that is to filter the wors against the TAGS database before spell-checking. This would get dis of all the warning regarding mispelled words which are in fact symbols (function names etc.). Stefan Michael McTernan wrote: > Hi there, > > I'm starting to build up a bit of documentation using Doxygen, and realise > that I've made the odd spelling mistake. It would help me if Doxygen would > check spellings while generating documentations and produce warnings. > > Checking the lists archives, I haven't found anything significant about > spell checking in Doxygen. Surely this has been considered before? > > I was thinking that it would be simple to make a DocVisitor that together > with something like GNU aspell, could check all the observable text and > produce warnings for misspelt words. > > Particularly this would be better than extracting the comments from the > source, and then running a spell checker as things like \a words or \code > blocks could automatically be skipped. > > Anyone have any comments on this? If I made such a DocVisitor, would it be > welcomed? > > Cheers, > > Mike > > > > ------------------------------------------------------- > SF.Net email is sponsored by: Discover Easy Linux Migration Strategies > from IBM. Find simple to follow Roadmaps, straightforward articles, > informative Webcasts and more! Get everything you need to get up to > speed, fast. http://ads.osdn.com/?ad_id=7477&alloc_id=16492&op=click > _______________________________________________ > Doxygen-develop mailing list > Dox...@li... > https://lists.sourceforge.net/lists/listinfo/doxygen-develop > -- \|/ Stefan Kost <@ @> private business +-oOO-(_)-OOo------------------------------------------------------ - - - - - | __ Address Simildenstr. 5 HTWK Leipzig, Fb IMN, Postfach 301166 | /// 04277 Leipzig 04251 Leipzig | __ /// Germany Germany | \\\/// Phone +49341 2253538 +49341 30766101 | \__/ EMail st_kost_at_gmx.net kost_at_imn.htwk-leipzig.de | WWW www.sonicpulse.de www.imn.htwk-leipzig.de/~kost/about.html ===-=-=--=---=---------------------------------- - - - - - |
From: Michael M. <Mic...@tt...> - 2005-06-24 13:16:56
|
Hi, What I had in mind was using a DocVisitor to dump a file of the words (with some file/line information) that should be spell checked. This can then be checked with something like aspell, perhaps using a small bit of script to manage the error reporting etc... Any other spelling tool could be used; that's not for Doxygen to worry about :) I think that this should not affect Doxygen very much at all, but has the advantage of generating documents and spell checking in one step, while also being sensitive to Doxygen mark-up, and as you say, removing symbols and the like. Cheers, Mike > -----Original Message----- > From: dox...@li... [mailto:doxygen-develop- > ad...@li...] On Behalf Of Stefan Kost > Sent: 24 June 2005 12:53 > To: Michael McTernan > Cc: dox...@li... > Subject: Re: [Doxygen-develop] Spell checking > > hi hi, > aspell already has a c/c++ comment mode. One idea for improvment I have > for that > is to filter the wors against the TAGS database before spell-checking. > This > would get dis of all the warning regarding mispelled words which are in > fact > symbols (function names etc.). > > Stefan > > Michael McTernan wrote: > > Hi there, > > > > I'm starting to build up a bit of documentation using Doxygen, and > realise > > that I've made the odd spelling mistake. It would help me if Doxygen > would > > check spellings while generating documentations and produce warnings. > > > > Checking the lists archives, I haven't found anything significant about > > spell checking in Doxygen. Surely this has been considered before? > > > > I was thinking that it would be simple to make a DocVisitor that > together > > with something like GNU aspell, could check all the observable text and > > produce warnings for misspelt words. > > > > Particularly this would be better than extracting the comments from the > > source, and then running a spell checker as things like \a words or > \code > > blocks could automatically be skipped. > > > > Anyone have any comments on this? If I made such a DocVisitor, would it > be > > welcomed? > > > > Cheers, > > > > Mike > > > > > > > > ------------------------------------------------------- > > SF.Net email is sponsored by: Discover Easy Linux Migration Strategies > > from IBM. Find simple to follow Roadmaps, straightforward articles, > > informative Webcasts and more! Get everything you need to get up to > > speed, fast. http://ads.osdn.com/?ad_id=7477&alloc_id=16492&op=click > > _______________________________________________ > > Doxygen-develop mailing list > > Dox...@li... > > https://lists.sourceforge.net/lists/listinfo/doxygen-develop > > > > -- > \|/ Stefan Kost > <@ @> private business > +-oOO-(_)-OOo------------------------------------------------------ - - - > - - > | __ Address Simildenstr. 5 HTWK Leipzig, Fb IMN, Postfach > 301166 > | /// 04277 Leipzig 04251 Leipzig > | __ /// Germany Germany > | \\\/// Phone +49341 2253538 +49341 30766101 > | \__/ EMail st_kost_at_gmx.net kost_at_imn.htwk-leipzig.de > | WWW www.sonicpulse.de www.imn.htwk- > leipzig.de/~kost/about.html > ===-=-=--=---=---------------------------------- - - - - - |