Thread overview
Problems with embedded code in ddoc
Sep 17
FreeSlave
Sep 17
bachmeier
Sep 17
bachmeier
Sep 17
FreeSlave
September 17
I read this page https://dlang.org/spec/ddoc.html#embedded_code and noticed that backticks (`) and tildes (~) should be supported too when embedding code, but when I use dmd -D on my source it produces html without the block of code, but just text and actually tries to interpret <iostream> as html tag! Moreover if I change backticks to hyphens in the C++ code example, it produces

Error: unmatched --- in DDoc comment

So what's wrong? dmd ddox generator or the ddoc documentation?

Here's the file I ran dmd -D on:

/++
 + Some C++
 + ``` cpp
 + #include <iostream>
 +
 + void foo()
 + {
 +     std::cout << "foo!";
 + }
 + ```
 +/
module main;

void main() {}

September 17
On Thursday, 17 September 2020 at 18:26:29 UTC, FreeSlave wrote:
> I read this page https://dlang.org/spec/ddoc.html#embedded_code and noticed that backticks (`) and tildes (~) should be supported too when embedding code, but when I use dmd -D on my source it produces html without the block of code, but just text and actually tries to interpret <iostream> as html tag! Moreover if I change backticks to hyphens in the C++ code example, it produces
>
> Error: unmatched --- in DDoc comment
>
> So what's wrong? dmd ddox generator or the ddoc documentation?
>
> Here's the file I ran dmd -D on:
>
> /++
>  + Some C++
>  + ``` cpp
>  + #include <iostream>
>  +
>  + void foo()
>  + {
>  +     std::cout << "foo!";
>  + }
>  + ```
>  +/
> module main;
>
> void main() {}

Are you using the most recent beta, where markdown is supported by default?
September 17
On Thursday, 17 September 2020 at 18:38:08 UTC, bachmeier wrote:

> Are you using the most recent beta, where markdown is supported by default?

https://forum.dlang.org/post/omkkslyiefebwphugpkg@forum.dlang.org
September 17
On Thursday, 17 September 2020 at 18:38:08 UTC, bachmeier wrote:
>
> Are you using the most recent beta, where markdown is supported by default?

I'm using dmd 2.093.1
Ok, I see, it's a new feature. I thought that spec docs on dlang.org correspond to the latest released version, not beta.
September 17
On 9/17/20 11:47 AM, FreeSlave wrote:
> On Thursday, 17 September 2020 at 18:38:08 UTC, bachmeier wrote:
>>
>> Are you using the most recent beta, where markdown is supported by default?
> 
> I'm using dmd 2.093.1
> Ok, I see, it's a new feature. I thought that spec docs on dlang.org correspond to the latest released version, not beta.

Your version should support it with the -preview=markdown compiler flag. The next version removes the need for that flag.
September 17
On Thu, Sep 17, 2020 at 06:47:27PM +0000, FreeSlave via Digitalmars-d wrote: [..]
> I thought that spec docs on dlang.org correspond to the latest released version, not beta.

This is a problem.  We seriously need to maintain at least two versions
of the spec on the website: the current (immutable) spec, and the
upcoming spec (for the upcoming release).  The (default) spec online
should not reflect changes that haven't been released yet!

Please file a bug for this if one hasn't already been filed.


T

-- 
I see that you JS got Bach.