www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.learn - Generating documentation help

reply Tim <tim.oliver tutanota.com> writes:
Hi there,

I have a couple of (probably) fairly simple questions. First, 
when I generate documentation files (-Dd docs) for my project, it 
also generates documentation for the library Mir. How can I fix 
the compiler pulling in those docs as well?

It seems that D won't let me document class constructors. This is 
a problem as I'd like to be able to document the constructor 
parameters. If I put the class documentation above the class 
definition, then ddoc gives an error that the parameters 
specified can't be found.


Thanks
Jan 17 2021
parent reply Paul Backus <snarwin gmail.com> writes:
On Sunday, 17 January 2021 at 21:07:31 UTC, Tim wrote:
 Hi there,

 I have a couple of (probably) fairly simple questions. First, 
 when I generate documentation files (-Dd docs) for my project, 
 it also generates documentation for the library Mir. How can I 
 fix the compiler pulling in those docs as well?

 It seems that D won't let me document class constructors. This 
 is a problem as I'd like to be able to document the constructor 
 parameters. If I put the class documentation above the class 
 definition, then ddoc gives an error that the parameters 
 specified can't be found.


 Thanks
DDoc has a number of annoying bugs like this, and as far as I know it isn't really maintained, so they are unlikely to be fixed any time soon. I recommend using adrdox instead: https://code.dlang.org/packages/adrdox
Jan 17 2021
parent reply Adam D. Ruppe <destructionator gmail.com> writes:
On Sunday, 17 January 2021 at 21:48:20 UTC, Paul Backus wrote:
 I recommend using adrdox instead:
note you should be able to just dub run adrdox and it will spit out `generated_docs/files...` (assuming i haven't broken that recently)
Jan 17 2021
parent reply Tim <tim.oliver tutanota.com> writes:
On Sunday, 17 January 2021 at 22:27:13 UTC, Adam D. Ruppe wrote:
 On Sunday, 17 January 2021 at 21:48:20 UTC, Paul Backus wrote:
 I recommend using adrdox instead:
note you should be able to just dub run adrdox and it will spit out `generated_docs/files...` (assuming i haven't broken that recently)
This is really amazing! However, it only lays out the documentation for modules that are being imported (useful for documenting libraries). I'm creating a u-services based app so my apps need to be documented properly as well. I can get around this by defining them as modules but then adrdox doesn't add them to index.html
Jan 19 2021
parent reply Adam D. Ruppe <destructionator gmail.com> writes:
On Tuesday, 19 January 2021 at 23:51:00 UTC, Tim wrote:
 I'm creating a u-services based app so my apps need to be 
 documented properly as well. I can get around this by defining 
 them as modules but then adrdox doesn't add them to index.html
Well, it does all .d files passed in directories given to it that have a module declaration. (And all .d files should have a module declaration anyway btw.) If they live in different places, you can pass that too like dub run adrdox -- . ../whatever-else
Jan 19 2021
parent reply Tim <tim.oliver tutanota.com> writes:
On Tuesday, 19 January 2021 at 23:57:21 UTC, Adam D. Ruppe wrote:
 On Tuesday, 19 January 2021 at 23:51:00 UTC, Tim wrote:
 I'm creating a u-services based app so my apps need to be 
 documented properly as well. I can get around this by defining 
 them as modules but then adrdox doesn't add them to index.html
Well, it does all .d files passed in directories given to it that have a module declaration. (And all .d files should have a module declaration anyway btw.) If they live in different places, you can pass that too like dub run adrdox -- . ../whatever-else
The main issue is that those scripts aren't being added to index.html
Jan 19 2021
parent reply Adam D. Ruppe <destructionator gmail.com> writes:
On Tuesday, 19 January 2021 at 23:58:59 UTC, Tim wrote:
 The main issue is that those scripts aren't being added to 
 index.html
Do they have module definitions and doc comments in there somewhere? like here I have all kinds of things http://dpldocs.info/experimental-docs/index.html
Jan 19 2021
parent reply Tim <tim.oliver tutanota.com> writes:
On Wednesday, 20 January 2021 at 00:03:16 UTC, Adam D. Ruppe 
wrote:
 On Tuesday, 19 January 2021 at 23:58:59 UTC, Tim wrote:
 The main issue is that those scripts aren't being added to 
 index.html
Do they have module definitions and doc comments in there somewhere? like here I have all kinds of things http://dpldocs.info/experimental-docs/index.html
Yeah, they have both. They also contain the main entrypoint
Jan 19 2021
parent reply Adam D. Ruppe <destructionator gmail.com> writes:
On Wednesday, 20 January 2021 at 00:06:35 UTC, Tim wrote:
 Yeah, they have both. They also contain the main entrypoint
What are the module names? If it is like `module foo.main;` it will be listed under `foo` as a submodule rather than top-level since it is all organized by name. (if the code is public just send a link plz and I'll take a look there)
Jan 19 2021
parent reply Tim <tim.oliver tutanota.com> writes:
On Wednesday, 20 January 2021 at 00:13:42 UTC, Adam D. Ruppe 
wrote:
 On Wednesday, 20 January 2021 at 00:06:35 UTC, Tim wrote:
 Yeah, they have both. They also contain the main entrypoint
What are the module names? If it is like `module foo.main;` it will be listed under `foo` as a submodule rather than top-level since it is all organized by name. (if the code is public just send a link plz and I'll take a look there)
Unfortunately, the code isn't public. They are defined "module simulator" and "module analyzer". I also have "module math" etc. that are added to the index, just not simulator and analyzer (which both have the main entrypoint)
Jan 19 2021
parent reply Adam D. Ruppe <destructionator gmail.com> writes:
On Wednesday, 20 January 2021 at 00:16:51 UTC, Tim wrote:
 They are defined "module simulator" and "module analyzer". I 
 also have "module math" etc. that are added to the index
That's weird... There are a bunch of command line args to adrdox that might help like --document-undocumented --write-private-docs --write-internal-modules (see --help for more info) but by the sounds of it none of those should apply to you. idk...
Jan 19 2021
parent reply Tim <tim.oliver tutanota.com> writes:
On Wednesday, 20 January 2021 at 00:53:54 UTC, Adam D. Ruppe 
wrote:
 On Wednesday, 20 January 2021 at 00:16:51 UTC, Tim wrote:
 They are defined "module simulator" and "module analyzer". I 
 also have "module math" etc. that are added to the index
That's weird... There are a bunch of command line args to adrdox that might help like --document-undocumented --write-private-docs --write-internal-modules (see --help for more info) but by the sounds of it none of those should apply to you. idk...
None of those worked. But if I deleted index.html then reran the doc gen, it worked just fine. Looks like index.html is not being updated
Jan 19 2021
parent reply Adam D. Ruppe <destructionator gmail.com> writes:
On Wednesday, 20 January 2021 at 01:00:32 UTC, Tim wrote:
 But if I deleted index.html then reran the doc gen, it worked 
 just fine. Looks like index.html is not being updated
oooooh yeah i forgot i did that.... cuz I so often build individual files and it deleting the index annoyed me.... oops, i should prolly make that a command line arg or something. so yeah my error but now we know.
Jan 19 2021
parent Tim <tim.oliver tutanota.com> writes:
On Wednesday, 20 January 2021 at 01:25:28 UTC, Adam D. Ruppe 
wrote:
 On Wednesday, 20 January 2021 at 01:00:32 UTC, Tim wrote:
 But if I deleted index.html then reran the doc gen, it worked 
 just fine. Looks like index.html is not being updated
oooooh yeah i forgot i did that.... cuz I so often build individual files and it deleting the index annoyed me.... oops, i should prolly make that a command line arg or something. so yeah my error but now we know.
Glad we worked it out
Jan 19 2021