BitPoet Posted March 26, 2021 Share Posted March 26, 2021 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": And this is what the documentation for an individual class looks like: 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! 14 Link to comment Share on other sites More sharing options...
BitPoet Posted March 27, 2021 Author Share Posted March 27, 2021 Version 0.0.2: Includes PW core classes as well and strips special #pw- comment tags Ryan uses to generate the official API docs. 1 Link to comment Share on other sites More sharing options...
BitPoet Posted March 27, 2021 Author Share Posted March 27, 2021 Aaand... Version 0.0.4: Also displays docs for not installed modules. 1 Link to comment Share on other sites More sharing options...
BitPoet Posted March 27, 2021 Author Share Posted March 27, 2021 New release: 0.0.6 Adds support for template files as well. Link to comment Share on other sites More sharing options...
horst Posted March 27, 2021 Share Posted March 27, 2021 You are in Flow! ? ? 1 Link to comment Share on other sites More sharing options...
BitPoet Posted March 27, 2021 Author Share Posted March 27, 2021 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. 7 Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now