Thread overview
Documentation generator is not working
Sep 02, 2021
Vinod K Chandran
Sep 02, 2021
jfondren
Sep 02, 2021
Vinod K Chandran
Sep 02, 2021
Adam D Ruppe
Sep 02, 2021
Vinod K Chandran
Sep 03, 2021
Ali Çehreli
Sep 05, 2021
Vinod K Chandran
Sep 06, 2021
Ali Çehreli
Sep 06, 2021
Vinod K Chandran
September 02, 2021

Hi all,
I am playing with ddoc. I wrote this code--

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 ?

September 02, 2021

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--

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
$
September 02, 2021

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".

September 02, 2021
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.
September 02, 2021
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. :)


September 03, 2021
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


September 05, 2021
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 ?
September 05, 2021
On 9/5/21 3:22 PM, Vinod K Chandran wrote:
> 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 ?

Yes, but it was meant to be a joke. Don't do that. :)

Ali

September 06, 2021
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 :)