digitalmars.D.announce - ddoc-xml, first demo
- Markus Dangl (32/32) Sep 30 2005 XML output works :)
- Walter Bright (12/42) Sep 30 2005 Cool!
- Derek Parnell (13/25) Oct 01 2005 Note: The contents of a .ddoc file must not be in the form of D comment...
- Walter Bright (19/22) Oct 01 2005 That's right. Specifically, if in a .d source file you might have:
- Markus Dangl (11/32) Oct 02 2005 That would be great! I'd say it should be public domain or GPL (or sth
XML output works :) Finally i got some XML ouput to work. I'm including a zip file including: xml.ddoc - the ddoc macro definition file for XML output ddoc.dtd - a DTD for the resulting XML documents ddoc2xhtml.xsl - an XSLT stylesheet for transforming DDOC-XML to XHTML (automatically included from the XML files for viewing them in the browser) style.css - A CSS stylesheet used by ddoc2xhtml.xsl example.d - An example d source file with lots of ddoc comments To test it you would: 1. Tell dmd to use the xml.ddoc (i used the sc.ini version, don't know if you can specify this on the command line) 2. Run dmd (or build) with "-D" parameter on your source file 3. Rename the resulting .html file to .xml 4. Open in with your browser (ddoc2xhtml.xsl and style.css have to be in the same directory as the xml file) Problems: 1. Code sections (example code) get messed up with lots of linebreaks. This seems to be the fault of the macro processor :( 2. You have to manually rename the file to .xml 3. No support for multiple input files yet, thus no inter-linking. Perhaps we could add something to Dereks "build" tool to join the resulting XML files in a special way, then run several commands on it (for example: to generate XHTML, CHM, PDF in one run!) I didn't test it with lots of source yet, remember: it is just a demo. If you want to change some colors or font-sizes etc. you may edit the css file. If you want to change to whole layout of the output, i'm afraid you'll have to edit the xsl file, so you have to know how to use XSLT... I'm working on XSL-FO output now, so we could create PDF documentation. I hope this will be useful, - Markus Dangl
Sep 30 2005
"Markus Dangl" <danglm in.tum.de> wrote in message news:dhjopu$1u9v$1 digitaldaemon.com...XML output works :)Cool!Finally i got some XML ouput to work. I'm including a zip file including: xml.ddoc - the ddoc macro definition file for XML output ddoc.dtd - a DTD for the resulting XML documents ddoc2xhtml.xsl - an XSLT stylesheet for transforming DDOC-XML to XHTML (automatically included from the XML files for viewing them in the browser) style.css - A CSS stylesheet used by ddoc2xhtml.xsl example.d - An example d source file with lots of ddoc commentsCan I include it in the dmd distribution?To test it you would: 1. Tell dmd to use the xml.ddoc (i used the sc.ini version, don't know if you can specify this on the command line)Just list the .ddoc files on the command line, like you would a .lib file. dmd -D foo.d xml.ddoc2. Run dmd (or build) with "-D" parameter on your source file 3. Rename the resulting .html file to .xmlUse the -Df flag to set the output file name: dmd -D -Dffoo.xml foo.d xml.ddoc4. Open in with your browser (ddoc2xhtml.xsl and style.css have to be in the same directory as the xml file) Problems: 1. Code sections (example code) get messed up with lots of linebreaks. This seems to be the fault of the macro processor :(Hmm. I thought I fixed that in the latest version.2. You have to manually rename the file to .xmlThe -Df flag rides to the rescue here.3. No support for multiple input files yet, thus no inter-linking. Perhaps we could add something to Dereks "build" tool to join the resulting XML files in a special way, then run several commands on it (for example: to generate XHTML, CHM, PDF in one run!)That'll probably have to wait.I didn't test it with lots of source yet, remember: it is just a demo. If you want to change some colors or font-sizes etc. you may edit the css file. If you want to change to whole layout of the output, i'm afraid you'll have to edit the xsl file, so you have to know how to use XSLT... I'm working on XSL-FO output now, so we could create PDF documentation.I'd love to see the result in PDF!
Sep 30 2005
On Fri, 30 Sep 2005 19:13:25 -0700, Walter Bright wrote:"Markus Dangl" <danglm in.tum.de> wrote in message[snip]Note: The contents of a .ddoc file must not be in the form of D comments. If you do that you get weird results. Just code a .ddoc file AS IF it already was a document comment.1. Tell dmd to use the xml.ddoc (i used the sc.ini version, don't know if you can specify this on the command line)Just list the .ddoc files on the command line, like you would a .lib file. dmd -D foo.d xml.ddocNo. This is a problem. You insert new lines where a space was originally coded. I notice this especially with DDOC_PSYMBOL macros. -- Derek Parnell Melbourne, Australia 2/10/2005 12:47:51 AMProblems: 1. Code sections (example code) get messed up with lots of linebreaks. This seems to be the fault of the macro processor :(Hmm. I thought I fixed that in the latest version.
Oct 01 2005
"Derek Parnell" <derek psych.ward> wrote in message news:18k7sjg47btw4.xazz4zd88o3g$.dlg 40tude.net...Note: The contents of a .ddoc file must not be in the form of D comments. If you do that you get weird results. Just code a .ddoc file AS IF it already was a document comment.That's right. Specifically, if in a .d source file you might have: /***** * blah, blah, blah * * More erudite blah, blah, blah. * Macros: * FOO = BAR * MAX = the maximum of * x and x's ilk * ABC = def */ A corresponding .ddoc file would be just the contents of the Macros section: FOO = BAR MAX = the maximum of x and x's ilk ABC = def Nothing but macro definitions go in a .ddoc file, not even "Macros:".
Oct 01 2005
Can I include it in the dmd distribution?That would be great! I'd say it should be public domain or GPL (or sth similar)... Whichever you like better :)Oh, right :) I thought it might be a good option to set only the extension, so you wouldn't have to specify the whole filename for every file that gets built. But this can be solved by scripting or by the build tool, of course.3. Rename the resulting .html file to .xmlUse the -Df flag to set the output file name: dmd -D -Dffoo.xml foo.d xml.ddocI tried it with dmd 0.134, maybe i got something wrong in the ddoc file, although i can't see where...Problems: 1. Code sections (example code) get messed up with lots of linebreaks. This seems to be the fault of the macro processor :(Hmm. I thought I fixed that in the latest version.Hey i just got the XSLT finished :) I'm announcing it in a new thread.I didn't test it with lots of source yet, remember: it is just a demo. If you want to change some colors or font-sizes etc. you may edit the css file. If you want to change to whole layout of the output, i'm afraid you'll have to edit the xsl file, so you have to know how to use XSLT... I'm working on XSL-FO output now, so we could create PDF documentation.I'd love to see the result in PDF!
Oct 02 2005