Feature Request - Raw HTML in ddoc comments

Janice Caron caron800 at googlemail.com
Fri Feb 22 06:19:59 PST 2008


On 22/02/2008, Robert Fraser <fraserofthenight at gmail.com> wrote:
> I'm for it... unless you're suggesting getting rid of tags & the default
>  look, in which case I'm against it. Keep in mind that doc comments are
>  used by more than just doc generators (IDEs, static analysis tools...),
>  and should be simple to write in the common case of documenting a
>  function, so tags and other non-formatting metadata should remain intact
>  or otherwise be integrated into any new system.

Well, there's good news and there's bad news.

The good news is that I've written an application called ddocker which
converts HTML to ddoc, so all you have to do is write your HTML using
your editor of choice (so you get syntax highlighting,
auto-completion, wysiwyg, or whatever HTML editing methodology you
prefer), run ddocker on it, and paste the resulting output into D
source code, which will then compile as error-free ddoc.

It took me about half an hour to write the program, which I consider
to be a much better use of my time than learning all the ddoc
formatting codes. (I don't have time to learn a whole new language).

The bad news is that I discovered two bugs in std.xml. They're small,
but enough to stop ddocker from working. I have now fixed those bugs
in std.xml, but obviously the rest of you won't see the fixes until
D2.012, which means you won't be able to build ddocker until then. (It
took me longer to fix std.xml than it did to write ddocker).

Oh, and Walter says that ddoc code can already contain HTML, but that
its use is strongly discouraged for various good reasons. Perhaps, in
the future, after std.xml is stable and ddocker has a good track
record, it might be possible to have HTML-within-ddoc auto-compile
into ddoc (and then, ultimately, back to HTML or pdf or whatever as
the final destination). But for now, ddocker is a good compromise.

Anyway - time well spent, I'd say. I've got a nice little app, and
I've fixed some bugs. Life is good.



More information about the Digitalmars-d mailing list