www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.learn - Documentation generator is not working

reply Vinod K Chandran <kcvinu82 gmail.com> writes:
Hi all,
I am playing with ddoc. I wrote this code--
```d
import std.stdio : log = writeln;

void main() {
     log("Experimenting with dDoc");
}

/// A sample function.
/// Let's check what we will get in documentation.
/// abc - A simple string
void sample(string abc) {log(abc);}
```
And then, compile it with "-D" switch. At first, I saw an html 
file is generated. But I deleted it and compiled again. This 
time, no html file is generated. What's wrong with this ?
Sep 02 2021
parent reply jfondren <julian.fondren gmail.com> writes:
On Thursday, 2 September 2021 at 16:20:32 UTC, Vinod K Chandran 
wrote:
 Hi all,
 I am playing with ddoc. I wrote this code--
 ```d
 import std.stdio : log = writeln;

 void main() {
     log("Experimenting with dDoc");
 }

 /// A sample function.
 /// Let's check what we will get in documentation.
 /// abc - A simple string
 void sample(string abc) {log(abc);}
 ```
 And then, compile it with "-D" switch. At first, I saw an html 
 file is generated. But I deleted it and compiled again. This 
 time, no html file is generated. What's wrong with this ?
What commands are you running? What you describe doing, works: ``` $ cat file.d import std.stdio : log = writeln; void main() { log("Experimenting with dDoc"); } /// A sample function. /// Let's check what we will get in documentation. /// abc - A simple string void sample(string abc) {log(abc);} $ dmd -D file $ w3m -dump file.html|grep -A1 function A sample function. Let's check what we will get in documentation. abc - A simple string $ rm -fv file.html removed 'file.html' $ dmd -D file $ w3m -dump file.html|grep -A1 function A sample function. Let's check what we will get in documentation. abc - A simple string $ ```
Sep 02 2021
parent reply Vinod K Chandran <kcvinu82 gmail.com> writes:
On Thursday, 2 September 2021 at 16:26:19 UTC, jfondren wrote:

 What commands are you running? What you describe doing, works:

 ```
 

 $ dmd -D file

 $ w3m -dump file.html|grep -A1 function
     A sample function. Let's check what we will get in 
 documentation. abc - A
     simple string

 $ rm -fv file.html
 removed 'file.html'

 $ dmd -D file

 $ w3m -dump file.html|grep -A1 function
     A sample function. Let's check what we will get in 
 documentation. abc - A
     simple string
 $
 ```
Thanks for the reply. My command was the problem. I repeatedly used "dmd -run test.d -D" But now, I can see the html file when I use this -- "dmd -D test.d".
Sep 02 2021
parent reply Adam D Ruppe <destructionator gmail.com> writes:
On Thursday, 2 September 2021 at 17:20:55 UTC, Vinod K Chandran 
wrote:
 "dmd -run test.d -D"
Anything after -run goes to your program not the compiler. Args to the compiler must be before -run.
Sep 02 2021
parent reply Vinod K Chandran <kcvinu82 gmail.com> writes:
On Thursday, 2 September 2021 at 17:34:59 UTC, Adam D Ruppe wrote:
 Anything after -run goes to your program not the compiler.

 Args to the compiler must be before -run.
Thanks for the reply. Got the point now. :)
Sep 02 2021
parent reply =?UTF-8?Q?Ali_=c3=87ehreli?= <acehreli yahoo.com> writes:
On 9/2/21 10:38 AM, Vinod K Chandran wrote:
 On Thursday, 2 September 2021 at 17:34:59 UTC, Adam D Ruppe wrote:
 Anything after -run goes to your program not the compiler.

 Args to the compiler must be before -run.
Thanks for the reply. Got the point now. :)
So, change your program to respond to -D and generate the documentation potentially by spawning a dmd instance. :o) Ali
Sep 03 2021
parent reply Vinod K Chandran <kcvinu82 gmail.com> writes:
On Friday, 3 September 2021 at 20:21:43 UTC, Ali Çehreli wrote:
 So, change your program to respond to -D and generate the 
 documentation potentially by spawning a dmd instance. :o)
I am not sure i get the point correctly. You mean, starting dmd as a new process from my program and pass the file name as parameter ?
Sep 05 2021
parent reply =?UTF-8?Q?Ali_=c3=87ehreli?= <acehreli yahoo.com> writes:
On 9/5/21 3:22 PM, Vinod K Chandran wrote:
 On Friday, 3 September 2021 at 20:21:43 UTC, Ali =C3=87ehreli wrote:
 So, change your program to respond to -D and generate the=20
 documentation potentially by spawning a dmd instance. :o)
I am not sure i get the point correctly. You mean, starting dmd as a ne=
w=20
 process from my program and pass the file name as parameter ?
Yes, but it was meant to be a joke. Don't do that. :) Ali
Sep 05 2021
parent Vinod K Chandran <kcvinu82 gmail.com> writes:
On Monday, 6 September 2021 at 01:19:04 UTC, Ali Çehreli wrote:

 Yes, but it was meant to be a joke. Don't do that. :)
Ha ha, okay :)
Sep 06 2021