Documentation generator is not working

jfondren julian.fondren at gmail.com
Thu Sep 2 16:26:19 UTC 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--
> ```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
$
```


More information about the Digitalmars-d-learn mailing list