Re: -D option = Embedded documentation

2011-12-16 Thread Trass3r

Am 16.12.2011, 19:45 Uhr, schrieb dune :


I didn't realize that stuff like this will not work as expected:

[code]
/***
 * Brief summary of what
 * myfunc does, forming the summary section.
 *
 * First paragraph of synopsis description.
 *
 * Second paragraph of
 * synopsis description.
 */

void myfunc() { }

/***
 * This is just some text that
 * should be added to the
 * documentation
 */

// below is the next chunk of code
[/code]

The second block of documentation will not show up.


How is the doc generator supposed to know where that doc fragment is  
supposed to end up?

If it's related to a declaration, put it there.
If it's just a module-level comment, put it into the module doc comment.


Re: -D option = Embedded documentation

2011-12-16 Thread dune
I didn't realize that stuff like this will not work as expected:

[code]
/***
 * Brief summary of what
 * myfunc does, forming the summary section.
 *
 * First paragraph of synopsis description.
 *
 * Second paragraph of
 * synopsis description.
 */

void myfunc() { }

/***
 * This is just some text that
 * should be added to the
 * documentation
 */

// below is the next chunk of code
[/code]

The second block of documentation will not show up.


Here the section of the D2 DDoc documentation I apparently missed:

"Documentation comments not associated with a declaration are ignored."

(from http://www.d-programming-language.org/ddoc.html)


...which in turn is not logical to me because the condition "/**" and "*/" are 
met.


Anyway, thanks for the help; it guided me in the right direction.

Thanks again


Re: -D option = Embedded documentation

2011-12-16 Thread Trass3r
 Page generated by href="http://www.digitalmars.com/d/2.0/ddoc.html";>Ddoc. 

 


Ah looks like that must be updated to dlang.org too


Re: -D option = Embedded documentation

2011-12-16 Thread Timon Gehr

On 12/16/2011 06:12 PM, dune wrote:

What?

Sorry but I don't understand...

What I posted was an example, in reality there is tons of code inside the d 
file.

Thanks


That is not what you said. Obviously you should always give an example 
that actually fails, especially when you claim it does.


$ cat worksforme.d
/**
 * documentation here
 */
module worksforme;

/// program entry point
void main(){}

$ dmd -D worksforme
$ cat worksforme.html


worksforme

worksforme

documentation here

void main();

program entry point




Page generated by href="http://www.digitalmars.com/d/2.0/ddoc.html";>Ddoc. 




Re: -D option = Embedded documentation

2011-12-16 Thread Trass3r
What I posted was an example, in reality there is tons of code inside  
the d file.


Show the file, or part of it.


Re: -D option = Embedded documentation

2011-12-16 Thread dune
What?

Sorry but I don't understand...

What I posted was an example, in reality there is tons of code inside the d 
file.

Thanks


Re: -D option = Embedded documentation

2011-12-16 Thread Trass3r

Am 16.12.2011, 17:47 Uhr, schrieb dune :


Never tried this before:

Tried (with D2.057) to use the embedded documentation option with:

/**
 * documentation here
 */

and the html files are generated but they only contain a html skeleton  
and no documentation.


This comment doesn't refer to any code.


-D option = Embedded documentation

2011-12-16 Thread dune
Never tried this before:

Tried (with D2.057) to use the embedded documentation option with:

/**
 * documentation here
 */

and the html files are generated but they only contain a html skeleton and no
documentation.

Any hints?