www.digitalmars.com         C & C++   DMDScript  

digitalmars.D - Problems with embedded code in ddoc

reply FreeSlave <freeslave93 gmail.com> writes:
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() {}
Sep 17 2020
parent reply bachmeier <no spam.net> writes:
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?
Sep 17 2020
next sibling parent bachmeier <no spam.net> writes:
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
Sep 17 2020
prev sibling parent reply FreeSlave <freeslave93 gmail.com> writes:
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.
Sep 17 2020
next sibling parent David Gileadi <gileadisNOSPM gmail.com> writes:
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.
Sep 17 2020
prev sibling parent "H. S. Teoh" <hsteoh quickfur.ath.cx> writes:
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.
Sep 17 2020