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

New template with source code and faster search engine #8

Merged
merged 43 commits into from
Sep 24, 2020
Merged

Conversation

claudiosanches
Copy link
Contributor

This PR introduces a new template where many issues present in the default PHPDoc template gets solved, like missing source code, and the search that was crashing browsers.

Note that the new template is based in the latest template from PHPDoc, using the latest structure that makes everything more organized, and also keep us updated when PHPDoc 3 gets released.

And besides the new styling, I also included a hook reference generator based on the old one used for ApiGen. I'm waiting for a better documentation for PHPDoc 3, for now is missing a proper documentation to extend PHPDoc, so for now the hook generator should do the work.

Closes #6
Closes #7

Steps to test:

If you want to just check how everything I said looks like, you can just a sample in: https://woocommerce.github.io/code-reference/v2/
But note that search the search uses links to https://woocommerce.github.io/code-reference/, so search results should redirect you to a different page.

Steps to build and test:

  1. Download: git clone https://github.com/woocommerce/code-reference.git --branch v2 --single-branch --depth 1
  2. Install dependencies: cd code-reference/ && composer install
  3. Run build with latest WooCommerce release: ./deploy.sh -s 4.5.2 --build-only. Make sure to use --build-only so you don't deploy this branch 😆
  4. Open the build/api/index.html in your browser: firefox build/api/index.html

Copy link

@ObliviousHarmony ObliviousHarmony left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It looks great @claudiosanches, great work!

I did get one error running the script that appears to break the class diagram, but everything else seems fine.

Is GraphViz correctly installed and present in your path?23:03:50 ERROR    [app] Generating the class diagram failed [“error” => “”" sh: /Users/obliviousharmony/Repositories/WooCommerce/Tools/code-reference/vendor/phpdocumentor/phpdocumentor/src/phpDocumentor/Transformer/Writer/Graph/../../../../../bin/plantuml: No such file or directory\n sh: line 0: exec: /Users/obliviousharmony/Repositories/WooCommerce/Tools/code-reference/vendor/phpdocumentor/phpdocumentor/src/phpDocumentor/Transformer/Writer/Graph/../../../../../bin/plantuml: cannot execute: No such file or directory\n “”"]
23:03:50 ERROR    [app] Generating the class diagram failed [“error” => “”" sh: /Users/obliviousharmony/Repositories/WooCommerce/Tools/code-reference/vendor/phpdocumentor/phpdocumentor/src/phpDocumentor/Transformer/Writer/Graph/../../../../../bin/plantuml: No such file or directory\n sh: line 0: exec: /Users/obliviousharmony/Repositories/WooCommerce/Tools/code-reference/vendor/phpdocumentor/phpdocumentor/src/phpDocumentor/Transformer/Writer/Graph/../../../../../bin/plantuml: cannot execute: No such file or directory\n “”"]

@claudiosanches
Copy link
Contributor Author

@ObliviousHarmony I disabled the class diagram, it's a environment dependency that can be installed from https://graphviz.org/download/ but it sounds too much for us now, maybe we can try it again after having GH actions to run the deploy.
Thanks for reviewing!

Copy link

@rrennick rrennick left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@claudiosanches This worked great for me.

@claudiosanches claudiosanches merged commit 0b37fb2 into master Sep 24, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Parser for WordPress hooks WooCommerce Code Reference
3 participants