Solved

php documentation

Posted on 2016-11-14
4
19 Views
Last Modified: 2016-11-15
We are looking at some online solutions to be able to review and add documentation from our code. I looked at phpdoc and that looks nice but it looks to be a one way. We want to be able to add-on to the docs that might not be in code like a wiki. Is there a solution that will extract documentation from code and allow a user to add to the documentation?
0
Comment
Question by:Robert Saylor
  • 2
4 Comments
 
LVL 108

Expert Comment

by:Ray Paseur
Comment Utility
This is where WordPress is going on documentation.  At the moment, they are pretty much state-of-the-art.
https://make.wordpress.org/core/handbook/best-practices/inline-documentation-standards/php/
0
 

Author Comment

by:Robert Saylor
Comment Utility
anything besides WP that would scan in custom code, display it's documentation and allow a user to add to the documentation?
0
 
LVL 26

Accepted Solution

by:
skullnobrains earned 500 total points
Comment Utility
i do not think such a tool exists.

i can suggest writing a wiki plugin that will parse your source code and grab the phpdoc from each function/class/lib/whatever and insert the doc inline whenever you use their names in your wiki.

i've successfully used a similar but simpler approach by using procedural code, reserving /** ... */ for documentation usage, and using a few rules :
- each function's doc is the first such block above it
- the first block of each library is the lib's desc except if there is a single func and block in the lib in which case both are the same
- some keywords such as "USAGE:" are handled and coloured ( i documented a bit like shell commands ), and other keywords are extracted from the capitalised word in the subject line
- i probably forgot part of it. was years ago.

then i have no idea about your precise needs.
personally, i stopped such integration because i believe a good inline doc is good enough, and i never moved to phpdoc on my own projects because i just hate the format... but i'm pretty sure most people will thell you to use phpdoc alone because it is the standard and because you can stick in a many comments and other information as you want once you know how to use it.
1
 

Author Closing Comment

by:Robert Saylor
Comment Utility
I found out the same when google returned no results. We are going to use a Wiki software to maintain docs. It's mostly for company standard process.
0

Featured Post

Do You Know the 4 Main Threat Actor Types?

Do you know the main threat actor types? Most attackers fall into one of four categories, each with their own favored tactics, techniques, and procedures.

Join & Write a Comment

Author Note: Since this E-E article was originally written, years ago, formal testing has come into common use in the world of PHP.  PHPUnit (http://en.wikipedia.org/wiki/PHPUnit) and similar technologies have enjoyed wide adoption, making it possib…
Since pre-biblical times, humans have sought ways to keep secrets, and share the secrets selectively.  This article explores the ways PHP can be used to hide and encrypt information.
Explain concepts important to validation of email addresses with regular expressions. Applies to most languages/tools that uses regular expressions. Consider email address RFCs: Look at HTML5 form input element (with type=email) regex pattern: T…
The viewer will learn how to count occurrences of each item in an array.

744 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

11 Experts available now in Live!

Get 1:1 Help Now