Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Full PHP Class Documentation #12

Closed
phpfui opened this issue Oct 26, 2022 · 8 comments · May be fixed by #18
Closed

Full PHP Class Documentation #12

phpfui opened this issue Oct 26, 2022 · 8 comments · May be fixed by #18
Labels
documentation Improvements or additions to documentation

Comments

@phpfui
Copy link

phpfui commented Oct 26, 2022

You can see the full class documentation for this library at PHPFUI/InstaDoc It also has the full source code in case the documentation is unclear. Updated to the latest version nightly.

@back-2-95
Copy link
Member

Hmm... could this be automised here somehow with Github Actions and push the html-docs to repo?

@back-2-95 back-2-95 added the documentation Improvements or additions to documentation label Oct 27, 2022
@phpfui
Copy link
Author

phpfui commented Oct 27, 2022

Not sure if it can be automated with Actions, as it would have to do a git commit in the action. No idea if this is possible.

I could certainly do static html pages and put them in a doc directory. I can submit a PR for just the docs directory with html files. If you like it, I can write a script that will generate it. You could run it by hand easily before doing a release. Bug fixes would not need a regen, as the class interfaces would not change. But updating doc blocks would. There may be an issue with css and JS files that are needed by Foundation, but it might work depending on how GitHub serves html pages. The InstaDoc library is meant to be run from a configured server (Foundation installed) and are not 100% independent pages.

If this sounds good to you, let me know.

@back-2-95
Copy link
Member

Ok, maybe it's too much then. And I just realised as this gets installed as package with Composer we would deliver those docs everytime. So maybe describing/linking this in the readme or in the wiki good be enough.

@phpfui
Copy link
Author

phpfui commented Oct 28, 2022

You can link to my site if you want. Or host your own. I'll see if I can get some simple code to make it work just for one repo installed via composer.

@back-2-95
Copy link
Member

Yeah, I'd like to see how it works. It would be easier then for me to estimate how to utilize it the best way.

@phpfui
Copy link
Author

phpfui commented Oct 31, 2022

This would be the minimal code to show just the docs from this library:

<?php

include '../vendor/autoload.php';

$fileManager = new \PHPFUI\InstaDoc\FileManager();
$fileManager->addNamespace('Druidfi\Mysqldump', '../vendor/druidfi/mysqldump-php/src');
$fileManager->load();
\PHPFUI\InstaDoc\ChildClasses::load('../ChildClasses.serial');
$controller = new \PHPFUI\InstaDoc\Controller($fileManager);
echo $controller->display();

The display method returns a fully formed HTML page. I generally have a controller to resolve the route, then run this code and exit, but you could do something else, or have a stand alone "doc.php" file with this just code. Either will work.

@back-2-95
Copy link
Member

I looked into it and checked alternatives. I went with phpDocumentor (PR #18) as it gave me oneliner solution with Docker. I just need to figure out how & where I wanna put the html or do I just leave it = ppl can generate when needed.

@phpfui
Copy link
Author

phpfui commented Nov 14, 2022

LOL! I looked at PhpDocumentor years ago before I wrote InstaDoc. Still has all the same issues (static pages, 92 megs in my project alone, not counting all packages I use, generates html with errors and warnings, documentation is not compact or separated by access and even misses valid doc blocks, horrible interface). But at least they made it easier to generate docs. Before it was hours of configuration before you got something usable.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
documentation Improvements or additions to documentation
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants