Create Word Document from PHP Documentation

842 views Asked by At

To document my code I thought it would be best practice to use phpDoc syntax, because there are several parsers out there and some IDEs create IntelliSense out of it.

Now I need to put the documentation (API) into a word file, but I don't know which parser is able to output .doc or similar.

I tried DoxyGen, which outputs .rtf and phpDocumentor2, which can only export to .html and .xml (?).

Is there a way to generate a .doc(x) file from phpDoc? Or a simple way to get a document which can be imported to word? I would appreciate if I don't have to change the phpDoc syntax, because my documentation is very long.


Edit: The prefered parser would be phpDocumentor2, because it supports PHP 5.3 functionalities and it's faster than DoxyGen, but phpDocumentor2 has less features than phpDocumentor, which is no longer maintained, related to output formats.


Edit: I tried to copy content from the .rtf file into the .docx file, but when I select 'Use Destination Styles', both Word instances suspend and do not respond.

1

There are 1 answers

0
ashnazg On

Presumably you want one large Word doc that contains all the info for your project in the one doc/file... therefore just opening the phpDoc2 HTML output into Word in order to convert it to docx will not meet your need, since that would be one docx per phpdoc2 HTML page.

You might try altering your searches to be for a tool that can spider a given HTML page, recursively pick up all its target page hierarchy, and convert it all into a single docx. You might have more luck finding a tool that does this but produces a PDF... then you could just use Word to convert the PDF into docx.