Support of @verbatim tags

neochief - June 1, 2008 - 17:11
Project:API
Version:5.x-1.x-dev
Component:Code
Category:feature request
Priority:normal
Assigned:Unassigned
Status:needs work
Description

I've prepared patch for @verbatim tags support. It's much like @code processor, but isn't adds >?php to the block.

AttachmentSize
varbatim_tags.patch1.17 KB

#1

neochief - June 1, 2008 - 17:11
Status:active» needs review

#2

Damien Tournoud - June 2, 2008 - 23:07

I can understand what the patch does, but I'm not sure what the correct behavior is here.

According to the doxygen documentation (for example here [1]), the @verbatim tag simply disable all commands, while the content of the @code tag are interpreted as C/C++ (in our case PHP) code.

Thus, it looks like @verbatim tags will require special handling (they need to be interpreted as early as possible and there code contents should be escaped).

[1] http://www.stack.nl/~dimitri/doxygen/commands.html#cmdverbatim

#3

neochief - June 3, 2008 - 00:16

Yes, I've already seen that doc before. In our case verbatim must formats like a simle HTML code, so I thought it would be nice to put our usual php pritifying on it. Results of it's work you can see here

To be honest, the code is changed a little to get this result. The main problem was in P tags generation, that is making the HTML non-valid. So I played with line breaks to make a right result.

AttachmentSize
varbatim_tags_2.patch 1.18 KB

#4

drumm - June 15, 2008 - 23:55
Category:task» feature request

#5

lilou - October 15, 2008 - 05:12

#6

drumm - December 27, 2008 - 05:09
Status:needs review» needs work

I agree with Damien Tournoud, if we implement @verbatim, it should do what other documentation parsers do.

I think our @code is a bit chatty, prefixing everything with <?php.

#7

sime - June 8, 2009 - 06:23

Doing some docs at the moment, code that isn't PHP. I don't know whether to use @code (and have misleading php tags) or use @verbatim and accept it will look broken for a while.

Is there simply a way to force a line break in docs? I don't see it looking in the api module code, but then I'm not crash hot at reading code that's full of regular expressions...

 
 

Drupal is a registered trademark of Dries Buytaert.