-
Notifications
You must be signed in to change notification settings - Fork 304
How to write comments so Pinocchio formatter will pretty print them
We'll use the Pinocchio for really pretty literary API documentation.
It uses Markdown as the parser for comments, and it highlights the phpDocumentor's tags, too. So, if you still don't know how to mark up the text in Markdown, go and read the page behind this link, really.
Here are the most important caveats and hints:
-
Every file gets the first-level header with the name of file without extension.
-
It's cool to have the second-level header with the name of class before the class declaration.
-
It's even more cool to have the third-level header with the name of method before the public methods declaration. It's not important to have headers on private and protected methods, they are ideologically helpers.
-
One can format the second-level header in comments as follows:
/* *## I'm a second-level header! *### I'm a third-level header! Note the absence of space between the asterisk and the sharp sign! */
-
You can turn any URL string into a link by enclosing it between angle brackets.
-
You can turn any email address into a clickable safe link by enclosing it between angle brackets.
-
Empty line in comment makes the end of one paragraph and start of another. Newlines are insignificant.
-
To make it technically simple: parsing of a comment starts from the comment symbols, like this:
/** unparsable area * parsable area starting from space after asterisk * */