Improving ddoc

ketmar via Digitalmars-d digitalmars-d at puremagic.com
Wed Dec 31 16:35:45 PST 2014


On Thu, 01 Jan 2015 13:21:16 +1300
Rikki Cattermole via Digitalmars-d <digitalmars-d at puremagic.com> wrote:

> Although this is a little extreme compared to my original post...

a little. ;-)

yes, processing ASTs with CTFE will be great, but this is huge task.
replacing Ddoc with CTFE which receives an array (tuple? ;-) of
functions with documentation text (preprocessed a little, see below) is
a lighter task. then we can use compile-time introspection to get
function args and so, and format the output as we like.

"small preprocessing" converts the following:

  /** text0
    * text1
    * text2
    */

to:

  text0
  text1
  text2

i.e. just removing that indentation with corresponding '*'. it's easy
and must be done for any formatting, so it can be done before invoking
CTFE. just make sure that the following will not be processed:

  /** text0
    * text1
      heh
    * text2
    */

there is no vertical line of '*', so no need to remove leading '*' here.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 181 bytes
Desc: not available
URL: <http://lists.puremagic.com/pipermail/digitalmars-d/attachments/20150101/c44e1729/attachment.sig>


More information about the Digitalmars-d mailing list