Jump to content

ProcessWire Module / API Doc Viewer


BitPoet
 Share

Recommended Posts

I've realized that I've been jumping back and forth between the PW API docs and the source code for site modules far too much. The idea to hold all necessary documentation locally in one place has occurred to me before, but getting PHPDocumentor et al set up and running reliably (and producing readable output) as always been too much of a hassle. Today I was asked how I find the right hooks and their arguments, and that inspired me to finally get my backside down on the chair and whip something up, namely the

Module Api Doc Viewer

ProcessModuleApiDoc

It lets you browse the inline documentation and public (optionally also protected) class/method/property information for all modules, core classes and template files in the ProcessWire instance. The documentation is generated on the fly, so you don't have to remember to update your docs whenever you update a module.

The module is quite fresh, so expect some bugs there. Behind the scenes it uses PHP-Parser together with a custom class that extracts the information I needed, and the core TextformatterMarkdownExtra module for rendering the description part in the phpdoc style comments.

This is not a replacement / competitor to the API Viewer included in the commercial ProDevTools package. There is quite some information included in the inline documentation that my module can't (and won't) parse, but which makes up parts of the official ProcessWire API docs.

This, instead, is a kind of Swiss army knife to view PHPDoc style information and get a quick class or function reference.

If you feel daring and want to give it a spin, or if you just want to read a bit more, visit the module's GitHub repository.

This is the overview page under "Setup" -> "Module API Docs":

apidoc1-v2.thumb.png.973d163cc001956b49deca16536fd1f2.png

And this is what the documentation for an individual class looks like:

apidocs2-view.thumb.png.29c44ceb2bfee3fa7a2e5d70fb0f5da0.png

The core module documentation can of course be found online, but it didn't make sense not to include them.

Let me know what you think!

apidocs1.png

  • Like 14
Link to comment
Share on other sites

6 hours ago, horst said:

You are in Flow!

Hehe, There are days, and there are days like these.  At 0.0.9 now, even refactored the code a bit and added syntax highlighting for embedded PHP snippets. I think I'll call it a day now though.

apidoc5-syntax.thumb.png.f68eac9e477d0d9703cc1e40222ff4b6.png

  • Like 7
Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

×
×
  • Create New...