├── .editorconfig ├── .github └── workflows │ └── deploy.yml ├── .gitignore ├── CHANGELOG.md ├── LICENSE ├── README.md ├── composer.json ├── composer.lock ├── data └── templates │ └── woocommerce │ ├── base.html.twig │ ├── class.html.twig │ ├── components │ ├── admonition.css.twig │ ├── analytics-tracking.html.twig │ ├── back-to-top.css.twig │ ├── back-to-top.html.twig │ ├── breadcrumbs.css.twig │ ├── breadcrumbs.html.twig │ ├── class-graph.css.twig │ ├── class-title.html.twig │ ├── constant-signature.html.twig │ ├── constant.html.twig │ ├── constants.html.twig │ ├── description.css.twig │ ├── description.html.twig │ ├── element-found-in.css.twig │ ├── element-found-in.html.twig │ ├── element-header.html.twig │ ├── element.css.twig │ ├── file-title.html.twig │ ├── footer.html.twig │ ├── function.html.twig │ ├── functions.html.twig │ ├── header.css.twig │ ├── header.html.twig │ ├── interface-title.html.twig │ ├── method-arguments.html.twig │ ├── method-response.html.twig │ ├── method-signature.html.twig │ ├── method.html.twig │ ├── methods.html.twig │ ├── namespace-title.html.twig │ ├── properties.html.twig │ ├── property-signature.html.twig │ ├── property.html.twig │ ├── search.html.twig │ ├── sidebar.css.twig │ ├── sidebar.html.twig │ ├── signature.css.twig │ ├── summary.css.twig │ ├── summary.html.twig │ ├── table-of-contents-entry.html.twig │ ├── table-of-contents.css.twig │ ├── table-of-contents.html.twig │ ├── tag-list.css.twig │ ├── tags.html.twig │ ├── topnav.css.twig │ ├── topnav.html.twig │ └── trait-title.html.twig │ ├── css │ ├── base.css.twig │ ├── custom.css.twig │ ├── normalize.css.twig │ ├── prism.css.twig │ ├── template.css.twig │ ├── utilities.css.twig │ └── variables.css.twig │ ├── file.html.twig │ ├── graphs │ └── class.html.twig │ ├── hooks │ └── hooks.html.twig │ ├── icons │ ├── constant.svg.twig │ ├── method.svg.twig │ ├── private.svg.twig │ ├── protected.svg.twig │ └── wp.svg.twig │ ├── images │ ├── favicon-180x180.png │ ├── favicon-192x192.png │ ├── favicon-32x32.png │ └── logo.png │ ├── index.html.twig │ ├── indices │ └── files.html.twig │ ├── interface.html.twig │ ├── js │ └── prism.js │ ├── layout.html.twig │ ├── menu.html.twig │ ├── namespace.html.twig │ ├── objects │ ├── blockquote.css.twig │ ├── buttons.css.twig │ ├── code.css.twig │ ├── forms.css.twig │ ├── grid.css.twig │ ├── headings.css.twig │ ├── images.css.twig │ ├── line.css.twig │ ├── links.css.twig │ ├── lists.css.twig │ ├── paragraph.css.twig │ ├── section.css.twig │ └── tables.css.twig │ ├── package.html.twig │ ├── reports │ ├── deprecated.html.twig │ ├── errors.html.twig │ └── markers.html.twig │ ├── search.js.twig │ ├── searchIndex.js.twig │ ├── template.xml │ └── trait.html.twig ├── deploy.sh ├── generate-hook-docs.php ├── phpcs.xml └── phpdoc.xml /.editorconfig: -------------------------------------------------------------------------------- 1 | # editorconfig.org 2 | root = true 3 | 4 | [*] 5 | indent_style = space 6 | indent_size = 4 7 | end_of_line = lf 8 | charset = utf-8 9 | trim_trailing_whitespace = true 10 | insert_final_newline = true 11 | -------------------------------------------------------------------------------- /.github/workflows/deploy.yml: -------------------------------------------------------------------------------- 1 | name: GitHub Pages deploy 2 | on: 3 | workflow_dispatch: 4 | inputs: 5 | version: 6 | description: 'WooCommerce Version' 7 | required: true 8 | jobs: 9 | build-and-deploy: 10 | name: Build and deploy 11 | runs-on: [ubuntu-latest] 12 | steps: 13 | - name: Checkout code 14 | uses: actions/checkout@v2 15 | - name: Setup PHP with composer v2 16 | uses: shivammathur/setup-php@v2 17 | with: 18 | php-version: '7.4' 19 | tools: composer:v2 20 | - name: Get composer cache directory 21 | id: composer-cache 22 | run: echo "::set-output name=dir::$(composer config cache-files-dir)" 23 | - name: Cache dependencies 24 | uses: actions/cache@v2 25 | with: 26 | path: ${{ steps.composer-cache.outputs.dir }} 27 | key: ${{ runner.os }}-composer-${{ hashFiles('**/composer.lock') }} 28 | restore-keys: ${{ runner.os }}-composer- 29 | - name: Install dependencies 30 | run: composer install --prefer-dist 31 | - name: Build 32 | run: | 33 | ./deploy.sh --build-only -s ${{ github.event.inputs.version }} 34 | - name: Deploy to GitHub Pages 35 | if: success() 36 | uses: crazy-max/ghaction-github-pages@v2 37 | env: 38 | GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} 39 | with: 40 | target_branch: gh-pages 41 | build_dir: build/api 42 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | *.zip 2 | build/ 3 | woocommerce/ 4 | vendor/ 5 | !data/templates/woocommerce/ 6 | -------------------------------------------------------------------------------- /CHANGELOG.md: -------------------------------------------------------------------------------- 1 | # Changelog 2 | All notable changes to this project will be documented in this file. 3 | 4 | The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), 5 | and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). 6 | 7 | ## [0.7.0] - 2021-03-25 8 | ### Added 9 | - Google Analytics tracking to layout. 10 | - Added GitHub workflow to automate deployments. 11 | ### Changed 12 | - Updated PHPDoc to `3.0.0`. 13 | 14 | ## [0.6.0] - 2020-09-24 15 | ### Added 16 | - New template with new stylings. 17 | - Code source support. 18 | - New search engine. 19 | - New hooks reference generator. 20 | - Added `--no-download` flat to `deploy.sh`. 21 | ### Changed 22 | - Updated PHPDoc to `dev-master`. 23 | 24 | ## [0.5.0] - 2020-08-18 25 | ### Added 26 | - Added script to build and deploy to `gh-pages` branch. 27 | ### Changed 28 | - Fixed line break of table `th` elements. 29 | - Use a full URL for search results. 30 | ### Removed 31 | - Removed old `generate.sh` file. 32 | 33 | ## [0.4.0] - 2020-08-05 34 | ### Added 35 | - Hooks Reference based on an old build. Needs automation. 36 | - Menu link to hooks reference. 37 | ### Changed 38 | - Moved reports links from menu to the sidebar. 39 | - CSS fixes. 40 | 41 | ## [0.3.0] - 2020-08-04 42 | ### Added 43 | - Added Class Diagram. 44 | ### Remove 45 | - Removed `.htaccess`. 46 | 47 | ## [0.2.0] - 2020-08-04 48 | ### Added 49 | - New `.htaccess` file to redirect broken links. 50 | 51 | ## [0.1.0] - 2020-08-03 52 | ### Added 53 | - PHPDoc 3.0 RC support. 54 | - New template 55 | ### Remove 56 | - APIGen support. 57 | 58 | ## [0.0.1] - 2019-06-25 59 | ### Added 60 | - Initial version. 61 | 62 | [Unreleased]: https://github.com/woocommerce/code-reference/compare/0.7.0...HEAD 63 | [0.7.0]: https://github.com/woocommerce/code-reference/compare/0.6.0...0.7.0 64 | [0.6.0]: https://github.com/woocommerce/code-reference/compare/0.5.0...0.6.0 65 | [0.5.0]: https://github.com/woocommerce/code-reference/compare/0.4.0...0.5.0 66 | [0.4.0]: https://github.com/woocommerce/code-reference/compare/0.3.0...0.4.0 67 | [0.3.0]: https://github.com/woocommerce/code-reference/compare/0.2.0...0.3.0 68 | [0.2.0]: https://github.com/woocommerce/code-reference/compare/0.1.0...0.2.0 69 | [0.1.0]: https://github.com/woocommerce/code-reference/compare/0.0.1...0.1.0 70 | [0.0.1]: https://github.com/woocommerce/code-reference/compare/749f431...0.0.1 71 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | GNU GENERAL PUBLIC LICENSE 2 | Version 3, 29 June 2007 3 | 4 | Copyright (C) 2007 Free Software Foundation, Inc. 5 | Everyone is permitted to copy and distribute verbatim copies 6 | of this license document, but changing it is not allowed. 7 | 8 | Preamble 9 | 10 | The GNU General Public License is a free, copyleft license for 11 | software and other kinds of works. 12 | 13 | The licenses for most software and other practical works are designed 14 | to take away your freedom to share and change the works. By contrast, 15 | the GNU General Public License is intended to guarantee your freedom to 16 | share and change all versions of a program--to make sure it remains free 17 | software for all its users. We, the Free Software Foundation, use the 18 | GNU General Public License for most of our software; it applies also to 19 | any other work released this way by its authors. You can apply it to 20 | your programs, too. 21 | 22 | When we speak of free software, we are referring to freedom, not 23 | price. Our General Public Licenses are designed to make sure that you 24 | have the freedom to distribute copies of free software (and charge for 25 | them if you wish), that you receive source code or can get it if you 26 | want it, that you can change the software or use pieces of it in new 27 | free programs, and that you know you can do these things. 28 | 29 | To protect your rights, we need to prevent others from denying you 30 | these rights or asking you to surrender the rights. Therefore, you have 31 | certain responsibilities if you distribute copies of the software, or if 32 | you modify it: responsibilities to respect the freedom of others. 33 | 34 | For example, if you distribute copies of such a program, whether 35 | gratis or for a fee, you must pass on to the recipients the same 36 | freedoms that you received. You must make sure that they, too, receive 37 | or can get the source code. And you must show them these terms so they 38 | know their rights. 39 | 40 | Developers that use the GNU GPL protect your rights with two steps: 41 | (1) assert copyright on the software, and (2) offer you this License 42 | giving you legal permission to copy, distribute and/or modify it. 43 | 44 | For the developers' and authors' protection, the GPL clearly explains 45 | that there is no warranty for this free software. For both users' and 46 | authors' sake, the GPL requires that modified versions be marked as 47 | changed, so that their problems will not be attributed erroneously to 48 | authors of previous versions. 49 | 50 | Some devices are designed to deny users access to install or run 51 | modified versions of the software inside them, although the manufacturer 52 | can do so. This is fundamentally incompatible with the aim of 53 | protecting users' freedom to change the software. The systematic 54 | pattern of such abuse occurs in the area of products for individuals to 55 | use, which is precisely where it is most unacceptable. Therefore, we 56 | have designed this version of the GPL to prohibit the practice for those 57 | products. If such problems arise substantially in other domains, we 58 | stand ready to extend this provision to those domains in future versions 59 | of the GPL, as needed to protect the freedom of users. 60 | 61 | Finally, every program is threatened constantly by software patents. 62 | States should not allow patents to restrict development and use of 63 | software on general-purpose computers, but in those that do, we wish to 64 | avoid the special danger that patents applied to a free program could 65 | make it effectively proprietary. To prevent this, the GPL assures that 66 | patents cannot be used to render the program non-free. 67 | 68 | The precise terms and conditions for copying, distribution and 69 | modification follow. 70 | 71 | TERMS AND CONDITIONS 72 | 73 | 0. Definitions. 74 | 75 | "This License" refers to version 3 of the GNU General Public License. 76 | 77 | "Copyright" also means copyright-like laws that apply to other kinds of 78 | works, such as semiconductor masks. 79 | 80 | "The Program" refers to any copyrightable work licensed under this 81 | License. Each licensee is addressed as "you". "Licensees" and 82 | "recipients" may be individuals or organizations. 83 | 84 | To "modify" a work means to copy from or adapt all or part of the work 85 | in a fashion requiring copyright permission, other than the making of an 86 | exact copy. The resulting work is called a "modified version" of the 87 | earlier work or a work "based on" the earlier work. 88 | 89 | A "covered work" means either the unmodified Program or a work based 90 | on the Program. 91 | 92 | To "propagate" a work means to do anything with it that, without 93 | permission, would make you directly or secondarily liable for 94 | infringement under applicable copyright law, except executing it on a 95 | computer or modifying a private copy. Propagation includes copying, 96 | distribution (with or without modification), making available to the 97 | public, and in some countries other activities as well. 98 | 99 | To "convey" a work means any kind of propagation that enables other 100 | parties to make or receive copies. Mere interaction with a user through 101 | a computer network, with no transfer of a copy, is not conveying. 102 | 103 | An interactive user interface displays "Appropriate Legal Notices" 104 | to the extent that it includes a convenient and prominently visible 105 | feature that (1) displays an appropriate copyright notice, and (2) 106 | tells the user that there is no warranty for the work (except to the 107 | extent that warranties are provided), that licensees may convey the 108 | work under this License, and how to view a copy of this License. If 109 | the interface presents a list of user commands or options, such as a 110 | menu, a prominent item in the list meets this criterion. 111 | 112 | 1. Source Code. 113 | 114 | The "source code" for a work means the preferred form of the work 115 | for making modifications to it. "Object code" means any non-source 116 | form of a work. 117 | 118 | A "Standard Interface" means an interface that either is an official 119 | standard defined by a recognized standards body, or, in the case of 120 | interfaces specified for a particular programming language, one that 121 | is widely used among developers working in that language. 122 | 123 | The "System Libraries" of an executable work include anything, other 124 | than the work as a whole, that (a) is included in the normal form of 125 | packaging a Major Component, but which is not part of that Major 126 | Component, and (b) serves only to enable use of the work with that 127 | Major Component, or to implement a Standard Interface for which an 128 | implementation is available to the public in source code form. A 129 | "Major Component", in this context, means a major essential component 130 | (kernel, window system, and so on) of the specific operating system 131 | (if any) on which the executable work runs, or a compiler used to 132 | produce the work, or an object code interpreter used to run it. 133 | 134 | The "Corresponding Source" for a work in object code form means all 135 | the source code needed to generate, install, and (for an executable 136 | work) run the object code and to modify the work, including scripts to 137 | control those activities. However, it does not include the work's 138 | System Libraries, or general-purpose tools or generally available free 139 | programs which are used unmodified in performing those activities but 140 | which are not part of the work. For example, Corresponding Source 141 | includes interface definition files associated with source files for 142 | the work, and the source code for shared libraries and dynamically 143 | linked subprograms that the work is specifically designed to require, 144 | such as by intimate data communication or control flow between those 145 | subprograms and other parts of the work. 146 | 147 | The Corresponding Source need not include anything that users 148 | can regenerate automatically from other parts of the Corresponding 149 | Source. 150 | 151 | The Corresponding Source for a work in source code form is that 152 | same work. 153 | 154 | 2. Basic Permissions. 155 | 156 | All rights granted under this License are granted for the term of 157 | copyright on the Program, and are irrevocable provided the stated 158 | conditions are met. This License explicitly affirms your unlimited 159 | permission to run the unmodified Program. The output from running a 160 | covered work is covered by this License only if the output, given its 161 | content, constitutes a covered work. This License acknowledges your 162 | rights of fair use or other equivalent, as provided by copyright law. 163 | 164 | You may make, run and propagate covered works that you do not 165 | convey, without conditions so long as your license otherwise remains 166 | in force. You may convey covered works to others for the sole purpose 167 | of having them make modifications exclusively for you, or provide you 168 | with facilities for running those works, provided that you comply with 169 | the terms of this License in conveying all material for which you do 170 | not control copyright. Those thus making or running the covered works 171 | for you must do so exclusively on your behalf, under your direction 172 | and control, on terms that prohibit them from making any copies of 173 | your copyrighted material outside their relationship with you. 174 | 175 | Conveying under any other circumstances is permitted solely under 176 | the conditions stated below. Sublicensing is not allowed; section 10 177 | makes it unnecessary. 178 | 179 | 3. Protecting Users' Legal Rights From Anti-Circumvention Law. 180 | 181 | No covered work shall be deemed part of an effective technological 182 | measure under any applicable law fulfilling obligations under article 183 | 11 of the WIPO copyright treaty adopted on 20 December 1996, or 184 | similar laws prohibiting or restricting circumvention of such 185 | measures. 186 | 187 | When you convey a covered work, you waive any legal power to forbid 188 | circumvention of technological measures to the extent such circumvention 189 | is effected by exercising rights under this License with respect to 190 | the covered work, and you disclaim any intention to limit operation or 191 | modification of the work as a means of enforcing, against the work's 192 | users, your or third parties' legal rights to forbid circumvention of 193 | technological measures. 194 | 195 | 4. Conveying Verbatim Copies. 196 | 197 | You may convey verbatim copies of the Program's source code as you 198 | receive it, in any medium, provided that you conspicuously and 199 | appropriately publish on each copy an appropriate copyright notice; 200 | keep intact all notices stating that this License and any 201 | non-permissive terms added in accord with section 7 apply to the code; 202 | keep intact all notices of the absence of any warranty; and give all 203 | recipients a copy of this License along with the Program. 204 | 205 | You may charge any price or no price for each copy that you convey, 206 | and you may offer support or warranty protection for a fee. 207 | 208 | 5. Conveying Modified Source Versions. 209 | 210 | You may convey a work based on the Program, or the modifications to 211 | produce it from the Program, in the form of source code under the 212 | terms of section 4, provided that you also meet all of these conditions: 213 | 214 | a) The work must carry prominent notices stating that you modified 215 | it, and giving a relevant date. 216 | 217 | b) The work must carry prominent notices stating that it is 218 | released under this License and any conditions added under section 219 | 7. This requirement modifies the requirement in section 4 to 220 | "keep intact all notices". 221 | 222 | c) You must license the entire work, as a whole, under this 223 | License to anyone who comes into possession of a copy. This 224 | License will therefore apply, along with any applicable section 7 225 | additional terms, to the whole of the work, and all its parts, 226 | regardless of how they are packaged. This License gives no 227 | permission to license the work in any other way, but it does not 228 | invalidate such permission if you have separately received it. 229 | 230 | d) If the work has interactive user interfaces, each must display 231 | Appropriate Legal Notices; however, if the Program has interactive 232 | interfaces that do not display Appropriate Legal Notices, your 233 | work need not make them do so. 234 | 235 | A compilation of a covered work with other separate and independent 236 | works, which are not by their nature extensions of the covered work, 237 | and which are not combined with it such as to form a larger program, 238 | in or on a volume of a storage or distribution medium, is called an 239 | "aggregate" if the compilation and its resulting copyright are not 240 | used to limit the access or legal rights of the compilation's users 241 | beyond what the individual works permit. Inclusion of a covered work 242 | in an aggregate does not cause this License to apply to the other 243 | parts of the aggregate. 244 | 245 | 6. Conveying Non-Source Forms. 246 | 247 | You may convey a covered work in object code form under the terms 248 | of sections 4 and 5, provided that you also convey the 249 | machine-readable Corresponding Source under the terms of this License, 250 | in one of these ways: 251 | 252 | a) Convey the object code in, or embodied in, a physical product 253 | (including a physical distribution medium), accompanied by the 254 | Corresponding Source fixed on a durable physical medium 255 | customarily used for software interchange. 256 | 257 | b) Convey the object code in, or embodied in, a physical product 258 | (including a physical distribution medium), accompanied by a 259 | written offer, valid for at least three years and valid for as 260 | long as you offer spare parts or customer support for that product 261 | model, to give anyone who possesses the object code either (1) a 262 | copy of the Corresponding Source for all the software in the 263 | product that is covered by this License, on a durable physical 264 | medium customarily used for software interchange, for a price no 265 | more than your reasonable cost of physically performing this 266 | conveying of source, or (2) access to copy the 267 | Corresponding Source from a network server at no charge. 268 | 269 | c) Convey individual copies of the object code with a copy of the 270 | written offer to provide the Corresponding Source. This 271 | alternative is allowed only occasionally and noncommercially, and 272 | only if you received the object code with such an offer, in accord 273 | with subsection 6b. 274 | 275 | d) Convey the object code by offering access from a designated 276 | place (gratis or for a charge), and offer equivalent access to the 277 | Corresponding Source in the same way through the same place at no 278 | further charge. You need not require recipients to copy the 279 | Corresponding Source along with the object code. If the place to 280 | copy the object code is a network server, the Corresponding Source 281 | may be on a different server (operated by you or a third party) 282 | that supports equivalent copying facilities, provided you maintain 283 | clear directions next to the object code saying where to find the 284 | Corresponding Source. Regardless of what server hosts the 285 | Corresponding Source, you remain obligated to ensure that it is 286 | available for as long as needed to satisfy these requirements. 287 | 288 | e) Convey the object code using peer-to-peer transmission, provided 289 | you inform other peers where the object code and Corresponding 290 | Source of the work are being offered to the general public at no 291 | charge under subsection 6d. 292 | 293 | A separable portion of the object code, whose source code is excluded 294 | from the Corresponding Source as a System Library, need not be 295 | included in conveying the object code work. 296 | 297 | A "User Product" is either (1) a "consumer product", which means any 298 | tangible personal property which is normally used for personal, family, 299 | or household purposes, or (2) anything designed or sold for incorporation 300 | into a dwelling. In determining whether a product is a consumer product, 301 | doubtful cases shall be resolved in favor of coverage. For a particular 302 | product received by a particular user, "normally used" refers to a 303 | typical or common use of that class of product, regardless of the status 304 | of the particular user or of the way in which the particular user 305 | actually uses, or expects or is expected to use, the product. A product 306 | is a consumer product regardless of whether the product has substantial 307 | commercial, industrial or non-consumer uses, unless such uses represent 308 | the only significant mode of use of the product. 309 | 310 | "Installation Information" for a User Product means any methods, 311 | procedures, authorization keys, or other information required to install 312 | and execute modified versions of a covered work in that User Product from 313 | a modified version of its Corresponding Source. The information must 314 | suffice to ensure that the continued functioning of the modified object 315 | code is in no case prevented or interfered with solely because 316 | modification has been made. 317 | 318 | If you convey an object code work under this section in, or with, or 319 | specifically for use in, a User Product, and the conveying occurs as 320 | part of a transaction in which the right of possession and use of the 321 | User Product is transferred to the recipient in perpetuity or for a 322 | fixed term (regardless of how the transaction is characterized), the 323 | Corresponding Source conveyed under this section must be accompanied 324 | by the Installation Information. But this requirement does not apply 325 | if neither you nor any third party retains the ability to install 326 | modified object code on the User Product (for example, the work has 327 | been installed in ROM). 328 | 329 | The requirement to provide Installation Information does not include a 330 | requirement to continue to provide support service, warranty, or updates 331 | for a work that has been modified or installed by the recipient, or for 332 | the User Product in which it has been modified or installed. Access to a 333 | network may be denied when the modification itself materially and 334 | adversely affects the operation of the network or violates the rules and 335 | protocols for communication across the network. 336 | 337 | Corresponding Source conveyed, and Installation Information provided, 338 | in accord with this section must be in a format that is publicly 339 | documented (and with an implementation available to the public in 340 | source code form), and must require no special password or key for 341 | unpacking, reading or copying. 342 | 343 | 7. Additional Terms. 344 | 345 | "Additional permissions" are terms that supplement the terms of this 346 | License by making exceptions from one or more of its conditions. 347 | Additional permissions that are applicable to the entire Program shall 348 | be treated as though they were included in this License, to the extent 349 | that they are valid under applicable law. If additional permissions 350 | apply only to part of the Program, that part may be used separately 351 | under those permissions, but the entire Program remains governed by 352 | this License without regard to the additional permissions. 353 | 354 | When you convey a copy of a covered work, you may at your option 355 | remove any additional permissions from that copy, or from any part of 356 | it. (Additional permissions may be written to require their own 357 | removal in certain cases when you modify the work.) You may place 358 | additional permissions on material, added by you to a covered work, 359 | for which you have or can give appropriate copyright permission. 360 | 361 | Notwithstanding any other provision of this License, for material you 362 | add to a covered work, you may (if authorized by the copyright holders of 363 | that material) supplement the terms of this License with terms: 364 | 365 | a) Disclaiming warranty or limiting liability differently from the 366 | terms of sections 15 and 16 of this License; or 367 | 368 | b) Requiring preservation of specified reasonable legal notices or 369 | author attributions in that material or in the Appropriate Legal 370 | Notices displayed by works containing it; or 371 | 372 | c) Prohibiting misrepresentation of the origin of that material, or 373 | requiring that modified versions of such material be marked in 374 | reasonable ways as different from the original version; or 375 | 376 | d) Limiting the use for publicity purposes of names of licensors or 377 | authors of the material; or 378 | 379 | e) Declining to grant rights under trademark law for use of some 380 | trade names, trademarks, or service marks; or 381 | 382 | f) Requiring indemnification of licensors and authors of that 383 | material by anyone who conveys the material (or modified versions of 384 | it) with contractual assumptions of liability to the recipient, for 385 | any liability that these contractual assumptions directly impose on 386 | those licensors and authors. 387 | 388 | All other non-permissive additional terms are considered "further 389 | restrictions" within the meaning of section 10. If the Program as you 390 | received it, or any part of it, contains a notice stating that it is 391 | governed by this License along with a term that is a further 392 | restriction, you may remove that term. If a license document contains 393 | a further restriction but permits relicensing or conveying under this 394 | License, you may add to a covered work material governed by the terms 395 | of that license document, provided that the further restriction does 396 | not survive such relicensing or conveying. 397 | 398 | If you add terms to a covered work in accord with this section, you 399 | must place, in the relevant source files, a statement of the 400 | additional terms that apply to those files, or a notice indicating 401 | where to find the applicable terms. 402 | 403 | Additional terms, permissive or non-permissive, may be stated in the 404 | form of a separately written license, or stated as exceptions; 405 | the above requirements apply either way. 406 | 407 | 8. Termination. 408 | 409 | You may not propagate or modify a covered work except as expressly 410 | provided under this License. Any attempt otherwise to propagate or 411 | modify it is void, and will automatically terminate your rights under 412 | this License (including any patent licenses granted under the third 413 | paragraph of section 11). 414 | 415 | However, if you cease all violation of this License, then your 416 | license from a particular copyright holder is reinstated (a) 417 | provisionally, unless and until the copyright holder explicitly and 418 | finally terminates your license, and (b) permanently, if the copyright 419 | holder fails to notify you of the violation by some reasonable means 420 | prior to 60 days after the cessation. 421 | 422 | Moreover, your license from a particular copyright holder is 423 | reinstated permanently if the copyright holder notifies you of the 424 | violation by some reasonable means, this is the first time you have 425 | received notice of violation of this License (for any work) from that 426 | copyright holder, and you cure the violation prior to 30 days after 427 | your receipt of the notice. 428 | 429 | Termination of your rights under this section does not terminate the 430 | licenses of parties who have received copies or rights from you under 431 | this License. If your rights have been terminated and not permanently 432 | reinstated, you do not qualify to receive new licenses for the same 433 | material under section 10. 434 | 435 | 9. Acceptance Not Required for Having Copies. 436 | 437 | You are not required to accept this License in order to receive or 438 | run a copy of the Program. Ancillary propagation of a covered work 439 | occurring solely as a consequence of using peer-to-peer transmission 440 | to receive a copy likewise does not require acceptance. However, 441 | nothing other than this License grants you permission to propagate or 442 | modify any covered work. These actions infringe copyright if you do 443 | not accept this License. Therefore, by modifying or propagating a 444 | covered work, you indicate your acceptance of this License to do so. 445 | 446 | 10. Automatic Licensing of Downstream Recipients. 447 | 448 | Each time you convey a covered work, the recipient automatically 449 | receives a license from the original licensors, to run, modify and 450 | propagate that work, subject to this License. You are not responsible 451 | for enforcing compliance by third parties with this License. 452 | 453 | An "entity transaction" is a transaction transferring control of an 454 | organization, or substantially all assets of one, or subdividing an 455 | organization, or merging organizations. If propagation of a covered 456 | work results from an entity transaction, each party to that 457 | transaction who receives a copy of the work also receives whatever 458 | licenses to the work the party's predecessor in interest had or could 459 | give under the previous paragraph, plus a right to possession of the 460 | Corresponding Source of the work from the predecessor in interest, if 461 | the predecessor has it or can get it with reasonable efforts. 462 | 463 | You may not impose any further restrictions on the exercise of the 464 | rights granted or affirmed under this License. For example, you may 465 | not impose a license fee, royalty, or other charge for exercise of 466 | rights granted under this License, and you may not initiate litigation 467 | (including a cross-claim or counterclaim in a lawsuit) alleging that 468 | any patent claim is infringed by making, using, selling, offering for 469 | sale, or importing the Program or any portion of it. 470 | 471 | 11. Patents. 472 | 473 | A "contributor" is a copyright holder who authorizes use under this 474 | License of the Program or a work on which the Program is based. The 475 | work thus licensed is called the contributor's "contributor version". 476 | 477 | A contributor's "essential patent claims" are all patent claims 478 | owned or controlled by the contributor, whether already acquired or 479 | hereafter acquired, that would be infringed by some manner, permitted 480 | by this License, of making, using, or selling its contributor version, 481 | but do not include claims that would be infringed only as a 482 | consequence of further modification of the contributor version. For 483 | purposes of this definition, "control" includes the right to grant 484 | patent sublicenses in a manner consistent with the requirements of 485 | this License. 486 | 487 | Each contributor grants you a non-exclusive, worldwide, royalty-free 488 | patent license under the contributor's essential patent claims, to 489 | make, use, sell, offer for sale, import and otherwise run, modify and 490 | propagate the contents of its contributor version. 491 | 492 | In the following three paragraphs, a "patent license" is any express 493 | agreement or commitment, however denominated, not to enforce a patent 494 | (such as an express permission to practice a patent or covenant not to 495 | sue for patent infringement). To "grant" such a patent license to a 496 | party means to make such an agreement or commitment not to enforce a 497 | patent against the party. 498 | 499 | If you convey a covered work, knowingly relying on a patent license, 500 | and the Corresponding Source of the work is not available for anyone 501 | to copy, free of charge and under the terms of this License, through a 502 | publicly available network server or other readily accessible means, 503 | then you must either (1) cause the Corresponding Source to be so 504 | available, or (2) arrange to deprive yourself of the benefit of the 505 | patent license for this particular work, or (3) arrange, in a manner 506 | consistent with the requirements of this License, to extend the patent 507 | license to downstream recipients. "Knowingly relying" means you have 508 | actual knowledge that, but for the patent license, your conveying the 509 | covered work in a country, or your recipient's use of the covered work 510 | in a country, would infringe one or more identifiable patents in that 511 | country that you have reason to believe are valid. 512 | 513 | If, pursuant to or in connection with a single transaction or 514 | arrangement, you convey, or propagate by procuring conveyance of, a 515 | covered work, and grant a patent license to some of the parties 516 | receiving the covered work authorizing them to use, propagate, modify 517 | or convey a specific copy of the covered work, then the patent license 518 | you grant is automatically extended to all recipients of the covered 519 | work and works based on it. 520 | 521 | A patent license is "discriminatory" if it does not include within 522 | the scope of its coverage, prohibits the exercise of, or is 523 | conditioned on the non-exercise of one or more of the rights that are 524 | specifically granted under this License. You may not convey a covered 525 | work if you are a party to an arrangement with a third party that is 526 | in the business of distributing software, under which you make payment 527 | to the third party based on the extent of your activity of conveying 528 | the work, and under which the third party grants, to any of the 529 | parties who would receive the covered work from you, a discriminatory 530 | patent license (a) in connection with copies of the covered work 531 | conveyed by you (or copies made from those copies), or (b) primarily 532 | for and in connection with specific products or compilations that 533 | contain the covered work, unless you entered into that arrangement, 534 | or that patent license was granted, prior to 28 March 2007. 535 | 536 | Nothing in this License shall be construed as excluding or limiting 537 | any implied license or other defenses to infringement that may 538 | otherwise be available to you under applicable patent law. 539 | 540 | 12. No Surrender of Others' Freedom. 541 | 542 | If conditions are imposed on you (whether by court order, agreement or 543 | otherwise) that contradict the conditions of this License, they do not 544 | excuse you from the conditions of this License. If you cannot convey a 545 | covered work so as to satisfy simultaneously your obligations under this 546 | License and any other pertinent obligations, then as a consequence you may 547 | not convey it at all. For example, if you agree to terms that obligate you 548 | to collect a royalty for further conveying from those to whom you convey 549 | the Program, the only way you could satisfy both those terms and this 550 | License would be to refrain entirely from conveying the Program. 551 | 552 | 13. Use with the GNU Affero General Public License. 553 | 554 | Notwithstanding any other provision of this License, you have 555 | permission to link or combine any covered work with a work licensed 556 | under version 3 of the GNU Affero General Public License into a single 557 | combined work, and to convey the resulting work. The terms of this 558 | License will continue to apply to the part which is the covered work, 559 | but the special requirements of the GNU Affero General Public License, 560 | section 13, concerning interaction through a network will apply to the 561 | combination as such. 562 | 563 | 14. Revised Versions of this License. 564 | 565 | The Free Software Foundation may publish revised and/or new versions of 566 | the GNU General Public License from time to time. Such new versions will 567 | be similar in spirit to the present version, but may differ in detail to 568 | address new problems or concerns. 569 | 570 | Each version is given a distinguishing version number. If the 571 | Program specifies that a certain numbered version of the GNU General 572 | Public License "or any later version" applies to it, you have the 573 | option of following the terms and conditions either of that numbered 574 | version or of any later version published by the Free Software 575 | Foundation. If the Program does not specify a version number of the 576 | GNU General Public License, you may choose any version ever published 577 | by the Free Software Foundation. 578 | 579 | If the Program specifies that a proxy can decide which future 580 | versions of the GNU General Public License can be used, that proxy's 581 | public statement of acceptance of a version permanently authorizes you 582 | to choose that version for the Program. 583 | 584 | Later license versions may give you additional or different 585 | permissions. However, no additional obligations are imposed on any 586 | author or copyright holder as a result of your choosing to follow a 587 | later version. 588 | 589 | 15. Disclaimer of Warranty. 590 | 591 | THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY 592 | APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT 593 | HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY 594 | OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, 595 | THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR 596 | PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM 597 | IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF 598 | ALL NECESSARY SERVICING, REPAIR OR CORRECTION. 599 | 600 | 16. Limitation of Liability. 601 | 602 | IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING 603 | WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS 604 | THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY 605 | GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE 606 | USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF 607 | DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD 608 | PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS), 609 | EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF 610 | SUCH DAMAGES. 611 | 612 | 17. Interpretation of Sections 15 and 16. 613 | 614 | If the disclaimer of warranty and limitation of liability provided 615 | above cannot be given local legal effect according to their terms, 616 | reviewing courts shall apply local law that most closely approximates 617 | an absolute waiver of all civil liability in connection with the 618 | Program, unless a warranty or assumption of liability accompanies a 619 | copy of the Program in return for a fee. 620 | 621 | END OF TERMS AND CONDITIONS 622 | 623 | How to Apply These Terms to Your New Programs 624 | 625 | If you develop a new program, and you want it to be of the greatest 626 | possible use to the public, the best way to achieve this is to make it 627 | free software which everyone can redistribute and change under these terms. 628 | 629 | To do so, attach the following notices to the program. It is safest 630 | to attach them to the start of each source file to most effectively 631 | state the exclusion of warranty; and each file should have at least 632 | the "copyright" line and a pointer to where the full notice is found. 633 | 634 | 635 | Copyright (C) 636 | 637 | This program is free software: you can redistribute it and/or modify 638 | it under the terms of the GNU General Public License as published by 639 | the Free Software Foundation, either version 3 of the License, or 640 | (at your option) any later version. 641 | 642 | This program is distributed in the hope that it will be useful, 643 | but WITHOUT ANY WARRANTY; without even the implied warranty of 644 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 645 | GNU General Public License for more details. 646 | 647 | You should have received a copy of the GNU General Public License 648 | along with this program. If not, see . 649 | 650 | Also add information on how to contact you by electronic and paper mail. 651 | 652 | If the program does terminal interaction, make it output a short 653 | notice like this when it starts in an interactive mode: 654 | 655 | Copyright (C) 656 | This program comes with ABSOLUTELY NO WARRANTY; for details type `show w'. 657 | This is free software, and you are welcome to redistribute it 658 | under certain conditions; type `show c' for details. 659 | 660 | The hypothetical commands `show w' and `show c' should show the appropriate 661 | parts of the General Public License. Of course, your program's commands 662 | might be different; for a GUI interface, you would use an "about box". 663 | 664 | You should also get your employer (if you work as a programmer) or school, 665 | if any, to sign a "copyright disclaimer" for the program, if necessary. 666 | For more information on this, and how to apply and follow the GNU GPL, see 667 | . 668 | 669 | The GNU General Public License does not permit incorporating your program 670 | into proprietary programs. If your program is a subroutine library, you 671 | may consider it more useful to permit linking proprietary applications with 672 | the library. If this is what you want to do, use the GNU Lesser General 673 | Public License instead of this License. But first, please read 674 | . 675 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # WooCommerce Code Reference Generator 2 | 3 | Generate [WooCommerce Code Reference](https://woocommerce.github.io/code-reference/). 4 | 5 | ## Install 6 | 7 | ```bash 8 | git clone https://github.com/woocommerce/code-reference.git 9 | ``` 10 | 11 | ## Usage 12 | 13 | ```bash 14 | cd code-reference 15 | ./deploy.sh -s 16 | ``` 17 | 18 | ### Options 19 | 20 | | Options | Description | 21 | | --------------------------------------------------- | --------------------------------------------------------------------- | 22 | | `-h` or `--help` | Show help information. | 23 | | `-v` or `--verbose` | Increase verbosity. Useful for debugging. | 24 | | `-s ` or `--source-version ` | Source version to build and deploy. | 25 | | `-r ` or `--github-repo ` | GitHub repo with username, default to \"woocommerce/woocommerce\". | 26 | | `-e` or `--allow-empty` | Allow deployment of an empty directory. | 27 | | `-m ` or `--message ` | Specify the message used when committing on the deploy branch. | 28 | | `-n` or `--no-hash` | Don't append the source commit's hash to the deploy commit's message. | 29 | | `--build-only` | Only build but not push. | 30 | | `--push-only` | Only push but not build. | 31 | | `--no-download` | Skip zip download in case there's on in the project's root. | 32 | 33 | ## Changelog 34 | 35 | [See changelog for details](https://github.com/woocommerce/code-reference/blob/master/CHANGELOG.md) 36 | -------------------------------------------------------------------------------- /composer.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "woocommerce/code-reference", 3 | "description": "WooCommerce Code Reference Generator", 4 | "homepage": "https://woocommerce.com/", 5 | "type": "project", 6 | "license": "GPL-3.0-or-later", 7 | "prefer-stable": true, 8 | "require": { 9 | "php": ">=7.2.5" 10 | }, 11 | "require-dev": { 12 | "phpdocumentor/phpdocumentor": "3.0.0" 13 | }, 14 | "config": { 15 | "allow-plugins": { 16 | "symfony/flex": true 17 | } 18 | } 19 | } 20 | -------------------------------------------------------------------------------- /data/templates/woocommerce/base.html.twig: -------------------------------------------------------------------------------- 1 | {% extends 'layout.html.twig' %} 2 | -------------------------------------------------------------------------------- /data/templates/woocommerce/class.html.twig: -------------------------------------------------------------------------------- 1 | {% extends 'base.html.twig' %} 2 | 3 | {% block javascripts %} 4 | 5 | 10 | {% endblock %} 11 | 12 | {% block content %} 13 | {% include 'components/breadcrumbs.html.twig' %} 14 | 15 |
16 | {{ include('components/class-title.html.twig') }} 17 | {{ include('components/element-found-in.html.twig') }} 18 | {{ include('components/element-header.html.twig') }} 19 | 20 | {{ include('components/constants.html.twig') }} 21 | {{ include('components/properties.html.twig') }} 22 | {{ include('components/methods.html.twig') }} 23 |
24 | {% endblock %} 25 | -------------------------------------------------------------------------------- /data/templates/woocommerce/components/admonition.css.twig: -------------------------------------------------------------------------------- 1 | .phpdocumentor-admonition { 2 | border: 1px solid var(--admonition-border-color); 3 | border-radius: var(--border-radius-base-size); 4 | padding: var(--spacing-sm) var(--spacing-md); 5 | } 6 | 7 | .phpdocumentor-admonition--success { 8 | border-color: var(--admonition-success-color); 9 | } 10 | -------------------------------------------------------------------------------- /data/templates/woocommerce/components/analytics-tracking.html.twig: -------------------------------------------------------------------------------- 1 | 2 | 3 | 12 | -------------------------------------------------------------------------------- /data/templates/woocommerce/components/back-to-top.css.twig: -------------------------------------------------------------------------------- 1 | .phpdocumentor .phpdocumentor-back-to-top { 2 | position: fixed; 3 | bottom: 2rem; 4 | font-size: 2.5rem; 5 | opacity: 1.0; 6 | transition: all .3s ease-in-out; 7 | right: 2rem; 8 | color: var(--primary-color-lighten); 9 | } 10 | 11 | .phpdocumentor .phpdocumentor-back-to-top:hover { 12 | color: var(--primary-color-darken); 13 | opacity: 1.0; 14 | } 15 | -------------------------------------------------------------------------------- /data/templates/woocommerce/components/back-to-top.html.twig: -------------------------------------------------------------------------------- 1 | 2 | -------------------------------------------------------------------------------- /data/templates/woocommerce/components/breadcrumbs.css.twig: -------------------------------------------------------------------------------- 1 | .phpdocumentor ul.phpdocumentor-breadcrumbs { 2 | font-size: var(--text-md); 3 | list-style: none; 4 | margin: 0; 5 | padding: 0; 6 | } 7 | 8 | .phpdocumentor ul.phpdocumentor-breadcrumbs a { 9 | color: var(--text-color); 10 | text-decoration: none; 11 | } 12 | 13 | .phpdocumentor ul.phpdocumentor-breadcrumbs > li { 14 | display: inline-block; 15 | margin: 0; 16 | } 17 | 18 | .phpdocumentor ul.phpdocumentor-breadcrumbs > li + li:before { 19 | color: var(--dark-gray); 20 | content: "\\\A0"; 21 | padding: 0; 22 | } 23 | -------------------------------------------------------------------------------- /data/templates/woocommerce/components/breadcrumbs.html.twig: -------------------------------------------------------------------------------- 1 | {% set breadcrumbs = usesNamespaces ? breadcrumbs(node) : packages(node) %} 2 | 7 | -------------------------------------------------------------------------------- /data/templates/woocommerce/components/class-graph.css.twig: -------------------------------------------------------------------------------- 1 | .phpdocumentor-class-graph { 2 | width: 100%; height: 600px; border:1px solid black; overflow: hidden 3 | } 4 | 5 | .phpdocumentor-class-graph__graph { 6 | width: 100%; 7 | } 8 | -------------------------------------------------------------------------------- /data/templates/woocommerce/components/class-title.html.twig: -------------------------------------------------------------------------------- 1 |

2 | {{ node.name }} 3 | 4 | {% if node.parent %} 5 | 6 | extends {{ node.parent|route('class:short') }} 7 | 8 | {% endif %} 9 | 10 | {% if usesPackages %} 11 |
12 | in package 13 | 18 |
19 | {% endif %} 20 | 21 | {% if node.interfaces is not empty %} 22 | 23 | implements 24 | {% for interface in node.interfaces %} 25 | {{ interface|route('class:short') }}{% if not loop.last %}, {% endif %} 26 | {% endfor %} 27 | 28 | {% endif %} 29 | 30 | {% if node.usedTraits is not empty %} 31 | 32 | Uses 33 | {% for trait in node.usedTraits %} 34 | {{ trait|route('class:short') }}{% if not loop.last %}, {% endif %} 35 | {% endfor %} 36 | 37 | {% endif %} 38 |

39 | -------------------------------------------------------------------------------- /data/templates/woocommerce/components/constant-signature.html.twig: -------------------------------------------------------------------------------- 1 | 2 | {{ node.visibility }} 3 | {{ not node.type ? "mixed" : node.type|route('class:short')|join('|')|raw }} 4 | {{ node.name }} 5 | = {{ node.value ?: '""' }} 6 | 7 | -------------------------------------------------------------------------------- /data/templates/woocommerce/components/constant.html.twig: -------------------------------------------------------------------------------- 1 |
2 |

3 | {{ constant.name }} 4 | 5 |

6 | 7 | {{ include('components/element-found-in.html.twig', {'node': constant}) }} 8 | {{ include('components/summary.html.twig', {'node': constant}) }} 9 | {{ include('components/constant-signature.html.twig', {'node': constant}) }} 10 | 11 | {{ include('components/description.html.twig', {'node': constant}) }} 12 | {{ include ('components/tags.html.twig', {tags: constant.tags}) }} 13 |
14 | -------------------------------------------------------------------------------- /data/templates/woocommerce/components/constants.html.twig: -------------------------------------------------------------------------------- 1 | {% set constants = constants(node)|sortByVisibility %} 2 | 3 | {% if constants is not empty %} 4 |
5 |

6 | Constants 7 | 8 |

9 | {% for constant in constants %} 10 | {% include 'components/constant.html.twig' %} 11 | {% endfor %} 12 |
13 | {% endif %} 14 | -------------------------------------------------------------------------------- /data/templates/woocommerce/components/description.css.twig: -------------------------------------------------------------------------------- 1 | .phpdocumentor-description { 2 | margin-bottom: var(--spacing-md); 3 | } 4 | -------------------------------------------------------------------------------- /data/templates/woocommerce/components/description.html.twig: -------------------------------------------------------------------------------- 1 | {% if node.description %} 2 |
{{ node.description|markdown }}
3 | {% endif %} 4 | -------------------------------------------------------------------------------- /data/templates/woocommerce/components/element-found-in.css.twig: -------------------------------------------------------------------------------- 1 | .phpdocumentor-element-found-in { 2 | position: absolute; 3 | top: 0; 4 | right: 0; 5 | font-size: var(--text-sm); 6 | color: gray; 7 | } 8 | -------------------------------------------------------------------------------- /data/templates/woocommerce/components/element-found-in.html.twig: -------------------------------------------------------------------------------- 1 | 6 | -------------------------------------------------------------------------------- /data/templates/woocommerce/components/element-header.html.twig: -------------------------------------------------------------------------------- 1 | {{ include('components/summary.html.twig') }} 2 | {{ include('components/description.html.twig') }} 3 | {{ include('components/tags.html.twig', {tags: node.tags}) }} 4 | 5 | {{ include ('components/table-of-contents.html.twig') }} 6 | -------------------------------------------------------------------------------- /data/templates/woocommerce/components/element.css.twig: -------------------------------------------------------------------------------- 1 | .phpdocumentor-element { 2 | position: relative; 3 | } 4 | 5 | .phpdocumentor .phpdocumentor-element__name { 6 | line-height: 1; 7 | } 8 | 9 | .phpdocumentor-element__package, 10 | .phpdocumentor-element__extends, 11 | .phpdocumentor-element__implements { 12 | display: block; 13 | font-size: var(--text-xxs); 14 | font-weight: normal; 15 | opacity: .7; 16 | } 17 | 18 | .phpdocumentor-element__package .phpdocumentor-breadcrumbs { 19 | display: inline; 20 | } 21 | 22 | .phpdocumentor-element:not(:last-child) { 23 | border-bottom: 1px solid var(--primary-color-lighten); 24 | padding-bottom: var(--spacing-lg); 25 | } 26 | 27 | .phpdocumentor-element.-deprecated .phpdocumentor-element__name { 28 | text-decoration: line-through; 29 | } 30 | 31 | .phpdocumentor-element__modifier { 32 | font-size: var(--text-xxs); 33 | padding: calc(var(--spacing-base-size) / 4) calc(var(--spacing-base-size) / 2); 34 | color: var(--text-color); 35 | background-color: var(--light-gray); 36 | border-radius: 3px; 37 | text-transform: uppercase; 38 | } 39 | -------------------------------------------------------------------------------- /data/templates/woocommerce/components/file-title.html.twig: -------------------------------------------------------------------------------- 1 |

{{ node.name }}

2 | -------------------------------------------------------------------------------- /data/templates/woocommerce/components/footer.html.twig: -------------------------------------------------------------------------------- 1 |
2 |
3 | WooCommerce Code Reference API documentation generated by phpDocumentor on {{ "now"|date('F jS, Y \\a\\t h:i a') }}. 4 |
5 |
6 | -------------------------------------------------------------------------------- /data/templates/woocommerce/components/function.html.twig: -------------------------------------------------------------------------------- 1 |
2 |

3 | {{ function.name }}() 4 | 5 |

6 | {{ include('components/element-found-in.html.twig', {'node': function}) }} 7 | {{ include('components/summary.html.twig', {'node': function}) }} 8 | {{ include('components/method-signature.html.twig', {'node': function}) }} 9 | {{ include('components/description.html.twig', {'node': function}) }} 10 | {{ include('components/method-arguments.html.twig', {'node': function}) }} 11 | {{ include('components/tags.html.twig', {tags: function.tags}) }} 12 | {{ include('components/method-response.html.twig', {'node': function}) }} 13 |
14 | -------------------------------------------------------------------------------- /data/templates/woocommerce/components/functions.html.twig: -------------------------------------------------------------------------------- 1 | {% if node.functions is not empty %} 2 |
3 |

4 | Functions 5 | 6 |

7 | {% for function in node.functions %} 8 | {% include 'components/function.html.twig' %} 9 | {% endfor %} 10 |
11 | {% endif %} 12 | -------------------------------------------------------------------------------- /data/templates/woocommerce/components/header.css.twig: -------------------------------------------------------------------------------- 1 | .phpdocumentor-header { 2 | display: flex; 3 | flex-direction: row; 4 | align-items: center; 5 | } 6 | 7 | .phpdocumentor-header > * { 8 | height: var(--header-height); 9 | } 10 | -------------------------------------------------------------------------------- /data/templates/woocommerce/components/header.html.twig: -------------------------------------------------------------------------------- 1 |
2 |
3 |
4 | 5 |
6 | 13 |
14 |
15 | 16 |
17 |
18 |

{{ project.name }}

19 | {{ include('components/search.html.twig') }} 20 |
21 |
22 | -------------------------------------------------------------------------------- /data/templates/woocommerce/components/interface-title.html.twig: -------------------------------------------------------------------------------- 1 |

2 | {{ node.name }} 3 | {% if node.parent is not empty %} 4 | 5 | extends 6 | {% for interface in node.parent %} 7 | {{ interface|route('class:short') }}{% if not loop.last %}, {% endif %} 8 | {% endfor %} 9 | 10 | {% endif %} 11 | {% if usesPackages %} 12 |
13 | in 14 | 19 |
20 | {% endif %} 21 |

22 | -------------------------------------------------------------------------------- /data/templates/woocommerce/components/method-arguments.html.twig: -------------------------------------------------------------------------------- 1 | {% if node.arguments|length > 0 %} 2 |
Parameters
3 |
4 | {% for argument in node.arguments %} 5 |
6 | ${{ argument.name }} 7 | : {{ argument.type|route('class:short')|join('|')|raw }} 8 | {% if argument.default %} = {{ argument.default }}{% endif %} 9 |
10 |
11 | {{ include('components/description.html.twig', {'node': argument}) }} 12 |
13 | {% endfor %} 14 |
15 | {% endif %} 16 | -------------------------------------------------------------------------------- /data/templates/woocommerce/components/method-response.html.twig: -------------------------------------------------------------------------------- 1 | {% if (method.response.type and method.response.type != 'void') or method.response.description %} 2 |
Return values
3 | {{ method.response.type|route('class:short')|join('|')|raw }} 4 | {% if method.response.description %} 5 | — {{ method.response.description|striptags }} 6 | {% endif %} 7 | {% endif %} 8 | -------------------------------------------------------------------------------- /data/templates/woocommerce/components/method-signature.html.twig: -------------------------------------------------------------------------------- 1 | 2 | {{ node.visibility }} 3 | {% if node.abstract %}abstract{% endif %} 4 | {% if node.final %}final{% endif %} 5 | {% if node.static %}static{% endif %} 6 | {% apply spaceless %} 7 | {{ node.name }} 8 | ( 9 | {% for argument in node.arguments %} 10 | 11 | {% if argument.default %}[{% endif %} 12 | {% if not loop.first %}, {% endif %} 13 | {{ argument.type|route('class:short')|join('|')|raw }}  14 | {% if argument.isVariadic %}...{% endif %} 15 | {%- if argument.byReference -%}&{%- endif -%} 16 | ${{ argument.name }} 17 | {% if argument.default %} 18 | = 19 | {{ argument.default }} 20 | ] 21 | {% endif %} 22 | 23 | {% endfor %} 24 | ) 25 | : 26 | {{ node.response.type|route('class:short')|join('|')|raw }} 27 | {% endapply %} 28 | 29 | -------------------------------------------------------------------------------- /data/templates/woocommerce/components/method.html.twig: -------------------------------------------------------------------------------- 1 |
11 |

12 | {{ method.name }}() 13 | 14 |

15 | {{ include('components/element-found-in.html.twig', {'node': method}) }} 16 | {{ include('components/summary.html.twig', {'node': method}) }} 17 | {{ include('components/method-signature.html.twig', {'node': method}) }} 18 | {{ include('components/description.html.twig', {'node': method}) }} 19 | {{ include('components/method-arguments.html.twig', {'node': method}) }} 20 | {{ include('components/tags.html.twig', {'tags': method.tags}) }} 21 | {{ include('components/method-response.html.twig', {'node': method}) }} 22 |
23 | -------------------------------------------------------------------------------- /data/templates/woocommerce/components/methods.html.twig: -------------------------------------------------------------------------------- 1 | {% set methods = methods(node)|sortByVisibility %} 2 | {% if methods is not empty %} 3 |
4 |

5 | Methods 6 | 7 |

8 | {% for method in methods %} 9 | {% include 'components/method.html.twig' %} 10 | {% endfor %} 11 |
12 | {% endif %} 13 | -------------------------------------------------------------------------------- /data/templates/woocommerce/components/namespace-title.html.twig: -------------------------------------------------------------------------------- 1 |

{{ node.name == '\\' ? 'API Documentation' : node.name }}

2 | -------------------------------------------------------------------------------- /data/templates/woocommerce/components/properties.html.twig: -------------------------------------------------------------------------------- 1 | {% set properties = properties(node)|sortByVisibility %} 2 | 3 | {% if properties is not empty %} 4 |
5 |

6 | Properties 7 | 8 |

9 | {% for property in properties %} 10 | {% include 'components/property.html.twig' %} 11 | {% endfor %} 12 |
13 | {% endif %} 14 | -------------------------------------------------------------------------------- /data/templates/woocommerce/components/property-signature.html.twig: -------------------------------------------------------------------------------- 1 | 2 | {{ node.visibility }} 3 | {% if node.static %}static{% endif %} 4 | {{ not node.type ? "mixed" : node.type|route('class:short')|join('|')|raw }} 5 | ${{ node.name }} 6 | {% if node.default is not null %} = {{ node.default is not null ? node.default : '""' }}{% endif %} 7 | 8 | -------------------------------------------------------------------------------- /data/templates/woocommerce/components/property.html.twig: -------------------------------------------------------------------------------- 1 |
12 |

13 | ${{ property.name }} 14 | 15 | 16 | {% if property.writeOnly %}write-only{% endif %} 17 | {% if property.readOnly %}read-only{% endif %} 18 | 19 |

20 | {{ include('components/element-found-in.html.twig', {'node': property}) }} 21 | {{ include('components/summary.html.twig', {'node': property}) }} 22 | {{ include('components/property-signature.html.twig', {'node': property}) }} 23 | {{ include('components/description.html.twig', {'node': property}) }} 24 | {{ include ('components/tags.html.twig', {tags: property.tags}) }} 25 |
26 | -------------------------------------------------------------------------------- /data/templates/woocommerce/components/search.html.twig: -------------------------------------------------------------------------------- 1 | 7 | -------------------------------------------------------------------------------- /data/templates/woocommerce/components/sidebar.css.twig: -------------------------------------------------------------------------------- 1 | .phpdocumentor-sidebar { 2 | border-right: var(--sidebar-border-color) solid 1px; 3 | } 4 | 5 | .phpdocumentor .phpdocumentor-sidebar .phpdocumentor-list { 6 | padding-top: var(--spacing-xs); 7 | padding-left: var(--spacing-md); 8 | list-style: none; 9 | } 10 | 11 | .phpdocumentor .phpdocumentor-sidebar li { 12 | white-space: nowrap; 13 | text-overflow: ellipsis; 14 | overflow: hidden; 15 | padding: 0 0 var(--spacing-xxxs) var(--spacing-md); 16 | } 17 | 18 | .phpdocumentor .phpdocumentor-sidebar abbr, 19 | .phpdocumentor .phpdocumentor-sidebar a { 20 | text-decoration: none; 21 | border-bottom: none; 22 | color: var(--text-color); 23 | font-size: var(--text-md); 24 | padding-left: 0; 25 | transition: padding-left .4s ease-out; 26 | } 27 | 28 | .phpdocumentor .phpdocumentor-sidebar a:hover { 29 | font-weight: 600; 30 | } 31 | 32 | .phpdocumentor .phpdocumentor-sidebar__category > * { 33 | border-left: 1px solid var(--primary-color-lighten); 34 | } 35 | 36 | .phpdocumentor .phpdocumentor-sidebar__category { 37 | margin-bottom: var(--spacing-lg); 38 | } 39 | 40 | .phpdocumentor .phpdocumentor-sidebar__category-header { 41 | font-size: var(--text-md); 42 | margin-bottom: var(--spacing-xs); 43 | color: var(--link-color-primary); 44 | font-weight: 700; 45 | border-left: 0; 46 | text-transform: uppercase; 47 | } 48 | 49 | .phpdocumentor .phpdocumentor-sidebar__root-package, 50 | .phpdocumentor .phpdocumentor-sidebar__root-namespace { 51 | font-size: var(--text-md); 52 | margin: 0; 53 | padding-top: var(--spacing-xs); 54 | padding-left: var(--spacing-md); 55 | color: var(--text-color); 56 | font-weight: normal; 57 | } 58 | -------------------------------------------------------------------------------- /data/templates/woocommerce/components/sidebar.html.twig: -------------------------------------------------------------------------------- 1 | 57 | -------------------------------------------------------------------------------- /data/templates/woocommerce/components/signature.css.twig: -------------------------------------------------------------------------------- 1 | .phpdocumentor-signature { 2 | display: inline-block; 3 | font-size: var(--text-sm); 4 | margin-bottom: var(--spacing-md); 5 | } 6 | 7 | .phpdocumentor-signature.-deprecated .phpdocumentor-signature__name { 8 | text-decoration: line-through; 9 | } 10 | -------------------------------------------------------------------------------- /data/templates/woocommerce/components/summary.css.twig: -------------------------------------------------------------------------------- 1 | .phpdocumentor-summary { 2 | font-style: italic; 3 | } 4 | -------------------------------------------------------------------------------- /data/templates/woocommerce/components/summary.html.twig: -------------------------------------------------------------------------------- 1 | {% if node.summary %} 2 |

{{ node.summary }}

3 | {% endif %} 4 | -------------------------------------------------------------------------------- /data/templates/woocommerce/components/table-of-contents-entry.html.twig: -------------------------------------------------------------------------------- 1 |
2 | {{ type == 'property' ? '$' }}{{ node.name }}{{ type == 'method' or type == 'function' ? '()' }} 3 | 4 | {% if type == 'constant' %} = {{ node.value }}{% endif %} 5 | {% if type == 'property' %} : {{ node.type ? node.type|route('class:short')|join('|')|raw : 'mixed' }}{% endif %} 6 | {% if type == 'method' or type == 'function' %} : {{ node.response.type|route('class:short')|join('|')|raw }}{% endif %} 7 | 8 |
9 |
{{ node.summary }}
10 | -------------------------------------------------------------------------------- /data/templates/woocommerce/components/table-of-contents.css.twig: -------------------------------------------------------------------------------- 1 | .phpdocumentor-table-of-contents { 2 | } 3 | 4 | .phpdocumentor-table-of-contents .phpdocumentor-table-of-contents__entry { 5 | padding-top: var(--spacing-xs); 6 | margin-left: 2rem; 7 | display: flex; 8 | } 9 | 10 | .phpdocumentor-table-of-contents .phpdocumentor-table-of-contents__entry > a { 11 | flex: 0 1 auto; 12 | } 13 | 14 | .phpdocumentor-table-of-contents .phpdocumentor-table-of-contents__entry > span { 15 | flex: 1; 16 | white-space: nowrap; 17 | text-overflow: ellipsis; 18 | overflow: hidden; 19 | } 20 | 21 | .phpdocumentor-table-of-contents .phpdocumentor-table-of-contents__entry:after { 22 | content: ''; 23 | height: 12px; 24 | width: 12px; 25 | left: 16px; 26 | position: absolute; 27 | } 28 | .phpdocumentor-table-of-contents .phpdocumentor-table-of-contents__entry.-private:after { 29 | background: url('data:image/svg+xml;utf8,{{ include('icons/private.svg.twig')|trim|raw }}') no-repeat; 30 | } 31 | .phpdocumentor-table-of-contents .phpdocumentor-table-of-contents__entry.-protected:after { 32 | left: 13px; 33 | background: url('data:image/svg+xml;utf8,{{ include('icons/protected.svg.twig')|trim|raw }}') no-repeat; 34 | } 35 | 36 | .phpdocumentor-table-of-contents .phpdocumentor-table-of-contents__entry:before { 37 | width: 1.25rem; 38 | height: 1.25rem; 39 | line-height: 1.25rem; 40 | background: transparent url('data:image/svg+xml;utf8,{{ include('icons/method.svg.twig')|trim|raw }}') no-repeat center center; 41 | content: ''; 42 | position: absolute; 43 | left: 0; 44 | border-radius: 50%; 45 | font-weight: 600; 46 | color: white; 47 | text-align: center; 48 | font-size: .75rem; 49 | margin-top: .2rem; 50 | } 51 | 52 | .phpdocumentor-table-of-contents .phpdocumentor-table-of-contents__entry.-method:before { 53 | content: 'M'; 54 | background-image: url('data:image/svg+xml;utf8,{{ include('icons/method.svg.twig')|trim|raw }}'); 55 | } 56 | 57 | .phpdocumentor-table-of-contents .phpdocumentor-table-of-contents__entry.-function:before { 58 | content: 'M'; 59 | background-image: url('data:image/svg+xml;utf8,{{ include('icons/method.svg.twig')|trim|raw }}'); 60 | } 61 | 62 | .phpdocumentor-table-of-contents .phpdocumentor-table-of-contents__entry.-property:before { 63 | content: 'P' 64 | } 65 | 66 | .phpdocumentor-table-of-contents .phpdocumentor-table-of-contents__entry.-constant:before { 67 | content: 'C'; 68 | background-color: transparent; 69 | background-image: url('data:image/svg+xml;utf8,{{ include('icons/constant.svg.twig')|trim|raw }}'); 70 | } 71 | 72 | .phpdocumentor-table-of-contents .phpdocumentor-table-of-contents__entry.-class:before { 73 | content: 'C' 74 | } 75 | 76 | .phpdocumentor-table-of-contents .phpdocumentor-table-of-contents__entry.-interface:before { 77 | content: 'I' 78 | } 79 | 80 | .phpdocumentor-table-of-contents .phpdocumentor-table-of-contents__entry.-trait:before { 81 | content: 'T' 82 | } 83 | 84 | .phpdocumentor-table-of-contents .phpdocumentor-table-of-contents__entry.-namespace:before { 85 | content: 'N' 86 | } 87 | 88 | .phpdocumentor-table-of-contents .phpdocumentor-table-of-contents__entry.-package:before { 89 | content: 'P' 90 | } 91 | 92 | .phpdocumentor-table-of-contents dd { 93 | font-style: italic; 94 | margin-left: 2rem; 95 | } 96 | -------------------------------------------------------------------------------- /data/templates/woocommerce/components/table-of-contents.html.twig: -------------------------------------------------------------------------------- 1 | {% if namespaces|default([]) is not empty %} 2 |

3 | Namespaces 4 | 5 |

6 | 7 |
8 | {% for namespace in namespaces %} 9 |
{{ namespace|route('class:short') }}
10 | {% endfor %} 11 |
12 | {% endif %} 13 | 14 | {% if packages|default([]) is not empty %} 15 |

16 | Packages 17 | 18 |

19 | 20 |
21 | {% for package in packages %} 22 |
{{ package|route('class:short') }}
23 | {% endfor %} 24 |
25 | {% endif %} 26 | 27 | {% if node.interfaces is not empty or node.classes is not empty %} 28 |

29 | Interfaces, Classes and Traits 30 | 31 |

32 | 33 |
34 | {% for interface in node.interfaces %} 35 |
{{ interface|route('class:short') }}
36 |
{{ interface.summary }}
37 | {% endfor %} 38 | 39 | {% for class in node.classes %} 40 |
{{ class|route('class:short') }}
41 |
{{ class.summary }}
42 | {% endfor %} 43 | 44 | {% for trait in node.traits %} 45 |
{{ trait|route('class:short') }}
46 |
{{ trait.summary }}
47 | {% endfor %} 48 |
49 | {% endif %} 50 | 51 | {% set constants = constants(node) %} 52 | {% set properties = properties(node) %} 53 | {% set methods = methods(node) %} 54 | 55 | {% if constants is not empty or node.functions is not empty or methods is not empty or properties is not empty %} 56 |

57 | Table of Contents 58 | 59 |

60 | 61 |
62 | {% for constant in constants(node)|sortByVisibility %} 63 | {{ include('components/table-of-contents-entry.html.twig', {'type': 'constant', 'node': constant}) }} 64 | {% endfor %} 65 | {% for property in properties(node)|sortByVisibility %} 66 | {{ include('components/table-of-contents-entry.html.twig', {'type': 'property', 'node': property}) }} 67 | {% endfor %} 68 | {% for method in methods(node)|sortByVisibility %} 69 | {{ include('components/table-of-contents-entry.html.twig', {'type': 'method', 'node': method}) }} 70 | {% endfor %} 71 | {% for function in node.functions|default([]) %} 72 | {{ include('components/table-of-contents-entry.html.twig', {'type': 'function', 'node': function}) }} 73 | {% endfor %} 74 |
75 | {% endif %} 76 | -------------------------------------------------------------------------------- /data/templates/woocommerce/components/tag-list.css.twig: -------------------------------------------------------------------------------- 1 | .phpdocumentor-tag-list__definition { 2 | display: flex; 3 | } 4 | 5 | .phpdocumentor-tag-link { 6 | margin-right: var(--spacing-sm); 7 | } 8 | -------------------------------------------------------------------------------- /data/templates/woocommerce/components/tags.html.twig: -------------------------------------------------------------------------------- 1 | {% set tags = tags|filter((v,k) => k not in ['var', 'param', 'property', 'property-read', 'property-write', 'method', 'return', 'package', 'api']) %} 2 | 3 | {% if tags|length > 0 %} 4 |
5 | Tags 6 | 7 |
8 |
9 | {% for name,seriesOfTag in tags %} 10 | {% for tag in seriesOfTag %} 11 |
12 | {{ name }} 13 |
14 |
15 | {% if tag.version %} 16 | {{ tag.version }} 17 | {% endif %} 18 | {% if tag.type %} 19 | {{ tag.type|route('class:short')|join('|')|raw }} 20 | {% endif %} 21 | {% if tag.reference %} 22 | {{ tag.reference|route('class:short')|join('|')|raw }} 23 | {% endif %} 24 | {% if tag.link %} 25 | {{ tag.link }} 26 | {% endif %} 27 | {{ include('components/description.html.twig', {'node': tag}) }} 28 |
29 | {% endfor %} 30 | {% endfor %} 31 |
32 | {% endif %} 33 | -------------------------------------------------------------------------------- /data/templates/woocommerce/components/topnav.css.twig: -------------------------------------------------------------------------------- 1 | .phpdocumentor-topnav { 2 | display: flex; 3 | flex: 1; 4 | margin-left: 4%; 5 | align-items: center; 6 | } 7 | 8 | .phpdocumentor-topnav__menu { 9 | display: inline-block; 10 | list-style: none; 11 | margin: 0; 12 | padding: 0; 13 | flex: 1; 14 | } 15 | 16 | .phpdocumentor-topnav__menu.-social { 17 | margin-left: auto; 18 | flex: 0 auto; 19 | } 20 | 21 | .phpdocumentor-topnav__menu-item { 22 | display: inline; 23 | margin: 0; 24 | padding: 0 var(--spacing-lg) 0 0; 25 | } 26 | 27 | .phpdocumentor-topnav__menu-item:last-of-type { 28 | padding: 0; 29 | } 30 | 31 | .phpdocumentor-topnav__menu-item a { 32 | display: inline-block; 33 | color: var(--text-color); 34 | text-decoration: none; 35 | font-size: var(--text-lg); 36 | transition: all .3s ease-out; 37 | border-bottom: 1px dotted transparent; 38 | line-height: 1; 39 | } 40 | 41 | .phpdocumentor-topnav__menu-item a:hover { 42 | transform: perspective(15rem) translateY(.1rem); 43 | border-bottom: 1px dotted var(--text-color); 44 | } 45 | -------------------------------------------------------------------------------- /data/templates/woocommerce/components/topnav.html.twig: -------------------------------------------------------------------------------- 1 | 17 | -------------------------------------------------------------------------------- /data/templates/woocommerce/components/trait-title.html.twig: -------------------------------------------------------------------------------- 1 |

2 | {{ node.name }} 3 | {% if node.usedTraits is not empty %} 4 | 5 | Uses 6 | {% for trait in node.usedTraits %} 7 | {{ trait|route('trait:short') }}{% if not loop.last %}, {% endif %} 8 | {% endfor %} 9 | 10 | {% endif %} 11 |

12 | -------------------------------------------------------------------------------- /data/templates/woocommerce/css/base.css.twig: -------------------------------------------------------------------------------- 1 | {% set breakpoints = {'sm': '400px', 'md': '550px', 'lg': '750px', 'xl': '1000px', 'xxl': '1200px'} %} 2 | 3 | {% include 'css/variables.css.twig' %} 4 | 5 | /* Base Styles 6 | -------------------------------------------------- */ 7 | body { 8 | color: var(--text-color); 9 | font-family: var(--font-primary); 10 | font-size: var(--text-md); 11 | letter-spacing: var(--letter-spacing--primary); 12 | line-height: var(--line-height--primary); 13 | } 14 | 15 | {% include 'objects/headings.css.twig' %} 16 | {% include 'objects/paragraph.css.twig' %} 17 | {% include 'objects/images.css.twig' %} 18 | {% include 'objects/line.css.twig' %} 19 | {% include 'objects/section.css.twig' %} 20 | {% include 'objects/grid.css.twig' %} 21 | {% include 'objects/links.css.twig' %} 22 | {% include 'objects/buttons.css.twig' %} 23 | {% include 'objects/forms.css.twig' %} 24 | {% include 'objects/lists.css.twig' %} 25 | {% include 'objects/code.css.twig' %} 26 | {% include 'objects/tables.css.twig' %} 27 | 28 | {% include 'components/header.css.twig' %} 29 | {% include 'components/topnav.css.twig' %} 30 | {% include 'components/sidebar.css.twig' %} 31 | {% include 'components/admonition.css.twig' %} 32 | {% include 'components/breadcrumbs.css.twig' %} 33 | {% include 'components/back-to-top.css.twig' %} 34 | 35 | {% include 'css/utilities.css.twig' %} 36 | -------------------------------------------------------------------------------- /data/templates/woocommerce/css/custom.css.twig: -------------------------------------------------------------------------------- 1 | /* Elements */ 2 | abbr[title] { 3 | border: none; 4 | text-decoration: none; 5 | } 6 | 7 | /* Top Header */ 8 | .phpdocumentor-header > * { 9 | height: auto; 10 | } 11 | 12 | .phpdocumentor-top-header { 13 | font-family: var(--font-secondary); 14 | align-items: center; 15 | background: var(--top-header-bg-color); 16 | color: var(--top-header-text-color); 17 | display: flex; 18 | flex-direction: row; 19 | font-size: var(--text-md); 20 | min-height: var(--top-header-height); 21 | padding: 0 var(--spacing-sm); 22 | text-align: right; 23 | } 24 | 25 | .phpdocumentor-top-header a { 26 | color: var(--primary-color-darker); 27 | display: inline-block; 28 | text-decoration: none; 29 | } 30 | .phpdocumentor-top-header a span { 31 | border-bottom: 1px solid transparent; 32 | transition: border-bottom-color .2s ease-in-out; 33 | } 34 | .phpdocumentor-top-header a:hover { 35 | color: var(--text-color); 36 | } 37 | .phpdocumentor-top-header a:hover span { 38 | border-bottom: 1px solid var(--text-color); 39 | } 40 | .phpdocumentor-top-header a:not(:first-of-type):before { 41 | display: inline-block; 42 | color: #ccc; 43 | content: "/"; 44 | padding: 0 var(--spacing-xxs); 45 | } 46 | 47 | /* Logo */ 48 | .site-branding { 49 | margin: 29px 0 0 0; 50 | text-align: left; 51 | } 52 | 53 | .site-branding .site-logo img { 54 | width: 204px; 55 | } 56 | 57 | /* Navigation */ 58 | .main-navigation ul { 59 | margin-bottom: 1em; 60 | padding-left: 0; 61 | text-align: left; 62 | } 63 | 64 | .main-navigation a { 65 | color: #333; 66 | font-weight: 400; 67 | font-size: .9em; 68 | text-decoration: none; 69 | } 70 | 71 | .main-navigation a:hover { 72 | color: var(--primary-color); 73 | } 74 | 75 | /* Header */ 76 | .phpdocumentor-header { 77 | background: var(--header-bg-color); 78 | margin-bottom: var(--spacing-xl); 79 | position: relative; 80 | } 81 | 82 | .phpdocumentor-header p { 83 | color: white; 84 | font-size: var(--text-lg); 85 | } 86 | 87 | .phpdocumentor-title { 88 | font-family: var(--font-secondary); 89 | color: var(--title-text-color); 90 | letter-spacing: 1px; 91 | line-height: 1.2; 92 | text-align: center; 93 | padding: 0; 94 | margin: 1.0em 0; 95 | font-size: var(--text-xl); 96 | font-weight: normal; 97 | } 98 | 99 | .phpdocumentor-title a { 100 | text-decoration: none; 101 | color: var(--title-text-color); 102 | } 103 | 104 | .phpdocumentor-title small { 105 | text-shadow: none; 106 | font-size: var(--text-xxs); 107 | display: block; 108 | margin: var(--spacing-sm) 0; 109 | } 110 | 111 | /* Search */ 112 | .phpdocumentor-search-results__entries { 113 | background: var(--popover-background-color); 114 | left: 0; 115 | list-style: none; 116 | margin: 0 auto; 117 | max-height: 30rem; 118 | opacity: 1; 119 | overflow-x: auto; 120 | padding: 0 var(--spacing-lg); 121 | pointer-events: all; 122 | position: absolute; 123 | right: 0; 124 | transition: all 0.1s ease-in-out; 125 | width: 75%; 126 | z-index: 1000; 127 | } 128 | 129 | .phpdocumentor-search-results__entry { 130 | border-bottom: 1px solid var(--table-separator-color); 131 | padding: var(--spacing-sm) var(--spacing-md); 132 | text-align: left; 133 | } 134 | 135 | .phpdocumentor-search-results__entry a { 136 | color: var(--link-color-primary); 137 | display: block; 138 | margin-bottom: var(--spacing-xs); 139 | text-decoration: none; 140 | } 141 | 142 | .phpdocumentor-search-results__entry a:hover { 143 | color: var(--link-hover-color-primary); 144 | } 145 | 146 | .phpdocumentor-search-results__entry small { 147 | color: var(--primary-color-darker); 148 | display: block; 149 | } 150 | 151 | .phpdocumentor-search-results__entry .phpdocumentor-summary { 152 | display: block; 153 | margin-top: var(--spacing-md); 154 | } 155 | 156 | .phpdocumentor-search-results__entry h3 { 157 | font-weight: normal; 158 | line-break: anywhere; 159 | margin: 0; 160 | } 161 | 162 | .phpdocumentor-search-results__entry:last-child { 163 | border-bottom: none; 164 | } 165 | 166 | .phpdocumentor-search { 167 | position: relative; 168 | display: none; /** disable by default for non-js flow */ 169 | opacity: .3; /** white-out default for loading indication */ 170 | transition: opacity .3s, background .3s; 171 | text-align: center; 172 | } 173 | .phpdocumentor-search:before { 174 | content: ''; 175 | background: transparent; 176 | left: calc(-1 * var(--spacing-md)); 177 | height: 100%; 178 | position: absolute; 179 | right: -15px; 180 | z-index: -1; 181 | opacity: 0; 182 | transition: opacity .3s, background .3s; 183 | } 184 | 185 | .phpdocumentor-search .phpdocumentor-label { 186 | display: block; 187 | margin-bottom: var(--spacing-md); 188 | } 189 | 190 | .phpdocumentor-search--enabled { 191 | display: block; 192 | } 193 | 194 | .phpdocumentor-search--active { 195 | opacity: 1; 196 | } 197 | .phpdocumentor-search--has-results:before { 198 | background: var(--popover-background-color); 199 | opacity: 1; 200 | } 201 | 202 | .phpdocumentor-search input:disabled { 203 | background-color: #d3d3d3; 204 | } 205 | 206 | .phpdocumentor-search__field { 207 | background: #f2efec; 208 | border: 1px solid var(--primary-color); 209 | border-radius: 3px; 210 | color: #333; 211 | font-size: 18px; 212 | line-height: 50px; 213 | padding-left: 1.3em; 214 | padding-right: 1.3em; 215 | width: 50%; 216 | height: 40px; 217 | margin-bottom: 0; 218 | } 219 | 220 | .phpdocumentor-search__field:focus { 221 | border: 1px solid var(--primary-color-darken); 222 | } 223 | 224 | .autoComplete_highlighted { 225 | opacity: 1; 226 | color: var(--primary-color-darker); 227 | font-weight: bold; 228 | } 229 | 230 | .autoComplete_highlighted::selection { 231 | color: rgba(#ffffff, 0); 232 | background-color: rgba(#ffffff, 0); 233 | } 234 | 235 | /* Footer */ 236 | .phpdocumentor-footer { 237 | clear: both; 238 | background-color: #f7f7f7; 239 | font-size: var(--text-xs); 240 | font-weight: 700; 241 | margin-top: var(--spacing-lg); 242 | padding: var(--spacing-lg); 243 | text-align: center; 244 | text-transform: uppercase; 245 | } 246 | 247 | /* Content */ 248 | .phpdocumentor-content { 249 | position: relative; 250 | } 251 | 252 | main.phpdocumentor::after { 253 | display: block; 254 | content: ''; 255 | clear: both; 256 | } 257 | 258 | .phpdocumentor-element-found-in { 259 | position: relative; 260 | margin-bottom: var(--spacing-md); 261 | } 262 | 263 | .phpdocumentor-table-of-contents .phpdocumentor-table-of-contents__entry > a { 264 | text-decoration: none; 265 | } 266 | 267 | .phpdocumentor-table-of-contents .phpdocumentor-table-of-contents__entry.-action:before { 268 | content: 'A' 269 | } 270 | 271 | .phpdocumentor-table-of-contents .phpdocumentor-table-of-contents__entry.-filter:before { 272 | content: 'F' 273 | } 274 | 275 | .phpdocumentor-table-of-contents .phpdocumentor-table-of-contents__entry.-action:after, 276 | .phpdocumentor-table-of-contents .phpdocumentor-table-of-contents__entry.-filter:after { 277 | left: 13px; 278 | background: url('data:image/svg+xml;utf8,{{ include('icons/wp.svg.twig')|trim|raw }}') no-repeat; 279 | } 280 | 281 | /* Code */ 282 | .phpdocumentor-argument-list .phpdocumentor-signature__argument__name { 283 | font-weight: bold; 284 | } 285 | 286 | /* Media queries */ 287 | @media (min-width: 400px) { 288 | .phpdocumentor-top-header .phpdocumentor-section { 289 | display: flex; 290 | } 291 | 292 | .site-branding { 293 | flex: 35%; 294 | } 295 | 296 | .site-branding a::after { 297 | font-size: 26px; 298 | } 299 | 300 | .main-navigation { 301 | flex: 65%; 302 | } 303 | 304 | .main-navigation ul { 305 | display: inline-flex; 306 | list-style: none; 307 | margin: 0; 308 | } 309 | 310 | .main-navigation ul > li:hover { 311 | background: #e6e6e6; 312 | transition: all ease-in-out .2s; 313 | } 314 | 315 | .main-navigation a { 316 | padding: 2.5em .8em; 317 | font-size: .8em; 318 | } 319 | 320 | .main-navigation a:hover { 321 | color: #333; 322 | } 323 | 324 | th.phpdocumentor-heading, 325 | td.phpdocumentor-cell { 326 | border-bottom: 1px solid var(--table-separator-color); 327 | padding: var(--spacing-sm) var(--spacing-md); 328 | text-align: left; 329 | display: table-cell; 330 | } 331 | 332 | th.phpdocumentor-heading { 333 | min-width: 30%; 334 | } 335 | 336 | td.phpdocumentor-cell { 337 | border-bottom: 1px solid var(--table-separator-color); 338 | } 339 | 340 | } 341 | -------------------------------------------------------------------------------- /data/templates/woocommerce/css/normalize.css.twig: -------------------------------------------------------------------------------- 1 | /*! normalize.css v3.0.2 | MIT License | git.io/normalize */ 2 | 3 | /** 4 | * 1. Set default font family to sans-serif. 5 | * 2. Prevent iOS text size adjust after orientation change, without disabling 6 | * user zoom. 7 | */ 8 | 9 | html { 10 | font-family: sans-serif; /* 1 */ 11 | -ms-text-size-adjust: 100%; /* 2 */ 12 | -webkit-text-size-adjust: 100%; /* 2 */ 13 | } 14 | 15 | /** 16 | * Remove default margin. 17 | */ 18 | 19 | body { 20 | margin: 0; 21 | } 22 | 23 | /* HTML5 display definitions 24 | ========================================================================== */ 25 | 26 | /** 27 | * Correct `block` display not defined for any HTML5 element in IE 8/9. 28 | * Correct `block` display not defined for `details` or `summary` in IE 10/11 29 | * and Firefox. 30 | * Correct `block` display not defined for `main` in IE 11. 31 | */ 32 | 33 | article, 34 | aside, 35 | details, 36 | figcaption, 37 | figure, 38 | footer, 39 | header, 40 | hgroup, 41 | main, 42 | menu, 43 | nav, 44 | section, 45 | summary { 46 | display: block; 47 | } 48 | 49 | /** 50 | * 1. Correct `inline-block` display not defined in IE 8/9. 51 | * 2. Normalize vertical alignment of `progress` in Chrome, Firefox, and Opera. 52 | */ 53 | 54 | audio, 55 | canvas, 56 | progress, 57 | video { 58 | display: inline-block; /* 1 */ 59 | vertical-align: baseline; /* 2 */ 60 | } 61 | 62 | /** 63 | * Prevent modern browsers from displaying `audio` without controls. 64 | * Remove excess height in iOS 5 devices. 65 | */ 66 | 67 | audio:not([controls]) { 68 | display: none; 69 | height: 0; 70 | } 71 | 72 | /** 73 | * Address `[hidden]` styling not present in IE 8/9/10. 74 | * Hide the `template` element in IE 8/9/11, Safari, and Firefox < 22. 75 | */ 76 | 77 | [hidden], 78 | template { 79 | display: none; 80 | } 81 | 82 | /* Links 83 | ========================================================================== */ 84 | 85 | /** 86 | * Remove the gray background color from active links in IE 10. 87 | */ 88 | 89 | a { 90 | background-color: transparent; 91 | } 92 | 93 | /** 94 | * Improve readability when focused and also mouse hovered in all browsers. 95 | */ 96 | 97 | a:active, 98 | a:hover { 99 | outline: 0; 100 | } 101 | 102 | /* Text-level semantics 103 | ========================================================================== */ 104 | 105 | /** 106 | * Address styling not present in IE 8/9/10/11, Safari, and Chrome. 107 | */ 108 | 109 | abbr[title] { 110 | border-bottom: 1px dotted; 111 | } 112 | 113 | /** 114 | * Address style set to `bolder` in Firefox 4+, Safari, and Chrome. 115 | */ 116 | 117 | b, 118 | strong { 119 | font-weight: bold; 120 | } 121 | 122 | /** 123 | * Address styling not present in Safari and Chrome. 124 | */ 125 | 126 | dfn { 127 | font-style: italic; 128 | } 129 | 130 | /** 131 | * Address variable `h1` font-size and margin within `section` and `article` 132 | * contexts in Firefox 4+, Safari, and Chrome. 133 | */ 134 | 135 | h1 { 136 | font-size: 2em; 137 | margin: 0.67em 0; 138 | } 139 | 140 | /** 141 | * Address styling not present in IE 8/9. 142 | */ 143 | 144 | mark { 145 | background: #ff0; 146 | color: #000; 147 | } 148 | 149 | /** 150 | * Address inconsistent and variable font size in all browsers. 151 | */ 152 | 153 | small { 154 | font-size: 80%; 155 | } 156 | 157 | /** 158 | * Prevent `sub` and `sup` affecting `line-height` in all browsers. 159 | */ 160 | 161 | sub, 162 | sup { 163 | font-size: 75%; 164 | line-height: 0; 165 | position: relative; 166 | vertical-align: baseline; 167 | } 168 | 169 | sup { 170 | top: -0.5em; 171 | } 172 | 173 | sub { 174 | bottom: -0.25em; 175 | } 176 | 177 | /* Embedded content 178 | ========================================================================== */ 179 | 180 | /** 181 | * Remove border when inside `a` element in IE 8/9/10. 182 | */ 183 | 184 | img { 185 | border: 0; 186 | } 187 | 188 | /** 189 | * Correct overflow not hidden in IE 9/10/11. 190 | */ 191 | 192 | svg:not(:root) { 193 | overflow: hidden; 194 | } 195 | 196 | /* Grouping content 197 | ========================================================================== */ 198 | 199 | /** 200 | * Address margin not present in IE 8/9 and Safari. 201 | */ 202 | 203 | figure { 204 | margin: 1em 40px; 205 | } 206 | 207 | /** 208 | * Address differences between Firefox and other browsers. 209 | */ 210 | 211 | hr { 212 | -moz-box-sizing: content-box; 213 | box-sizing: content-box; 214 | height: 0; 215 | } 216 | 217 | /** 218 | * Contain overflow in all browsers. 219 | */ 220 | 221 | pre { 222 | overflow: auto; 223 | } 224 | 225 | /** 226 | * Address odd `em`-unit font size rendering in all browsers. 227 | */ 228 | 229 | code, 230 | kbd, 231 | pre, 232 | samp { 233 | font-family: monospace, monospace; 234 | font-size: 1em; 235 | } 236 | 237 | /* Forms 238 | ========================================================================== */ 239 | 240 | /** 241 | * Known limitation: by default, Chrome and Safari on OS X allow very limited 242 | * styling of `select`, unless a `border` property is set. 243 | */ 244 | 245 | /** 246 | * 1. Correct color not being inherited. 247 | * Known issue: affects color of disabled elements. 248 | * 2. Correct font properties not being inherited. 249 | * 3. Address margins set differently in Firefox 4+, Safari, and Chrome. 250 | */ 251 | 252 | button, 253 | input, 254 | optgroup, 255 | select, 256 | textarea { 257 | color: inherit; /* 1 */ 258 | font: inherit; /* 2 */ 259 | margin: 0; /* 3 */ 260 | } 261 | 262 | /** 263 | * Address `overflow` set to `hidden` in IE 8/9/10/11. 264 | */ 265 | 266 | button { 267 | overflow: visible; 268 | } 269 | 270 | /** 271 | * Address inconsistent `text-transform` inheritance for `button` and `select`. 272 | * All other form control elements do not inherit `text-transform` values. 273 | * Correct `button` style inheritance in Firefox, IE 8/9/10/11, and Opera. 274 | * Correct `select` style inheritance in Firefox. 275 | */ 276 | 277 | button, 278 | select { 279 | text-transform: none; 280 | } 281 | 282 | /** 283 | * 1. Avoid the WebKit bug in Android 4.0.* where (2) destroys native `audio` 284 | * and `video` controls. 285 | * 2. Correct inability to style clickable `input` types in iOS. 286 | * 3. Improve usability and consistency of cursor style between image-type 287 | * `input` and others. 288 | */ 289 | 290 | button, 291 | html input[type="button"], /* 1 */ 292 | input[type="reset"], 293 | input[type="submit"] { 294 | -webkit-appearance: button; /* 2 */ 295 | cursor: pointer; /* 3 */ 296 | } 297 | 298 | /** 299 | * Re-set default cursor for disabled elements. 300 | */ 301 | 302 | button[disabled], 303 | html input[disabled] { 304 | cursor: default; 305 | } 306 | 307 | /** 308 | * Remove inner padding and border in Firefox 4+. 309 | */ 310 | 311 | button::-moz-focus-inner, 312 | input::-moz-focus-inner { 313 | border: 0; 314 | padding: 0; 315 | } 316 | 317 | /** 318 | * Address Firefox 4+ setting `line-height` on `input` using `!important` in 319 | * the UA stylesheet. 320 | */ 321 | 322 | input { 323 | line-height: normal; 324 | } 325 | 326 | /** 327 | * It's recommended that you don't attempt to style these elements. 328 | * Firefox's implementation doesn't respect box-sizing, padding, or width. 329 | * 330 | * 1. Address box sizing set to `content-box` in IE 8/9/10. 331 | * 2. Remove excess padding in IE 8/9/10. 332 | */ 333 | 334 | input[type="checkbox"], 335 | input[type="radio"] { 336 | box-sizing: border-box; /* 1 */ 337 | padding: 0; /* 2 */ 338 | } 339 | 340 | /** 341 | * Fix the cursor style for Chrome's increment/decrement buttons. For certain 342 | * `font-size` values of the `input`, it causes the cursor style of the 343 | * decrement button to change from `default` to `text`. 344 | */ 345 | 346 | input[type="number"]::-webkit-inner-spin-button, 347 | input[type="number"]::-webkit-outer-spin-button { 348 | height: auto; 349 | } 350 | 351 | /** 352 | * 1. Address `appearance` set to `searchfield` in Safari and Chrome. 353 | * 2. Address `box-sizing` set to `border-box` in Safari and Chrome 354 | * (include `-moz` to future-proof). 355 | */ 356 | 357 | input[type="search"] { 358 | -webkit-appearance: textfield; /* 1 */ 359 | -moz-box-sizing: content-box; 360 | -webkit-box-sizing: content-box; /* 2 */ 361 | box-sizing: content-box; 362 | } 363 | 364 | /** 365 | * Remove inner padding and search cancel button in Safari and Chrome on OS X. 366 | * Safari (but not Chrome) clips the cancel button when the search input has 367 | * padding (and `textfield` appearance). 368 | */ 369 | 370 | input[type="search"]::-webkit-search-cancel-button, 371 | input[type="search"]::-webkit-search-decoration { 372 | -webkit-appearance: none; 373 | } 374 | 375 | /** 376 | * Define consistent border, margin, and padding. 377 | */ 378 | 379 | fieldset { 380 | border: 1px solid #c0c0c0; 381 | margin: 0 2px; 382 | padding: 0.35em 0.625em 0.75em; 383 | } 384 | 385 | /** 386 | * 1. Correct `color` not being inherited in IE 8/9/10/11. 387 | * 2. Remove padding so people aren't caught out if they zero out fieldsets. 388 | */ 389 | 390 | legend { 391 | border: 0; /* 1 */ 392 | padding: 0; /* 2 */ 393 | } 394 | 395 | /** 396 | * Remove default vertical scrollbar in IE 8/9/10/11. 397 | */ 398 | 399 | textarea { 400 | overflow: auto; 401 | } 402 | 403 | /** 404 | * Don't inherit the `font-weight` (applied by a rule above). 405 | * NOTE: the default cannot safely be changed in Chrome and Safari on OS X. 406 | */ 407 | 408 | optgroup { 409 | font-weight: bold; 410 | } 411 | 412 | /* Tables 413 | ========================================================================== */ 414 | 415 | /** 416 | * Remove most spacing between table cells. 417 | */ 418 | 419 | table { 420 | border-collapse: collapse; 421 | border-spacing: 0; 422 | } 423 | 424 | td, 425 | th { 426 | padding: 0; 427 | } 428 | -------------------------------------------------------------------------------- /data/templates/woocommerce/css/prism.css.twig: -------------------------------------------------------------------------------- 1 | /* PrismJS 1.21.0 2 | https://prismjs.com/download.html#themes=prism-coy&languages=markup+css+clike+javascript+javadoclike+markup-templating+php+phpdoc+php-extras&plugins=line-highlight+line-numbers */ 3 | /** 4 | * prism.js Coy theme for JavaScript, CoffeeScript, CSS and HTML 5 | * Based on https://github.com/tshedor/workshop-wp-theme (Example: http://workshop.kansan.com/category/sessions/basics or http://workshop.timshedor.com/category/sessions/basics); 6 | * @author Tim Shedor 7 | */ 8 | 9 | code[class*="language-"], 10 | pre[class*="language-"] { 11 | color: black; 12 | background: none; 13 | font-family: Consolas, Monaco, 'Andale Mono', 'Ubuntu Mono', monospace; 14 | font-size: 1em; 15 | text-align: left; 16 | white-space: pre; 17 | word-spacing: normal; 18 | word-break: normal; 19 | word-wrap: normal; 20 | line-height: 1.5; 21 | 22 | -moz-tab-size: 4; 23 | -o-tab-size: 4; 24 | tab-size: 4; 25 | 26 | -webkit-hyphens: none; 27 | -moz-hyphens: none; 28 | -ms-hyphens: none; 29 | hyphens: none; 30 | } 31 | 32 | /* Code blocks */ 33 | pre[class*="language-"] { 34 | position: relative; 35 | margin: .5em 0; 36 | overflow: visible; 37 | padding: 0; 38 | } 39 | pre[class*="language-"]>code { 40 | position: relative; 41 | border-left: 10px solid #358ccb; 42 | box-shadow: -1px 0px 0px 0px #358ccb, 0px 0px 0px 1px #dfdfdf; 43 | background-color: #fdfdfd; 44 | background-image: linear-gradient(transparent 50%, rgba(69, 142, 209, 0.04) 50%); 45 | background-size: 3em 3em; 46 | background-origin: content-box; 47 | background-attachment: local; 48 | } 49 | 50 | code[class*="language-"] { 51 | max-height: inherit; 52 | height: inherit; 53 | padding: 0 1em; 54 | display: block; 55 | overflow: auto; 56 | } 57 | 58 | /* Margin bottom to accommodate shadow */ 59 | :not(pre) > code[class*="language-"], 60 | pre[class*="language-"] { 61 | background-color: #fdfdfd; 62 | -webkit-box-sizing: border-box; 63 | -moz-box-sizing: border-box; 64 | box-sizing: border-box; 65 | margin-bottom: 1em; 66 | } 67 | 68 | /* Inline code */ 69 | :not(pre) > code[class*="language-"] { 70 | position: relative; 71 | padding: .2em; 72 | border-radius: 0.3em; 73 | color: #c92c2c; 74 | border: 1px solid rgba(0, 0, 0, 0.1); 75 | display: inline; 76 | white-space: normal; 77 | } 78 | 79 | pre[class*="language-"]:before, 80 | pre[class*="language-"]:after { 81 | content: ''; 82 | z-index: -2; 83 | display: block; 84 | position: absolute; 85 | bottom: 0.75em; 86 | left: 0.18em; 87 | width: 40%; 88 | height: 20%; 89 | max-height: 13em; 90 | box-shadow: 0px 13px 8px #979797; 91 | -webkit-transform: rotate(-2deg); 92 | -moz-transform: rotate(-2deg); 93 | -ms-transform: rotate(-2deg); 94 | -o-transform: rotate(-2deg); 95 | transform: rotate(-2deg); 96 | } 97 | 98 | pre[class*="language-"]:after { 99 | right: 0.75em; 100 | left: auto; 101 | -webkit-transform: rotate(2deg); 102 | -moz-transform: rotate(2deg); 103 | -ms-transform: rotate(2deg); 104 | -o-transform: rotate(2deg); 105 | transform: rotate(2deg); 106 | } 107 | 108 | .token.comment, 109 | .token.block-comment, 110 | .token.prolog, 111 | .token.doctype, 112 | .token.cdata { 113 | color: #7D8B99; 114 | } 115 | 116 | .token.punctuation { 117 | color: #5F6364; 118 | } 119 | 120 | .token.property, 121 | .token.tag, 122 | .token.boolean, 123 | .token.number, 124 | .token.function-name, 125 | .token.constant, 126 | .token.symbol, 127 | .token.deleted { 128 | color: #c92c2c; 129 | } 130 | 131 | .token.selector, 132 | .token.attr-name, 133 | .token.string, 134 | .token.char, 135 | .token.function, 136 | .token.builtin, 137 | .token.inserted { 138 | color: #2f9c0a; 139 | } 140 | 141 | .token.operator, 142 | .token.entity, 143 | .token.url, 144 | .token.variable { 145 | color: #a67f59; 146 | background: rgba(255, 255, 255, 0.5); 147 | } 148 | 149 | .token.atrule, 150 | .token.attr-value, 151 | .token.keyword, 152 | .token.class-name { 153 | color: #1990b8; 154 | } 155 | 156 | .token.regex, 157 | .token.important { 158 | color: #e90; 159 | } 160 | 161 | .language-css .token.string, 162 | .style .token.string { 163 | color: #a67f59; 164 | background: rgba(255, 255, 255, 0.5); 165 | } 166 | 167 | .token.important { 168 | font-weight: normal; 169 | } 170 | 171 | .token.bold { 172 | font-weight: bold; 173 | } 174 | .token.italic { 175 | font-style: italic; 176 | } 177 | 178 | .token.entity { 179 | cursor: help; 180 | } 181 | 182 | .token.namespace { 183 | opacity: .7; 184 | } 185 | 186 | @media screen and (max-width: 767px) { 187 | pre[class*="language-"]:before, 188 | pre[class*="language-"]:after { 189 | bottom: 14px; 190 | box-shadow: none; 191 | } 192 | 193 | } 194 | 195 | /* Plugin styles: Line Numbers */ 196 | pre[class*="language-"].line-numbers.line-numbers { 197 | padding-left: 0; 198 | } 199 | 200 | pre[class*="language-"].line-numbers.line-numbers code { 201 | padding-left: 3.8em; 202 | } 203 | 204 | pre[class*="language-"].line-numbers.line-numbers .line-numbers-rows { 205 | left: 0; 206 | } 207 | 208 | /* Plugin styles: Line Highlight */ 209 | pre[class*="language-"][data-line] { 210 | padding-top: 0; 211 | padding-bottom: 0; 212 | padding-left: 0; 213 | } 214 | pre[data-line] code { 215 | position: relative; 216 | padding-left: 4em; 217 | } 218 | pre .line-highlight { 219 | margin-top: 0; 220 | } 221 | 222 | pre[data-line] { 223 | position: relative; 224 | padding: 1em 0 1em 3em; 225 | } 226 | 227 | .line-highlight { 228 | position: absolute; 229 | left: 0; 230 | right: 0; 231 | padding: inherit 0; 232 | margin-top: 1em; /* Same as .prism’s padding-top */ 233 | 234 | background: hsla(24, 20%, 50%,.08); 235 | background: linear-gradient(to right, hsla(24, 20%, 50%,.1) 70%, hsla(24, 20%, 50%,0)); 236 | 237 | pointer-events: none; 238 | 239 | line-height: inherit; 240 | white-space: pre; 241 | } 242 | 243 | .line-highlight:before, 244 | .line-highlight[data-end]:after { 245 | content: attr(data-start); 246 | position: absolute; 247 | top: .4em; 248 | left: .6em; 249 | min-width: 1em; 250 | padding: 0 .5em; 251 | background-color: hsla(24, 20%, 50%,.4); 252 | color: hsl(24, 20%, 95%); 253 | font: bold 65%/1.5 sans-serif; 254 | text-align: center; 255 | vertical-align: .3em; 256 | border-radius: 999px; 257 | text-shadow: none; 258 | box-shadow: 0 1px white; 259 | } 260 | 261 | .line-highlight[data-end]:after { 262 | content: attr(data-end); 263 | top: auto; 264 | bottom: .4em; 265 | } 266 | 267 | .line-numbers .line-highlight:before, 268 | .line-numbers .line-highlight:after { 269 | content: none; 270 | } 271 | 272 | pre[id].linkable-line-numbers span.line-numbers-rows { 273 | pointer-events: all; 274 | } 275 | pre[id].linkable-line-numbers span.line-numbers-rows > span:before { 276 | cursor: pointer; 277 | } 278 | pre[id].linkable-line-numbers span.line-numbers-rows > span:hover:before { 279 | background-color: rgba(128, 128, 128, .2); 280 | } 281 | 282 | pre[class*="language-"].line-numbers { 283 | position: relative; 284 | padding-left: 3.8em; 285 | counter-reset: linenumber; 286 | } 287 | 288 | pre[class*="language-"].line-numbers > code { 289 | position: relative; 290 | white-space: inherit; 291 | } 292 | 293 | .line-numbers .line-numbers-rows { 294 | position: absolute; 295 | pointer-events: none; 296 | top: 0; 297 | font-size: 100%; 298 | left: -3.8em; 299 | width: 3em; /* works for line-numbers below 1000 lines */ 300 | letter-spacing: -1px; 301 | border-right: 1px solid #999; 302 | 303 | -webkit-user-select: none; 304 | -moz-user-select: none; 305 | -ms-user-select: none; 306 | user-select: none; 307 | 308 | } 309 | 310 | .line-numbers-rows > span { 311 | display: block; 312 | counter-increment: linenumber; 313 | } 314 | 315 | .line-numbers-rows > span:before { 316 | content: counter(linenumber); 317 | color: #999; 318 | display: block; 319 | padding-right: 0.8em; 320 | text-align: right; 321 | } 322 | 323 | -------------------------------------------------------------------------------- /data/templates/woocommerce/css/template.css.twig: -------------------------------------------------------------------------------- 1 | {% include 'components/summary.css.twig' %} 2 | {% include 'components/description.css.twig' %} 3 | {% include 'components/element.css.twig' %} 4 | {% include 'components/signature.css.twig' %} 5 | {% include 'components/table-of-contents.css.twig' %} 6 | {% include 'components/element-found-in.css.twig' %} 7 | {% include 'components/class-graph.css.twig' %} 8 | {% include 'components/tag-list.css.twig' %} 9 | {% include 'css/custom.css.twig' %} 10 | {% include 'css/prism.css.twig' %} 11 | -------------------------------------------------------------------------------- /data/templates/woocommerce/css/utilities.css.twig: -------------------------------------------------------------------------------- 1 | /* Used for screen readers and such */ 2 | .visually-hidden { 3 | display: none; 4 | } 5 | -------------------------------------------------------------------------------- /data/templates/woocommerce/css/variables.css.twig: -------------------------------------------------------------------------------- 1 | :root { 2 | /* Typography */ 3 | --font-primary: Inter, system-ui, -apple-system, BlinkMacSystemFont, Segoe UI, Noto Sans, Roboto, Helvetica Neue, Arial, sans-serif; 4 | --font-secondary: "proxima-nova", sans-serif; 5 | --line-height--primary: 1.6; 6 | --letter-spacing--primary: .05rem; 7 | --text-base-size: 1em; 8 | --text-scale-ratio: 1.2; 9 | 10 | --text-xxs: calc(var(--text-base-size) / var(--text-scale-ratio) / var(--text-scale-ratio) / var(--text-scale-ratio)); 11 | --text-xs: calc(var(--text-base-size) / var(--text-scale-ratio) / var(--text-scale-ratio)); 12 | --text-sm: calc(var(--text-base-size) / var(--text-scale-ratio)); 13 | --text-md: var(--text-base-size); 14 | --text-lg: calc(var(--text-base-size) * var(--text-scale-ratio)); 15 | --text-xl: calc(var(--text-base-size) * var(--text-scale-ratio) * var(--text-scale-ratio)); 16 | --text-xxl: calc(var(--text-base-size) * var(--text-scale-ratio) * var(--text-scale-ratio) * var(--text-scale-ratio)); 17 | --text-xxxl: calc(var(--text-base-size) * var(--text-scale-ratio) * var(--text-scale-ratio) * var(--text-scale-ratio) * var(--text-scale-ratio)); 18 | --text-xxxxl: calc(var(--text-base-size) * var(--text-scale-ratio) * var(--text-scale-ratio) * var(--text-scale-ratio) * var(--text-scale-ratio) * var(--text-scale-ratio)); 19 | --text-xxxxxl: calc(var(--text-base-size) * var(--text-scale-ratio) * var(--text-scale-ratio) * var(--text-scale-ratio) * var(--text-scale-ratio) * var(--text-scale-ratio) * var(--text-scale-ratio)); 20 | 21 | /* Colors */ 22 | --primary-color: #720eec; 23 | --primary-color-darken: #3c087e; 24 | --primary-color-darker:rgb(48, 7, 101); 25 | --primary-color-lighten: #b884f8; 26 | --primary-color-lighter: #e3cefc; 27 | --dark-gray: #d1d1d1; 28 | --light-gray: #f0f0f0; 29 | 30 | --text-color: #333; 31 | 32 | --header-height: var(--spacing-xxxxl); 33 | --top-header-bg-color: hsl(0, 0%, 100%); 34 | --top-header-text-color: var(--text-color); 35 | --header-bg-color: var(--primary-color); 36 | --code-background-color: hsl(208, 56%, 95%); 37 | --code-border-color: hsl(209, 59%, 85%); 38 | --button-border-color: var(--primary-color-darken); 39 | --button-color: transparent; 40 | --button-color-primary: var(--primary-color); 41 | --button-text-color: hsl(0, 0%, 33%); 42 | --button-text-color-primary: white; 43 | --popover-background-color: #f9f5fe; 44 | --link-color-primary: var(--primary-color); 45 | --link-hover-color-primary: var(--primary-color-darken); 46 | --form-field-border-color: var(--dark-gray); 47 | --form-field-color: #fff; 48 | --admonition-success-color: var(--primary-color); 49 | --admonition-border-color: silver; 50 | --table-separator-color: var(--primary-color-lighten); 51 | --title-text-color: white; 52 | 53 | --sidebar-border-color: var(--primary-color-lighten); 54 | 55 | /* Grid */ 56 | --container-width: 1400px; 57 | --top-header-height: calc(var(--text-lg) + 2 * var(--spacing-sm)); 58 | 59 | /* Spacing */ 60 | --spacing-base-size: 1rem; 61 | --spacing-scale-ratio: 1.5; 62 | 63 | --spacing-xxxs: calc(var(--spacing-base-size) / var(--spacing-scale-ratio) / var(--spacing-scale-ratio) / var(--spacing-scale-ratio) / var(--spacing-scale-ratio)); 64 | --spacing-xxs: calc(var(--spacing-base-size) / var(--spacing-scale-ratio) / var(--spacing-scale-ratio) / var(--spacing-scale-ratio)); 65 | --spacing-xs: calc(var(--spacing-base-size) / var(--spacing-scale-ratio) / var(--spacing-scale-ratio)); 66 | --spacing-sm: calc(var(--spacing-base-size) / var(--spacing-scale-ratio)); 67 | --spacing-md: var(--spacing-base-size); 68 | --spacing-lg: calc(var(--spacing-base-size) * var(--spacing-scale-ratio)); 69 | --spacing-xl: calc(var(--spacing-base-size) * var(--spacing-scale-ratio) * var(--spacing-scale-ratio)); 70 | --spacing-xxl: calc(var(--spacing-base-size) * var(--spacing-scale-ratio) * var(--spacing-scale-ratio) * var(--spacing-scale-ratio)); 71 | --spacing-xxxl: calc(var(--spacing-base-size) * var(--spacing-scale-ratio) * var(--spacing-scale-ratio) * var(--spacing-scale-ratio) * var(--spacing-scale-ratio)); 72 | --spacing-xxxxl: calc(var(--spacing-base-size) * var(--spacing-scale-ratio) * var(--spacing-scale-ratio) * var(--spacing-scale-ratio) * var(--spacing-scale-ratio) * var(--spacing-scale-ratio)); 73 | 74 | --border-radius-base-size: 3px; 75 | } 76 | -------------------------------------------------------------------------------- /data/templates/woocommerce/file.html.twig: -------------------------------------------------------------------------------- 1 | {% extends 'base.html.twig' %} 2 | 3 | {% block javascripts %} 4 | 5 | 10 | {% endblock %} 11 | 12 | {% block content %} 13 | {% include('components/breadcrumbs.html.twig') %} 14 | 15 |
16 | {{ include('components/file-title.html.twig') }} 17 | {# {{ include('components/table-of-contents.html.twig') }} #} 18 | {{ include('components/constants.html.twig') }} 19 | {{ include('components/functions.html.twig') }} 20 | {% if project.settings.shouldIncludeSource %} 21 |

22 | Source code 23 | 24 |

25 |
{{ node.source|raw|escape }}
26 | {% endif %} 27 |
28 | {% endblock %} 29 | -------------------------------------------------------------------------------- /data/templates/woocommerce/graphs/class.html.twig: -------------------------------------------------------------------------------- 1 | {% extends 'base.html.twig' %} 2 | 3 | {% block stylesheets %} 4 | {% endblock %} 5 | 6 | {% block javascripts %} 7 | 8 | {% endblock %} 9 | 10 | {% block content %} 11 |
12 | 13 |
14 | 22 | {% endblock %} 23 | -------------------------------------------------------------------------------- /data/templates/woocommerce/hooks/hooks.html.twig: -------------------------------------------------------------------------------- 1 | {% extends 'base.html.twig' %} 2 | 3 | {% block content %} 4 |
5 |

Action and Filter Hook Reference

6 |

This is simply a list of action and filter hooks found within WooCommerce files. View the source to see supported params and usage.

7 | 8 |
9 | {% endblock %} 10 | -------------------------------------------------------------------------------- /data/templates/woocommerce/icons/constant.svg.twig: -------------------------------------------------------------------------------- 1 | 2 | -------------------------------------------------------------------------------- /data/templates/woocommerce/icons/method.svg.twig: -------------------------------------------------------------------------------- 1 | 2 | -------------------------------------------------------------------------------- /data/templates/woocommerce/icons/private.svg.twig: -------------------------------------------------------------------------------- 1 | 2 | -------------------------------------------------------------------------------- /data/templates/woocommerce/icons/protected.svg.twig: -------------------------------------------------------------------------------- 1 | 2 | -------------------------------------------------------------------------------- /data/templates/woocommerce/icons/wp.svg.twig: -------------------------------------------------------------------------------- 1 | 2 | -------------------------------------------------------------------------------- /data/templates/woocommerce/images/favicon-180x180.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/woocommerce/code-reference/50024db3aae5d1b8d98e8b0dd48c221eba029d42/data/templates/woocommerce/images/favicon-180x180.png -------------------------------------------------------------------------------- /data/templates/woocommerce/images/favicon-192x192.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/woocommerce/code-reference/50024db3aae5d1b8d98e8b0dd48c221eba029d42/data/templates/woocommerce/images/favicon-192x192.png -------------------------------------------------------------------------------- /data/templates/woocommerce/images/favicon-32x32.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/woocommerce/code-reference/50024db3aae5d1b8d98e8b0dd48c221eba029d42/data/templates/woocommerce/images/favicon-32x32.png -------------------------------------------------------------------------------- /data/templates/woocommerce/images/logo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/woocommerce/code-reference/50024db3aae5d1b8d98e8b0dd48c221eba029d42/data/templates/woocommerce/images/logo.png -------------------------------------------------------------------------------- /data/templates/woocommerce/index.html.twig: -------------------------------------------------------------------------------- 1 | {% extends 'base.html.twig' %} 2 | 3 | {% block content %} 4 |

Documentation

5 | 6 | {% set node = project.namespace %} 7 | 8 | {{ 9 | include( 10 | 'components/table-of-contents.html.twig', 11 | { 12 | 'node': project.namespace, 13 | 'namespaces': usesNamespaces or not usesPackages ? node.children : [], 14 | 'packages': usesPackages ? project.package.children : [] 15 | } 16 | ) 17 | }} 18 | {{ include('components/constants.html.twig', {'node': project.namespace}) }} 19 | {{ include('components/functions.html.twig', {'node': project.namespace}) }} 20 | {% endblock %} 21 | -------------------------------------------------------------------------------- /data/templates/woocommerce/indices/files.html.twig: -------------------------------------------------------------------------------- 1 | {% extends 'base.html.twig' %} 2 | 3 | {% block content %} 4 | {% set orderedFiles = project.files|sort((a,b) => a.name <=> b.name) %} 5 | 6 |

Files

7 | {% for letter in range('a', 'z') %} 8 | {% set filesStartingWith = orderedFiles|filter(v => v.name|first|lower == letter) %} 9 | {% if filesStartingWith is not empty %} 10 |

{{ letter|upper }}

11 |
    12 | {% for file in filesStartingWith %} 13 |
  • {{ file|route('file:short') }}
  • 14 | {% endfor %} 15 |
16 | {% endif %} 17 | {% endfor %} 18 | {% endblock %} 19 | -------------------------------------------------------------------------------- /data/templates/woocommerce/interface.html.twig: -------------------------------------------------------------------------------- 1 | {% extends 'base.html.twig' %} 2 | 3 | {% block content %} 4 | {% include 'components/breadcrumbs.html.twig' %} 5 | 6 |
7 | {{ include('components/interface-title.html.twig') }} 8 | {{ include('components/element-found-in.html.twig') }} 9 | {{ include('components/element-header.html.twig') }} 10 | 11 | {{ include('components/constants.html.twig') }} 12 | {{ include('components/methods.html.twig') }} 13 |
14 | {% endblock %} 15 | -------------------------------------------------------------------------------- /data/templates/woocommerce/js/prism.js: -------------------------------------------------------------------------------- 1 | /* PrismJS 1.21.0 2 | https://prismjs.com/download.html#themes=prism-coy&languages=markup+css+clike+javascript+javadoclike+markup-templating+php+phpdoc+php-extras&plugins=line-highlight+line-numbers */ 3 | var _self="undefined"!=typeof window?window:"undefined"!=typeof WorkerGlobalScope&&self instanceof WorkerGlobalScope?self:{},Prism=function(u){var c=/\blang(?:uage)?-([\w-]+)\b/i,n=0,M={manual:u.Prism&&u.Prism.manual,disableWorkerMessageHandler:u.Prism&&u.Prism.disableWorkerMessageHandler,util:{encode:function e(n){return n instanceof W?new W(n.type,e(n.content),n.alias):Array.isArray(n)?n.map(e):n.replace(/&/g,"&").replace(/=l.reach);k+=y.value.length,y=y.next){var b=y.value;if(t.length>n.length)return;if(!(b instanceof W)){var x=1;if(h&&y!=t.tail.prev){m.lastIndex=k;var w=m.exec(n);if(!w)break;var A=w.index+(f&&w[1]?w[1].length:0),P=w.index+w[0].length,S=k;for(S+=y.value.length;S<=A;)y=y.next,S+=y.value.length;if(S-=y.value.length,k=S,y.value instanceof W)continue;for(var E=y;E!==t.tail&&(Sl.reach&&(l.reach=j);var C=y.prev;L&&(C=I(t,C,L),k+=L.length),z(t,C,x);var _=new W(o,g?M.tokenize(O,g):O,v,O);y=I(t,C,_),N&&I(t,y,N),1"+a.content+""},!u.document)return u.addEventListener&&(M.disableWorkerMessageHandler||u.addEventListener("message",function(e){var n=JSON.parse(e.data),t=n.language,r=n.code,a=n.immediateClose;u.postMessage(M.highlight(r,M.languages[t],t)),a&&u.close()},!1)),M;var e=M.util.currentScript();function t(){M.manual||M.highlightAll()}if(e&&(M.filename=e.src,e.hasAttribute("data-manual")&&(M.manual=!0)),!M.manual){var r=document.readyState;"loading"===r||"interactive"===r&&e&&e.defer?document.addEventListener("DOMContentLoaded",t):window.requestAnimationFrame?window.requestAnimationFrame(t):window.setTimeout(t,16)}return M}(_self);"undefined"!=typeof module&&module.exports&&(module.exports=Prism),"undefined"!=typeof global&&(global.Prism=Prism); 4 | Prism.languages.markup={comment://,prolog:/<\?[\s\S]+?\?>/,doctype:{pattern:/"'[\]]|"[^"]*"|'[^']*')+(?:\[(?:[^<"'\]]|"[^"]*"|'[^']*'|<(?!!--)|)*\]\s*)?>/i,greedy:!0,inside:{"internal-subset":{pattern:/(\[)[\s\S]+(?=\]>$)/,lookbehind:!0,greedy:!0,inside:null},string:{pattern:/"[^"]*"|'[^']*'/,greedy:!0},punctuation:/^$|[[\]]/,"doctype-tag":/^DOCTYPE/,name:/[^\s<>'"]+/}},cdata://i,tag:{pattern:/<\/?(?!\d)[^\s>\/=$<%]+(?:\s(?:\s*[^\s>\/=]+(?:\s*=\s*(?:"[^"]*"|'[^']*'|[^\s'">=]+(?=[\s>]))|(?=[\s/>])))+)?\s*\/?>/,greedy:!0,inside:{tag:{pattern:/^<\/?[^\s>\/]+/,inside:{punctuation:/^<\/?/,namespace:/^[^\s>\/:]+:/}},"attr-value":{pattern:/=\s*(?:"[^"]*"|'[^']*'|[^\s'">=]+)/,inside:{punctuation:[{pattern:/^=/,alias:"attr-equals"},/"|'/]}},punctuation:/\/?>/,"attr-name":{pattern:/[^\s>\/]+/,inside:{namespace:/^[^\s>\/:]+:/}}}},entity:[{pattern:/&[\da-z]{1,8};/i,alias:"named-entity"},/&#x?[\da-f]{1,8};/i]},Prism.languages.markup.tag.inside["attr-value"].inside.entity=Prism.languages.markup.entity,Prism.languages.markup.doctype.inside["internal-subset"].inside=Prism.languages.markup,Prism.hooks.add("wrap",function(a){"entity"===a.type&&(a.attributes.title=a.content.replace(/&/,"&"))}),Object.defineProperty(Prism.languages.markup.tag,"addInlined",{value:function(a,e){var s={};s["language-"+e]={pattern:/(^$)/i,lookbehind:!0,inside:Prism.languages[e]},s.cdata=/^$/i;var n={"included-cdata":{pattern://i,inside:s}};n["language-"+e]={pattern:/[\s\S]+/,inside:Prism.languages[e]};var t={};t[a]={pattern:RegExp("(<__[^]*?>)(?:))*\\]\\]>|(?!)".replace(/__/g,function(){return a}),"i"),lookbehind:!0,greedy:!0,inside:n},Prism.languages.insertBefore("markup","cdata",t)}}),Prism.languages.html=Prism.languages.markup,Prism.languages.mathml=Prism.languages.markup,Prism.languages.svg=Prism.languages.markup,Prism.languages.xml=Prism.languages.extend("markup",{}),Prism.languages.ssml=Prism.languages.xml,Prism.languages.atom=Prism.languages.xml,Prism.languages.rss=Prism.languages.xml; 5 | !function(e){var s=/("|')(?:\\(?:\r\n|[\s\S])|(?!\1)[^\\\r\n])*\1/;e.languages.css={comment:/\/\*[\s\S]*?\*\//,atrule:{pattern:/@[\w-]+[\s\S]*?(?:;|(?=\s*\{))/,inside:{rule:/^@[\w-]+/,"selector-function-argument":{pattern:/(\bselector\s*\((?!\s*\))\s*)(?:[^()]|\((?:[^()]|\([^()]*\))*\))+?(?=\s*\))/,lookbehind:!0,alias:"selector"},keyword:{pattern:/(^|[^\w-])(?:and|not|only|or)(?![\w-])/,lookbehind:!0}}},url:{pattern:RegExp("\\burl\\((?:"+s.source+"|(?:[^\\\\\r\n()\"']|\\\\[^])*)\\)","i"),greedy:!0,inside:{function:/^url/i,punctuation:/^\(|\)$/,string:{pattern:RegExp("^"+s.source+"$"),alias:"url"}}},selector:RegExp("[^{}\\s](?:[^{};\"']|"+s.source+")*?(?=\\s*\\{)"),string:{pattern:s,greedy:!0},property:/[-_a-z\xA0-\uFFFF][-\w\xA0-\uFFFF]*(?=\s*:)/i,important:/!important\b/i,function:/[-a-z0-9]+(?=\()/i,punctuation:/[(){};:,]/},e.languages.css.atrule.inside.rest=e.languages.css;var t=e.languages.markup;t&&(t.tag.addInlined("style","css"),e.languages.insertBefore("inside","attr-value",{"style-attr":{pattern:/\s*style=("|')(?:\\[\s\S]|(?!\1)[^\\])*\1/i,inside:{"attr-name":{pattern:/^\s*style/i,inside:t.tag.inside},punctuation:/^\s*=\s*['"]|['"]\s*$/,"attr-value":{pattern:/.+/i,inside:e.languages.css}},alias:"language-css"}},t.tag))}(Prism); 6 | Prism.languages.clike={comment:[{pattern:/(^|[^\\])\/\*[\s\S]*?(?:\*\/|$)/,lookbehind:!0},{pattern:/(^|[^\\:])\/\/.*/,lookbehind:!0,greedy:!0}],string:{pattern:/(["'])(?:\\(?:\r\n|[\s\S])|(?!\1)[^\\\r\n])*\1/,greedy:!0},"class-name":{pattern:/(\b(?:class|interface|extends|implements|trait|instanceof|new)\s+|\bcatch\s+\()[\w.\\]+/i,lookbehind:!0,inside:{punctuation:/[.\\]/}},keyword:/\b(?:if|else|while|do|for|return|in|instanceof|function|new|try|throw|catch|finally|null|break|continue)\b/,boolean:/\b(?:true|false)\b/,function:/\w+(?=\()/,number:/\b0x[\da-f]+\b|(?:\b\d+\.?\d*|\B\.\d+)(?:e[+-]?\d+)?/i,operator:/[<>]=?|[!=]=?=?|--?|\+\+?|&&?|\|\|?|[?*/~^%]/,punctuation:/[{}[\];(),.:]/}; 7 | Prism.languages.javascript=Prism.languages.extend("clike",{"class-name":[Prism.languages.clike["class-name"],{pattern:/(^|[^$\w\xA0-\uFFFF])[_$A-Z\xA0-\uFFFF][$\w\xA0-\uFFFF]*(?=\.(?:prototype|constructor))/,lookbehind:!0}],keyword:[{pattern:/((?:^|})\s*)(?:catch|finally)\b/,lookbehind:!0},{pattern:/(^|[^.]|\.\.\.\s*)\b(?:as|async(?=\s*(?:function\b|\(|[$\w\xA0-\uFFFF]|$))|await|break|case|class|const|continue|debugger|default|delete|do|else|enum|export|extends|for|from|function|(?:get|set)(?=\s*[\[$\w\xA0-\uFFFF])|if|implements|import|in|instanceof|interface|let|new|null|of|package|private|protected|public|return|static|super|switch|this|throw|try|typeof|undefined|var|void|while|with|yield)\b/,lookbehind:!0}],number:/\b(?:(?:0[xX](?:[\dA-Fa-f](?:_[\dA-Fa-f])?)+|0[bB](?:[01](?:_[01])?)+|0[oO](?:[0-7](?:_[0-7])?)+)n?|(?:\d(?:_\d)?)+n|NaN|Infinity)\b|(?:\b(?:\d(?:_\d)?)+\.?(?:\d(?:_\d)?)*|\B\.(?:\d(?:_\d)?)+)(?:[Ee][+-]?(?:\d(?:_\d)?)+)?/,function:/#?[_$a-zA-Z\xA0-\uFFFF][$\w\xA0-\uFFFF]*(?=\s*(?:\.\s*(?:apply|bind|call)\s*)?\()/,operator:/--|\+\+|\*\*=?|=>|&&=?|\|\|=?|[!=]==|<<=?|>>>?=?|[-+*/%&|^!=<>]=?|\.{3}|\?\?=?|\?\.?|[~:]/}),Prism.languages.javascript["class-name"][0].pattern=/(\b(?:class|interface|extends|implements|instanceof|new)\s+)[\w.\\]+/,Prism.languages.insertBefore("javascript","keyword",{regex:{pattern:/((?:^|[^$\w\xA0-\uFFFF."'\])\s]|\b(?:return|yield))\s*)\/(?:\[(?:[^\]\\\r\n]|\\.)*]|\\.|[^/\\\[\r\n])+\/[gimyus]{0,6}(?=(?:\s|\/\*(?:[^*]|\*(?!\/))*\*\/)*(?:$|[\r\n,.;:})\]]|\/\/))/,lookbehind:!0,greedy:!0,inside:{"regex-source":{pattern:/^(\/)[\s\S]+(?=\/[a-z]*$)/,lookbehind:!0,alias:"language-regex",inside:Prism.languages.regex},"regex-flags":/[a-z]+$/,"regex-delimiter":/^\/|\/$/}},"function-variable":{pattern:/#?[_$a-zA-Z\xA0-\uFFFF][$\w\xA0-\uFFFF]*(?=\s*[=:]\s*(?:async\s*)?(?:\bfunction\b|(?:\((?:[^()]|\([^()]*\))*\)|[_$a-zA-Z\xA0-\uFFFF][$\w\xA0-\uFFFF]*)\s*=>))/,alias:"function"},parameter:[{pattern:/(function(?:\s+[_$A-Za-z\xA0-\uFFFF][$\w\xA0-\uFFFF]*)?\s*\(\s*)(?!\s)(?:[^()]|\([^()]*\))+?(?=\s*\))/,lookbehind:!0,inside:Prism.languages.javascript},{pattern:/[_$a-z\xA0-\uFFFF][$\w\xA0-\uFFFF]*(?=\s*=>)/i,inside:Prism.languages.javascript},{pattern:/(\(\s*)(?!\s)(?:[^()]|\([^()]*\))+?(?=\s*\)\s*=>)/,lookbehind:!0,inside:Prism.languages.javascript},{pattern:/((?:\b|\s|^)(?!(?:as|async|await|break|case|catch|class|const|continue|debugger|default|delete|do|else|enum|export|extends|finally|for|from|function|get|if|implements|import|in|instanceof|interface|let|new|null|of|package|private|protected|public|return|set|static|super|switch|this|throw|try|typeof|undefined|var|void|while|with|yield)(?![$\w\xA0-\uFFFF]))(?:[_$A-Za-z\xA0-\uFFFF][$\w\xA0-\uFFFF]*\s*)\(\s*|\]\s*\(\s*)(?!\s)(?:[^()]|\([^()]*\))+?(?=\s*\)\s*\{)/,lookbehind:!0,inside:Prism.languages.javascript}],constant:/\b[A-Z](?:[A-Z_]|\dx?)*\b/}),Prism.languages.insertBefore("javascript","string",{"template-string":{pattern:/`(?:\\[\s\S]|\${(?:[^{}]|{(?:[^{}]|{[^}]*})*})+}|(?!\${)[^\\`])*`/,greedy:!0,inside:{"template-punctuation":{pattern:/^`|`$/,alias:"string"},interpolation:{pattern:/((?:^|[^\\])(?:\\{2})*)\${(?:[^{}]|{(?:[^{}]|{[^}]*})*})+}/,lookbehind:!0,inside:{"interpolation-punctuation":{pattern:/^\${|}$/,alias:"punctuation"},rest:Prism.languages.javascript}},string:/[\s\S]+/}}}),Prism.languages.markup&&Prism.languages.markup.tag.addInlined("script","javascript"),Prism.languages.js=Prism.languages.javascript; 8 | !function(h){function v(e,n){return"___"+e.toUpperCase()+n+"___"}Object.defineProperties(h.languages["markup-templating"]={},{buildPlaceholders:{value:function(a,r,e,o){if(a.language===r){var c=a.tokenStack=[];a.code=a.code.replace(e,function(e){if("function"==typeof o&&!o(e))return e;for(var n,t=c.length;-1!==a.code.indexOf(n=v(r,t));)++t;return c[t]=e,n}),a.grammar=h.languages.markup}}},tokenizePlaceholders:{value:function(p,k){if(p.language===k&&p.tokenStack){p.grammar=h.languages[k];var m=0,d=Object.keys(p.tokenStack);!function e(n){for(var t=0;t=d.length);t++){var a=n[t];if("string"==typeof a||a.content&&"string"==typeof a.content){var r=d[m],o=p.tokenStack[r],c="string"==typeof a?a:a.content,i=v(k,r),u=c.indexOf(i);if(-1$|^<\?(?:php(?=\s)|=)?/i,alias:"important"}}),n.languages.insertBefore("php","keyword",{variable:/\$+(?:\w+\b|(?={))/i,package:{pattern:/(\\|namespace\s+|use\s+)[\w\\]+/,lookbehind:!0,inside:{punctuation:/\\/}}}),n.languages.insertBefore("php","operator",{property:{pattern:/(->)[\w]+/,lookbehind:!0}});var e={pattern:/{\$(?:{(?:{[^{}]+}|[^{}]+)}|[^{}])+}|(^|[^\\{])\$+(?:\w+(?:\[[^\r\n\[\]]+\]|->\w+)*)/,lookbehind:!0,inside:n.languages.php};n.languages.insertBefore("php","string",{"nowdoc-string":{pattern:/<<<'([^']+)'[\r\n](?:.*[\r\n])*?\1;/,greedy:!0,alias:"string",inside:{delimiter:{pattern:/^<<<'[^']+'|[a-z_]\w*;$/i,alias:"symbol",inside:{punctuation:/^<<<'?|[';]$/}}}},"heredoc-string":{pattern:/<<<(?:"([^"]+)"[\r\n](?:.*[\r\n])*?\1;|([a-z_]\w*)[\r\n](?:.*[\r\n])*?\2;)/i,greedy:!0,alias:"string",inside:{delimiter:{pattern:/^<<<(?:"[^"]+"|[a-z_]\w*)|[a-z_]\w*;$/i,alias:"symbol",inside:{punctuation:/^<<<"?|[";]$/}},interpolation:e}},"single-quoted-string":{pattern:/'(?:\\[\s\S]|[^\\'])*'/,greedy:!0,alias:"string"},"double-quoted-string":{pattern:/"(?:\\[\s\S]|[^\\"])*"/,greedy:!0,alias:"string",inside:{interpolation:e}}}),delete n.languages.php.string,n.hooks.add("before-tokenize",function(e){if(/<\?/.test(e.code)){n.languages["markup-templating"].buildPlaceholders(e,"php",/<\?(?:[^"'/#]|\/(?![*/])|("|')(?:\\[\s\S]|(?!\1)[^\\])*\1|(?:\/\/|#)(?:[^?\n\r]|\?(?!>))*(?=$|\?>|[\r\n])|\/\*[\s\S]*?(?:\*\/|$))*?(?:\?>|$)/gi)}}),n.hooks.add("after-tokenize",function(e){n.languages["markup-templating"].tokenizePlaceholders(e,"php")})}(Prism); 10 | !function(p){var a=p.languages.javadoclike={parameter:{pattern:/(^\s*(?:\/{3}|\*|\/\*\*)\s*@(?:param|arg|arguments)\s+)\w+/m,lookbehind:!0},keyword:{pattern:/(^\s*(?:\/{3}|\*|\/\*\*)\s*|\{)@[a-z][a-zA-Z-]+\b/m,lookbehind:!0},punctuation:/[{}]/};Object.defineProperty(a,"addSupport",{value:function(a,e){"string"==typeof a&&(a=[a]),a.forEach(function(a){!function(a,e){var n="doc-comment",t=p.languages[a];if(t){var r=t[n];if(!r){var o={"doc-comment":{pattern:/(^|[^\\])\/\*\*[^/][\s\S]*?(?:\*\/|$)/,lookbehind:!0,alias:"comment"}};r=(t=p.languages.insertBefore(a,"comment",o))[n]}if(r instanceof RegExp&&(r=t[n]={pattern:r}),Array.isArray(r))for(var i=0,s=r.length;i ",document.body.appendChild(e),t=38===e.offsetHeight,document.body.removeChild(e)}return t},l=!0,a=0;Prism.hooks.add("before-sanity-check",function(e){var t=e.element.parentNode,n=t&&t.getAttribute("data-line");if(t&&n&&/pre/i.test(t.nodeName)){var i=0;g(".line-highlight",t).forEach(function(e){i+=e.textContent.length,e.parentNode.removeChild(e)}),i&&/^( \n)+$/.test(e.code.slice(-i))&&(e.code=e.code.slice(0,-i))}}),Prism.hooks.add("complete",function e(t){var n=t.element.parentNode,i=n&&n.getAttribute("data-line");if(n&&i&&/pre/i.test(n.nodeName)){clearTimeout(a);var r=Prism.plugins.lineNumbers,o=t.plugins&&t.plugins.lineNumbers;if(b(n,"line-numbers")&&r&&!o)Prism.hooks.add("line-numbers",e);else u(n,i)(),a=setTimeout(c,1)}}),window.addEventListener("hashchange",c),window.addEventListener("resize",function(){g("pre[data-line]").map(function(e){return u(e)}).forEach(v)})}function g(e,t){return Array.prototype.slice.call((t||document).querySelectorAll(e))}function b(e,t){return t=" "+t+" ",-1<(" "+e.className+" ").replace(/[\n\t]/g," ").indexOf(t)}function v(e){e()}function u(u,e,c){var t=(e="string"==typeof e?e:u.getAttribute("data-line")).replace(/\s+/g,"").split(",").filter(Boolean),d=+u.getAttribute("data-line-offset")||0,f=(s()?parseInt:parseFloat)(getComputedStyle(u).lineHeight),m=b(u,"line-numbers"),p=m?u:u.querySelector("code")||u,h=[];t.forEach(function(e){var t=e.split("-"),n=+t[0],i=+t[1]||n,r=u.querySelector('.line-highlight[data-range="'+e+'"]')||document.createElement("div");if(h.push(function(){r.setAttribute("aria-hidden","true"),r.setAttribute("data-range",e),r.className=(c||"")+" line-highlight"}),m&&Prism.plugins.lineNumbers){var o=Prism.plugins.lineNumbers.getLine(u,n),a=Prism.plugins.lineNumbers.getLine(u,i);if(o){var s=o.offsetTop+"px";h.push(function(){r.style.top=s})}if(a){var l=a.offsetTop-o.offsetTop+a.offsetHeight+"px";h.push(function(){r.style.height=l})}}else h.push(function(){r.setAttribute("data-start",n),n span",u).forEach(function(e,t){var n=t+a;e.onclick=function(){var e=i+"."+n;l=!1,location.hash=e,setTimeout(function(){l=!0},1)}})}}return function(){h.forEach(v)}}function c(){var e=location.hash.slice(1);g(".temporary.line-highlight").forEach(function(e){e.parentNode.removeChild(e)});var t=(e.match(/\.([\d,-]+)$/)||[,""])[1];if(t&&!document.getElementById(e)){var n=e.slice(0,e.lastIndexOf(".")),i=document.getElementById(n);if(i)i.hasAttribute("data-line")||i.setAttribute("data-line",""),u(i,t,"temporary ")(),l&&document.querySelector(".temporary.line-highlight").scrollIntoView()}}}(); 14 | !function(){if("undefined"!=typeof self&&self.Prism&&self.document){var o="line-numbers",a=/\n(?!$)/g,e=Prism.plugins.lineNumbers={getLine:function(e,n){if("PRE"===e.tagName&&e.classList.contains(o)){var t=e.querySelector(".line-numbers-rows"),i=parseInt(e.getAttribute("data-start"),10)||1,r=i+(t.children.length-1);n");(i=document.createElement("span")).setAttribute("aria-hidden","true"),i.className="line-numbers-rows",i.innerHTML=l,t.hasAttribute("data-start")&&(t.style.counterReset="linenumber "+(parseInt(t.getAttribute("data-start"),10)-1)),e.element.appendChild(i),u([t]),Prism.hooks.run("line-numbers",e)}}}),Prism.hooks.add("line-numbers",function(e){e.plugins=e.plugins||{},e.plugins.lineNumbers=!0})}function u(e){if(0!=(e=e.filter(function(e){var n=t(e)["white-space"];return"pre-wrap"===n||"pre-line"===n})).length){var n=e.map(function(e){var n=e.querySelector("code"),t=e.querySelector(".line-numbers-rows");if(n&&t){var i=e.querySelector(".line-numbers-sizer"),r=n.textContent.split(a);i||((i=document.createElement("span")).className="line-numbers-sizer",n.appendChild(i)),i.innerHTML="0",i.style.display="block";var s=i.getBoundingClientRect().height;return i.innerHTML="",{element:e,lines:r,lineHeights:[],oneLinerHeight:s,sizer:i}}}).filter(Boolean);n.forEach(function(e){var i=e.sizer,n=e.lines,r=e.lineHeights,s=e.oneLinerHeight;r[n.length-1]=void 0,n.forEach(function(e,n){if(e&&1 2 | 3 | 4 | 5 | {% block title %}{{ project.name }}{% endblock %} 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | {% block stylesheets %} 16 | {% endblock %} 17 | 18 | 19 | 20 | {% include 'components/analytics-tracking.html.twig' %} 21 | {% block javascripts %} 22 | {% endblock %} 23 | 24 | 25 | {% include 'components/header.html.twig' %} 26 | 27 |
28 |
29 | {% include 'components/sidebar.html.twig' %} 30 | 31 |
32 | {% block content %}{% endblock %} 33 |
34 |
35 | {{ include('components/back-to-top.html.twig') }} 36 |
37 | 38 | {% include 'components/footer.html.twig' %} 39 | 40 | 43 | 48 | 49 | 50 | 51 | 52 | -------------------------------------------------------------------------------- /data/templates/woocommerce/menu.html.twig: -------------------------------------------------------------------------------- 1 | {% if isChild|default(false) == false %} 2 |

3 | {% endif %} 4 | {{ menuItem.label }} 5 | {% if isChild|default(false) == false %} 6 |

7 | {% endif %} 8 | 9 | {% if menuItem.items is not empty %} 10 |
    11 | {% for child in menuItem.items|default([]) %} 12 |
  • 13 | {{ include('menu.html.twig', {menuItem: child, isChild: true}, with_context = false) }} 14 |
  • 15 | {% endfor %} 16 |
17 | {% endif %} 18 | -------------------------------------------------------------------------------- /data/templates/woocommerce/namespace.html.twig: -------------------------------------------------------------------------------- 1 | {% extends 'base.html.twig' %} 2 | 3 | {% block content %} 4 | {% include 'components/breadcrumbs.html.twig' %} 5 | 6 |
7 | {{ include('components/namespace-title.html.twig') }} 8 | {{ include('components/table-of-contents.html.twig', {'namespaces': node.children}) }} 9 | {{ include('components/constants.html.twig') }} 10 | {{ include('components/functions.html.twig') }} 11 |
12 | {% endblock %} 13 | -------------------------------------------------------------------------------- /data/templates/woocommerce/objects/blockquote.css.twig: -------------------------------------------------------------------------------- 1 | .phpdocumentor blockquote { 2 | margin-bottom: var(--spacing-md); 3 | } 4 | -------------------------------------------------------------------------------- /data/templates/woocommerce/objects/buttons.css.twig: -------------------------------------------------------------------------------- 1 | .phpdocumentor-button { 2 | background-color: var(--button-color); 3 | border: 1px solid var(--button-border-color); 4 | border-radius: var(--border-radius-base-size); 5 | box-sizing: border-box; 6 | color: var(--button-text-color); 7 | cursor: pointer; 8 | display: inline-block; 9 | font-size: var(--text-sm); 10 | font-weight: 600; 11 | height: 38px; 12 | letter-spacing: .1rem; 13 | line-height: 38px; 14 | padding: 0 var(--spacing-xxl); 15 | text-align: center; 16 | text-decoration: none; 17 | text-transform: uppercase; 18 | white-space: nowrap; 19 | margin-bottom: var(--spacing-md); 20 | } 21 | 22 | .phpdocumentor-button .-wide { 23 | width: 100%; 24 | } 25 | 26 | .phpdocumentor-button:hover, 27 | .phpdocumentor-button:focus { 28 | border-color: #888; 29 | color: #333; 30 | outline: 0; 31 | } 32 | 33 | .phpdocumentor-button.-primary { 34 | background-color: var(--button-color-primary); 35 | border-color: var(--button-color-primary); 36 | color: var(--button-text-color-primary); 37 | } 38 | 39 | .phpdocumentor-button.-primary:hover, 40 | .phpdocumentor-button.-primary:focus { 41 | background-color: var(--link-color-primary); 42 | border-color: var(--link-color-primary); 43 | color: var(--button-text-color-primary); 44 | } 45 | -------------------------------------------------------------------------------- /data/templates/woocommerce/objects/code.css.twig: -------------------------------------------------------------------------------- 1 | .phpdocumentor pre { 2 | margin-bottom: var(--spacing-md); 3 | } 4 | 5 | .phpdocumentor-code { 6 | background: var(--code-background-color); 7 | border: 1px solid var(--code-border-color); 8 | border-radius: var(--border-radius-base-size); 9 | font-size: var(--text-sm); 10 | padding: var(--spacing-sm) var(--spacing-md); 11 | width: 100%; 12 | box-sizing: border-box; 13 | } 14 | 15 | pre > .phpdocumentor-code { 16 | display: block; 17 | white-space: pre; 18 | } 19 | -------------------------------------------------------------------------------- /data/templates/woocommerce/objects/forms.css.twig: -------------------------------------------------------------------------------- 1 | .phpdocumentor form { 2 | margin-bottom: var(--spacing-md); 3 | } 4 | 5 | .phpdocumentor-field { 6 | background-color: var(--form-field-color); 7 | border: 1px solid var(--form-field-border-color); 8 | border-radius: var(--border-radius-base-size); 9 | box-shadow: none; 10 | box-sizing: border-box; 11 | height: 38px; 12 | padding: var(--spacing-xxxs) var(--spacing-xxs); /* The 6px vertically centers text on FF, ignored by Webkit */ 13 | margin-bottom: var(--spacing-md); 14 | } 15 | 16 | /* Removes awkward default styles on some inputs for iOS */ 17 | input[type="email"], 18 | input[type="number"], 19 | input[type="search"], 20 | input[type="text"], 21 | input[type="tel"], 22 | input[type="url"], 23 | input[type="password"], 24 | textarea { 25 | -moz-appearance: none; 26 | -webkit-appearance: none; 27 | appearance: none; 28 | } 29 | 30 | .phpdocumentor-textarea { 31 | min-height: 65px; 32 | padding-bottom: var(--spacing-xxxs); 33 | padding-top: var(--spacing-xxxs); 34 | } 35 | 36 | .phpdocumentor-field:focus { 37 | border: 1px solid var(--button-color-primary); 38 | outline: 0; 39 | } 40 | 41 | .phpdocumentor-label { 42 | display: block; 43 | margin-bottom: var(--spacing-xs); 44 | } 45 | 46 | .phpdocumentor-fieldset { 47 | border-width: 0; 48 | padding: 0; 49 | } 50 | 51 | input[type="checkbox"].phpdocumentor-field, 52 | input[type="radio"].phpdocumentor-field { 53 | display: inline; 54 | } 55 | -------------------------------------------------------------------------------- /data/templates/woocommerce/objects/grid.css.twig: -------------------------------------------------------------------------------- 1 | .phpdocumentor-column { 2 | box-sizing: border-box; 3 | float: left; 4 | width: 100%; 5 | } 6 | 7 | @media (min-width: {{ breakpoints['md'] }}) { 8 | .phpdocumentor-column { 9 | margin-left: 4%; 10 | } 11 | 12 | .phpdocumentor-column:first-child { 13 | margin-left: 0; 14 | } 15 | 16 | .-one.phpdocumentor-column { 17 | width: 4.66666666667%; 18 | } 19 | 20 | .-two.phpdocumentor-column { 21 | width: 13.3333333333%; 22 | } 23 | 24 | .-three.phpdocumentor-column { 25 | width: 22%; 26 | } 27 | 28 | .-four.phpdocumentor-column { 29 | width: 30.6666666667%; 30 | } 31 | 32 | .-five.phpdocumentor-column { 33 | width: 39.3333333333%; 34 | } 35 | 36 | .-six.phpdocumentor-column { 37 | width: 48%; 38 | } 39 | 40 | .-seven.phpdocumentor-column { 41 | width: 56.6666666667%; 42 | } 43 | 44 | .-eight.phpdocumentor-column { 45 | width: 65.3333333333%; 46 | } 47 | 48 | .-nine.phpdocumentor-column { 49 | width: 74.0%; 50 | } 51 | 52 | .-ten.phpdocumentor-column { 53 | width: 82.6666666667%; 54 | } 55 | 56 | .-eleven.phpdocumentor-column { 57 | width: 91.3333333333%; 58 | } 59 | 60 | .-twelve.phpdocumentor-column { 61 | margin-left: 0; 62 | width: 100%; 63 | } 64 | 65 | .-one-third.phpdocumentor-column { 66 | width: 30.6666666667%; 67 | } 68 | 69 | .-two-thirds.phpdocumentor-column { 70 | width: 65.3333333333%; 71 | } 72 | 73 | .-one-half.phpdocumentor-column { 74 | width: 48%; 75 | } 76 | 77 | /* Offsets */ 78 | .-offset-by-one.phpdocumentor-column { 79 | margin-left: 8.66666666667%; 80 | } 81 | 82 | .-offset-by-two.phpdocumentor-column { 83 | margin-left: 17.3333333333%; 84 | } 85 | 86 | .-offset-by-three.phpdocumentor-column { 87 | margin-left: 26%; 88 | } 89 | 90 | .-offset-by-four.phpdocumentor-column { 91 | margin-left: 34.6666666667%; 92 | } 93 | 94 | .-offset-by-five.phpdocumentor-column { 95 | margin-left: 43.3333333333%; 96 | } 97 | 98 | .-offset-by-six.phpdocumentor-column { 99 | margin-left: 52%; 100 | } 101 | 102 | .-offset-by-seven.phpdocumentor-column { 103 | margin-left: 60.6666666667%; 104 | } 105 | 106 | .-offset-by-eight.phpdocumentor-column { 107 | margin-left: 69.3333333333%; 108 | } 109 | 110 | .-offset-by-nine.phpdocumentor-column { 111 | margin-left: 78.0%; 112 | } 113 | 114 | .-offset-by-ten.phpdocumentor-column { 115 | margin-left: 86.6666666667%; 116 | } 117 | 118 | .-offset-by-eleven.phpdocumentor-column { 119 | margin-left: 95.3333333333%; 120 | } 121 | 122 | .-offset-by-one-third.phpdocumentor-column { 123 | margin-left: 34.6666666667%; 124 | } 125 | 126 | .-offset-by-two-thirds.phpdocumentor-column { 127 | margin-left: 69.3333333333%; 128 | } 129 | 130 | .-offset-by-one-half.phpdocumentor-column { 131 | margin-left: 52%; 132 | } 133 | } 134 | -------------------------------------------------------------------------------- /data/templates/woocommerce/objects/headings.css.twig: -------------------------------------------------------------------------------- 1 | .phpdocumentor h1, 2 | .phpdocumentor h2, 3 | .phpdocumentor h3, 4 | .phpdocumentor h4, 5 | .phpdocumentor h5, 6 | .phpdocumentor h6 { 7 | margin-bottom: var(--spacing-lg); 8 | margin-top: var(--spacing-lg); 9 | font-weight: 600; 10 | } 11 | 12 | .phpdocumentor h1 { 13 | font-size: var(--text-xxxxl); 14 | letter-spacing: var(--letter-spacing--primary); 15 | line-height: 1.2; 16 | margin-top: 0; 17 | } 18 | 19 | .phpdocumentor h2 { 20 | font-size: var(--text-xxxl); 21 | letter-spacing: var(--letter-spacing--primary); 22 | line-height: 1.25; 23 | margin-top: 0; 24 | } 25 | 26 | .phpdocumentor h3 { 27 | font-size: var(--text-xxl); 28 | letter-spacing: var(--letter-spacing--primary); 29 | line-height: 1.3; 30 | } 31 | 32 | .phpdocumentor h4 { 33 | font-size: var(--text-xl); 34 | letter-spacing: calc(var(--letter-spacing--primary) / 2); 35 | line-height: 1.35; 36 | margin-bottom: var(--spacing-md); 37 | } 38 | 39 | .phpdocumentor h5 { 40 | font-size: var(--text-lg); 41 | letter-spacing: calc(var(--letter-spacing--primary) / 4); 42 | line-height: 1.5; 43 | margin-bottom: var(--spacing-md); 44 | margin-top: var(--spacing-md); 45 | } 46 | 47 | .phpdocumentor h6 { 48 | font-size: var(--text-md); 49 | letter-spacing: 0; 50 | line-height: var(--line-height--primary); 51 | margin-bottom: var(--spacing-md); 52 | margin-top: var(--spacing-md); 53 | } 54 | 55 | .phpdocumentor h1 .headerlink, 56 | .phpdocumentor h2 .headerlink, 57 | .phpdocumentor h3 .headerlink, 58 | .phpdocumentor h4 .headerlink, 59 | .phpdocumentor h5 .headerlink, 60 | .phpdocumentor h6 .headerlink 61 | { 62 | transition: all .3s ease-in-out; 63 | opacity: 0; 64 | text-decoration: none; 65 | color: silver; 66 | font-size: 80%; 67 | } 68 | 69 | .phpdocumentor h1:hover .headerlink, 70 | .phpdocumentor h2:hover .headerlink, 71 | .phpdocumentor h3:hover .headerlink, 72 | .phpdocumentor h4:hover .headerlink, 73 | .phpdocumentor h5:hover .headerlink, 74 | .phpdocumentor h6:hover .headerlink 75 | { 76 | opacity: 1; 77 | } 78 | -------------------------------------------------------------------------------- /data/templates/woocommerce/objects/images.css.twig: -------------------------------------------------------------------------------- 1 | .phpdocumentor figure { 2 | margin-bottom: var(--spacing-md); 3 | } 4 | -------------------------------------------------------------------------------- /data/templates/woocommerce/objects/line.css.twig: -------------------------------------------------------------------------------- 1 | .phpdocumentor-line { 2 | border-top: 1px solid #E1E1E1; 3 | border-width: 0; 4 | margin-bottom: var(--spacing-xxl); 5 | margin-top: var(--spacing-xxl); 6 | } 7 | -------------------------------------------------------------------------------- /data/templates/woocommerce/objects/links.css.twig: -------------------------------------------------------------------------------- 1 | .phpdocumentor a { 2 | color: var(--link-color-primary); 3 | } 4 | 5 | .phpdocumentor a:hover { 6 | color: var(--link-hover-color-primary); 7 | } 8 | -------------------------------------------------------------------------------- /data/templates/woocommerce/objects/lists.css.twig: -------------------------------------------------------------------------------- 1 | div.phpdocumentor-list > ul, 2 | ul.phpdocumentor-list { 3 | list-style: circle inside; 4 | } 5 | 6 | ol.phpdocumentor-list { 7 | list-style: decimal inside; 8 | } 9 | 10 | div.phpdocumentor-list > ul, 11 | ol.phpdocumentor-list, 12 | ul.phpdocumentor-list { 13 | margin-top: 0; 14 | padding-left: 0; 15 | margin-bottom: var(--spacing-md); 16 | } 17 | 18 | dl { 19 | margin-bottom: var(--spacing-md); 20 | } 21 | 22 | div.phpdocumentor-list > ul ul, 23 | ul.phpdocumentor-list ul.phpdocumentor-list, 24 | ul.phpdocumentor-list ol.phpdocumentor-list, 25 | ol.phpdocumentor-list ol.phpdocumentor-list, 26 | ol.phpdocumentor-list ul.phpdocumentor-list { 27 | font-size: var(--text-sm); 28 | margin: var(--spacing-xs) 0 var(--spacing-xs) calc(var(--spacing-xs) * 2); 29 | } 30 | 31 | li.phpdocumentor-list { 32 | margin-bottom: var(--spacing-md); 33 | } 34 | -------------------------------------------------------------------------------- /data/templates/woocommerce/objects/paragraph.css.twig: -------------------------------------------------------------------------------- 1 | .phpdocumentor p { 2 | margin-top: 0; 3 | margin-bottom: var(--spacing-md); 4 | } 5 | -------------------------------------------------------------------------------- /data/templates/woocommerce/objects/section.css.twig: -------------------------------------------------------------------------------- 1 | .phpdocumentor-section { 2 | box-sizing: border-box; 3 | margin: 0 auto; 4 | max-width: var(--container-width); 5 | padding: 0 var(--spacing-lg); 6 | position: relative; 7 | width: 100%; 8 | } 9 | 10 | @media (min-width: {{ breakpoints['xxl'] }}) { 11 | .phpdocumentor-section { 12 | padding: 0; 13 | width: 95%; 14 | } 15 | } 16 | 17 | @media (min-width: {{ breakpoints['xl'] }}) { 18 | .phpdocumentor-section { 19 | width: 85%; 20 | } 21 | } 22 | -------------------------------------------------------------------------------- /data/templates/woocommerce/objects/tables.css.twig: -------------------------------------------------------------------------------- 1 | .phpdocumentor table { 2 | margin-bottom: var(--spacing-md); 3 | } 4 | 5 | th.phpdocumentor-heading, 6 | td.phpdocumentor-cell { 7 | border-bottom: 1px solid var(--table-separator-color); 8 | padding: var(--spacing-sm) var(--spacing-md); 9 | text-align: left; 10 | } 11 | 12 | th.phpdocumentor-heading:first-child, 13 | td.phpdocumentor-cell:first-child { 14 | padding-left: 0; 15 | } 16 | 17 | th.phpdocumentor-heading:last-child, 18 | td.phpdocumentor-cell:last-child { 19 | padding-right: 0; 20 | } 21 | -------------------------------------------------------------------------------- /data/templates/woocommerce/package.html.twig: -------------------------------------------------------------------------------- 1 | {% extends 'base.html.twig' %} 2 | 3 | {% block content %} 4 | {% include 'components/breadcrumbs.html.twig' %} 5 | 6 |
7 | {{ include('components/namespace-title.html.twig') }} 8 | {{ include('components/table-of-contents.html.twig', {'packages': node.children}) }} 9 | {{ include('components/constants.html.twig') }} 10 | {{ include('components/functions.html.twig') }} 11 |
12 | {% endblock %} 13 | -------------------------------------------------------------------------------- /data/templates/woocommerce/reports/deprecated.html.twig: -------------------------------------------------------------------------------- 1 | {% extends 'base.html.twig' %} 2 | 3 | {% set deprecatedElements = project.indexes.elements|filter(element => element.deprecated) %} 4 | {% 5 | set filesWithDeprecatedElements = deprecatedElements|reduce( 6 | (unique, item) => item.file.path in unique|keys ? unique : unique|merge({(item.file.path): item.file}), {} 7 | ) 8 | %} 9 | 10 | {% block title %} 11 | {{ project.name }} » Deprecated elements 12 | {% endblock %} 13 | 14 | {% block content %} 15 | 18 | 19 |
20 |

Deprecated

21 | 22 | {% if filesWithDeprecatedElements is not empty %} 23 |

Table of Contents

24 | 25 | {% for file in filesWithDeprecatedElements %} 26 | 27 | 28 | 29 | {% endfor %} 30 |
{{ file.path }}
31 | {% endif %} 32 | 33 | {% for file in filesWithDeprecatedElements %} 34 | 35 |

{{ file.name }}

36 | 37 | 38 | 39 | 40 | 41 | 42 | {% for element in deprecatedElements|filter(el => el.file == file) %} 43 | {% for tag in element.tags.deprecated %} 44 | 45 | 46 | 47 | 48 | 49 | {% endfor %} 50 | {% endfor %} 51 |
LineElementReason
{{ element.line }}{{ element|route}}{{ tag.description }}
52 | {% else %} 53 |
54 | No deprecated elements have been found in this project. 55 |
56 | {% endfor %} 57 |
58 | {% endblock %} 59 | -------------------------------------------------------------------------------- /data/templates/woocommerce/reports/errors.html.twig: -------------------------------------------------------------------------------- 1 | {% extends 'base.html.twig' %} 2 | 3 | {% set filesWithErrors = project.files|filter(file => file.allErrors is not empty) %} 4 | 5 | {% block title %} 6 | {{ project.name }} » Compilation errors 7 | {% endblock %} 8 | 9 | {% block content %} 10 | 13 | 14 |
15 |

Errors

16 | 17 | {% if filesWithErrors is not empty %} 18 |

Table of Contents

19 | 20 | {% set errorCount = 0 %} 21 | {% for file in project.files|filter(file => file.allErrors is not empty) %} 22 | {% if file.allerrors.count > 0 %} 23 | 24 | 25 | 26 | 27 | {% endif %} 28 | {% set errorCount = errorCount + file.allerrors.count %} 29 | {% endfor %} 30 |
{{ file.path }}{{ file.allErrors.count }}
31 | {% endif %} 32 | 33 | {% if errorCount <= 0 %} 34 |
No errors have been found in this project.
35 | {% endif %} 36 | 37 | {% for file in filesWithErrors %} 38 | 39 |

{{ file.name }}

40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | 49 | {% for error in file.allerrors %} 50 | 51 | 52 | 53 | 54 | 55 | {% endfor %} 56 | 57 |
TypeLineDescription
{{ error.severity }}{{ error.line }}{{ error.code|trans(error.context) }}
58 | {% endfor %} 59 |
60 | {% endblock %} 61 | -------------------------------------------------------------------------------- /data/templates/woocommerce/reports/markers.html.twig: -------------------------------------------------------------------------------- 1 | {% extends 'base.html.twig' %} 2 | 3 | {% set filesWithMarkers = project.files|filter(file => file.markers is not empty) %} 4 | 5 | {% block title %} 6 | {{ project.name }} » Markers 7 | {% endblock %} 8 | 9 | {% block content %} 10 | 13 | 14 |
15 |

Markers

16 | 17 | {% if filesWithMarkers is not empty %} 18 |

Table of Contents

19 | 20 | {% for file in filesWithMarkers %} 21 | {% if file.markers.count > 0 %} 22 | 23 | 24 | 25 | 26 | {% endif %} 27 | {% endfor %} 28 |
{{ file.path }}{{ file.markers.count }}
29 | {% else %} 30 |
31 | No markers have been found in this project. 32 |
33 | {% endif %} 34 | 35 | {% for file in filesWithMarkers %} 36 | 37 |

{{ file.name }}

38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | {% for marker in file.markers %} 48 | 49 | 50 | 51 | 52 | 53 | {% endfor %} 54 | 55 |
TypeLineDescription
{{ marker.type }}{{ marker.line }}{{ marker.message }}
56 | {% endfor %} 57 |
58 | {% endblock %} 59 | -------------------------------------------------------------------------------- /data/templates/woocommerce/search.js.twig: -------------------------------------------------------------------------------- 1 | var form = document.querySelector('.phpdocumentor-search'), 2 | searchField = document.querySelector('.phpdocumentor-search input[type="search"'); 3 | 4 | // Init autoComplete. 5 | var autoCompletejs = new autoComplete({ 6 | data: { 7 | src: searchIndex, 8 | key: ['name'], 9 | cache: true 10 | }, 11 | placeHolder: 'Search the docs...', 12 | selector: '#autoComplete', 13 | highlight: true, 14 | threshold: 1, 15 | searchEngine: 'strict', 16 | maxResults: 100, 17 | resultsList: { 18 | render: true, 19 | container: function(source) { 20 | source.classList.add('phpdocumentor-search-results__entries'); 21 | }, 22 | destination: document.querySelector('.phpdocumentor-search-results'), 23 | position: 'afterend', 24 | element: 'ul' 25 | }, 26 | resultItem: { 27 | content: function(data, source) { 28 | source.classList.add('phpdocumentor-search-results__entry'); 29 | var name = 'name' === data.key ? data.match : data.value.name, 30 | fqsen = 'fqsen' === data.key ? data.match : data.value.fqsen; 31 | 32 | source.innerHTML += '' + name + "\n"; 33 | if (fqsen){ 34 | source.innerHTML += '' + fqsen + "\n"; 35 | } 36 | source.innerHTML += '' + data.value.summary + ''; 37 | }, 38 | element: 'li' 39 | }, 40 | noResults: function() { 41 | var result = document.createElement('li'); 42 | result.setAttribute('class', 'no-result'); 43 | result.setAttribute('tabindex', '1'); 44 | result.innerHTML = 'No results were found. Please try a different search term.'; 45 | document.querySelector('#autoComplete_list').appendChild(result); 46 | } 47 | }); 48 | 49 | // Display search field. 50 | form.classList.add('phpdocumentor-search--enabled'); 51 | form.classList.add('phpdocumentor-search--active'); 52 | searchField.setAttribute('placeholder', 'Search'); 53 | searchField.removeAttribute('disabled'); 54 | 55 | // Close search results with ESC. 56 | window.addEventListener('keyup', function(event) { 57 | if (event.code === 'Escape') { 58 | document 59 | .querySelector('.phpdocumentor-search-results__entries') 60 | .innerHTML = ''; 61 | 62 | searchField.value = ''; 63 | } 64 | }); 65 | -------------------------------------------------------------------------------- /data/templates/woocommerce/searchIndex.js.twig: -------------------------------------------------------------------------------- 1 | var searchIndex = [ 2 | {% for element in project.indexes.elements %}{ 3 | fqsen: "{{ element.fullyQualifiedStructuralElementName|e('js') }}", 4 | name: "{{ element.name|e('js') }}", 5 | summary: "{{ element.summary|e('js') }}", 6 | url: "{{ link(element)|replace({'../': 'https://woocommerce.github.io/code-reference/'}) }}" 7 | }{% if not loop.last %},{% endif %}{% endfor %} 8 | ]; 9 | -------------------------------------------------------------------------------- /data/templates/woocommerce/template.xml: -------------------------------------------------------------------------------- 1 | 2 | 34 | -------------------------------------------------------------------------------- /data/templates/woocommerce/trait.html.twig: -------------------------------------------------------------------------------- 1 | {% extends 'base.html.twig' %} 2 | 3 | {% block javascripts %} 4 | 5 | 10 | {% endblock %} 11 | 12 | {% block content %} 13 | {% include 'components/breadcrumbs.html.twig' %} 14 | 15 |
16 | {{ include('components/trait-title.html.twig') }} 17 | {{ include('components/element-found-in.html.twig') }} 18 | {{ include('components/element-header.html.twig') }} 19 | 20 | {{ include('components/properties.html.twig') }} 21 | {{ include('components/methods.html.twig') }} 22 |
23 | {% endblock %} 24 | -------------------------------------------------------------------------------- /deploy.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | set -o errexit # Abort if any command fails 3 | me=$(basename "$0") 4 | 5 | help_message="\ 6 | Usage: $me -s [] 7 | Deploy generated files to a git branch. 8 | 9 | Options: 10 | 11 | -h, --help Show this help information. 12 | -v, --verbose Increase verbosity. Useful for debugging. 13 | -s, --source-version Source version to build and deploy. 14 | -r, --github-repo GitHub repo with username, 15 | default to \"woocommerce/woocommerce\". 16 | -p, --default-package Default package name, 17 | default to \"WooCommerce\". 18 | -e, --allow-empty Allow deployment of an empty directory. 19 | -m, --message Specify the message used when committing on 20 | the deploy branch. 21 | -n, --no-hash Don't append the source commit's hash to the 22 | deploy commit's message. 23 | --build-only Only build but not push. 24 | --push-only Only push but not build. 25 | --no-download Skip zip download in case there's on in the 26 | project's root. 27 | " 28 | 29 | banner="\ 30 | -------------------------------------------------------------------------------- 31 | WOOCOMMERCE CODE REFERENCE GENERATOR 32 | --------------------------------------------------------------------------------" 33 | 34 | # Output colorized strings 35 | # 36 | # Color codes: 37 | # 0 - black 38 | # 1 - red 39 | # 2 - green 40 | # 3 - yellow 41 | # 4 - blue 42 | # 5 - magenta 43 | # 6 - cian 44 | # 7 - white 45 | output() { 46 | echo "$(tput setaf "$1")$2$(tput sgr0)" 47 | } 48 | 49 | parse_args() { 50 | output 5 "$banner" 51 | # Set args from a local environment file. 52 | if [ -e ".env" ]; then 53 | source .env 54 | fi 55 | 56 | # Parse arg flags 57 | # If something is exposed as an environment variable, set/overwrite it 58 | # here. Otherwise, set/overwrite the internal variable instead. 59 | while : ; do 60 | if [[ $1 = "-h" || $1 = "--help" ]]; then 61 | echo "$help_message" 62 | exit 0 63 | elif [[ $1 = "-v" || $1 = "--verbose" ]]; then 64 | verbose=true 65 | shift 66 | elif [[ $1 = "-s" || $1 = "--source-version" ]]; then 67 | source_version=$2 68 | shift 2 69 | elif [[ $1 = "-r" || $1 = "--github-repo" ]]; then 70 | github_repo=$2 71 | shift 2 72 | elif [[ $1 = "-p" || $1 = "--default-package" ]]; then 73 | default_package=$2 74 | shift 2 75 | elif [[ $1 = "-e" || $1 = "--allow-empty" ]]; then 76 | allow_empty=true 77 | shift 78 | elif [[ ( $1 = "-m" || $1 = "--message" ) && -n $2 ]]; then 79 | commit_message=$2 80 | shift 2 81 | elif [[ $1 = "-n" || $1 = "--no-hash" ]]; then 82 | GIT_DEPLOY_APPEND_HASH=false 83 | shift 84 | elif [[ $1 = "--build-only" ]]; then 85 | build_only=true 86 | shift 87 | elif [[ $1 = "--push-only" ]]; then 88 | push_only=true 89 | shift 90 | elif [[ $1 = "--no-download" ]]; then 91 | run_download=false 92 | shift 93 | else 94 | break 95 | fi 96 | done 97 | 98 | if [ ${build_only} ] && [ ${push_only} ]; then 99 | output 1 "You can only specify one of --build-only or --push-only" >&2 100 | exit 1 101 | fi 102 | 103 | if [[ -z $source_version ]]; then 104 | output 1 "Source version is missing." >&2 105 | exit 1 106 | fi 107 | 108 | if [[ -z $github_repo ]]; then 109 | github_repo="woocommerce/woocommerce" 110 | fi 111 | 112 | if [[ -z $default_package ]]; then 113 | default_package="WooCommerce" 114 | fi 115 | 116 | if [[ -z $run_download ]]; then 117 | run_download=true 118 | fi 119 | 120 | # Set internal option vars from the environment and arg flags. All internal 121 | # vars should be declared here, with sane defaults if applicable. 122 | 123 | # Source directory & target branch. 124 | project_name=${github_repo##*/} 125 | deploy_directory=build/api 126 | deploy_branch=gh-pages 127 | 128 | # If no user identity is already set in the current git environment, use this: 129 | default_username=${GIT_DEPLOY_USERNAME:-deploy.sh} 130 | default_email=${GIT_DEPLOY_EMAIL:-} 131 | 132 | # Repository to deploy to. must be readable and writable. 133 | repo=origin 134 | 135 | # Append commit hash to the end of message by default 136 | append_hash=${GIT_DEPLOY_APPEND_HASH:-true} 137 | } 138 | 139 | download_source() { 140 | # Bootstrap 141 | rm -f ./${project_name}.zip 142 | rm -rf ./${project_name} 143 | 144 | # Install dependencies 145 | if [ ! -f "vendor/bin/phpdoc" ]; then 146 | output 1 "PHPDoc missing!" 147 | output 2 "Installing PHPDoc..." 148 | composer install 149 | fi 150 | 151 | # Clone WooCommerce 152 | output 2 "Download ${project_name}.zip from GitHub release ${source_version}..." 153 | echo 154 | curl -LSO# "https://github.com/${github_repo}/releases/download/${source_version}/${project_name}.zip" 155 | 156 | # Check if file exists. 157 | if [ ! -f "${project_name}.zip" ]; then 158 | output 1 "Error while download ${project_name}.zip from GitHub release ${source_version}!" 159 | exit 1 160 | fi 161 | 162 | # Unzip source code. 163 | unzip -o "${project_name}.zip" -d . 164 | } 165 | 166 | run_build() { 167 | rm -rf ./build 168 | mkdir -p ./build 169 | 170 | if $run_download; then 171 | download_source 172 | fi 173 | echo 174 | output 2 "Generating API docs..." 175 | echo 176 | ./vendor/bin/phpdoc run --template="data/templates/${project_name}" --sourcecode --defaultpackagename=${default_package} 177 | php generate-hook-docs.php 178 | } 179 | 180 | main() { 181 | enable_expanded_output 182 | 183 | if ! git diff --exit-code --quiet --cached; then 184 | output 1 Aborting due to uncommitted changes in the index >&2 185 | return 1 186 | fi 187 | 188 | commit_hash=` git log -n 1 --format="%H" HEAD` 189 | 190 | # Default commit message uses last title if a custom one is not supplied 191 | if [[ -z $commit_message ]]; then 192 | commit_message="Published code reference for $project_name $source_version" 193 | fi 194 | 195 | # Append hash to commit message unless no hash flag was found 196 | if [ $append_hash = true ]; then 197 | commit_message="$commit_message"$'\n\n'"Generated from commit $commit_hash" 198 | fi 199 | 200 | previous_branch=`git rev-parse --abbrev-ref HEAD` 201 | 202 | if [ ! -d "$deploy_directory" ]; then 203 | output 1 "Deploy directory '$deploy_directory' does not exist. Aborting." >&2 204 | return 1 205 | fi 206 | 207 | # Must use short form of flag in ls for compatibility with macOS and BSD 208 | if [[ -z `ls -A "$deploy_directory" 2> /dev/null` && -z $allow_empty ]]; then 209 | output 1 "Deploy directory '$deploy_directory' is empty. Aborting. If you're sure you want to deploy an empty tree, use the --allow-empty / -e flag." >&2 210 | return 1 211 | fi 212 | 213 | if git ls-remote --exit-code $repo "refs/heads/$deploy_branch" ; then 214 | # deploy_branch exists in $repo; make sure we have the latest version 215 | 216 | disable_expanded_output 217 | git fetch --force $repo $deploy_branch:$deploy_branch 218 | enable_expanded_output 219 | fi 220 | 221 | # Check if deploy_branch exists locally 222 | if git show-ref --verify --quiet "refs/heads/$deploy_branch" 223 | then incremental_deploy 224 | else initial_deploy 225 | fi 226 | 227 | restore_head 228 | } 229 | 230 | initial_deploy() { 231 | git --work-tree "$deploy_directory" checkout --orphan $deploy_branch 232 | git --work-tree "$deploy_directory" add --all 233 | commit+push 234 | } 235 | 236 | incremental_deploy() { 237 | # Make deploy_branch the current branch 238 | git symbolic-ref HEAD refs/heads/$deploy_branch 239 | # Put the previously committed contents of deploy_branch into the index 240 | git --work-tree "$deploy_directory" reset --mixed --quiet 241 | git --work-tree "$deploy_directory" add --all 242 | 243 | set +o errexit 244 | diff=$(git --work-tree "$deploy_directory" diff --exit-code --quiet HEAD --)$? 245 | set -o errexit 246 | case $diff in 247 | 0) echo No changes to files in $deploy_directory. Skipping commit.;; 248 | 1) commit+push;; 249 | *) 250 | output 1 git diff exited with code $diff. Aborting. Staying on branch $deploy_branch so you can debug. To switch back to main, use: git symbolic-ref HEAD refs/heads/main && git reset --mixed >&2 251 | return $diff 252 | ;; 253 | esac 254 | } 255 | 256 | commit+push() { 257 | set_user_id 258 | git --work-tree "$deploy_directory" commit -m "$commit_message" 259 | 260 | disable_expanded_output 261 | # --quiet is important here to avoid outputting the repo URL, which may contain a secret token 262 | git push --quiet $repo $deploy_branch 263 | enable_expanded_output 264 | } 265 | 266 | # Echo expanded commands as they are executed (for debugging) 267 | enable_expanded_output() { 268 | if [ $verbose ]; then 269 | set -o xtrace 270 | set +o verbose 271 | fi 272 | } 273 | 274 | # This is used to avoid outputting the repo URL, which may contain a secret token 275 | disable_expanded_output() { 276 | if [ $verbose ]; then 277 | set +o xtrace 278 | set -o verbose 279 | fi 280 | } 281 | 282 | set_user_id() { 283 | if [[ -z `git config user.name` ]]; then 284 | git config user.name "$default_username" 285 | fi 286 | if [[ -z `git config user.email` ]]; then 287 | git config user.email "$default_email" 288 | fi 289 | } 290 | 291 | restore_head() { 292 | if [[ $previous_branch = "HEAD" ]]; then 293 | # We weren't on any branch before, so just set HEAD back to the commit it was on 294 | git update-ref --no-deref HEAD $commit_hash $deploy_branch 295 | else 296 | git symbolic-ref HEAD refs/heads/$previous_branch 297 | fi 298 | 299 | git reset --mixed 300 | } 301 | 302 | filter() { 303 | sed -e "s|$repo|\$repo|g" 304 | } 305 | 306 | sanitize() { 307 | "$@" 2> >(filter 1>&2) | filter 308 | } 309 | 310 | parse_args "$@" 311 | 312 | if [[ ${build_only} ]]; then 313 | run_build 314 | elif [[ ${push_only} ]]; then 315 | main "$@" 316 | else 317 | run_build 318 | main "$@" 319 | fi 320 | -------------------------------------------------------------------------------- /generate-hook-docs.php: -------------------------------------------------------------------------------- 1 | ' . basename($file['path']) . ''; 86 | } 87 | 88 | /** 89 | * Get files. 90 | * 91 | * @param string $pattern Search pattern. 92 | * @param int $flags Glob flags. 93 | * @param string $path Directory path. 94 | * @return array 95 | */ 96 | protected static function getFiles($pattern, $flags = 0, $path = '') 97 | { 98 | if (! $path && ( $dir = dirname($pattern) ) != '.') { 99 | if ('\\' == $dir || '/' == $dir) { 100 | $dir = ''; 101 | } 102 | 103 | return self::getFiles(basename($pattern), $flags, $dir . '/'); 104 | } 105 | 106 | $paths = glob($path . '*', GLOB_ONLYDIR | GLOB_NOSORT); 107 | $files = glob($path . $pattern, $flags); 108 | 109 | if (is_array($paths)) { 110 | foreach ($paths as $p) { 111 | $found_files = []; 112 | $retrieved_files = (array) self::getFiles($pattern, $flags, $p . '/'); 113 | foreach ($retrieved_files as $file) { 114 | if (! in_array($file, self::$found_files)) { 115 | $found_files[] = $file; 116 | } 117 | } 118 | 119 | self::$found_files = array_merge(self::$found_files, $found_files); 120 | 121 | if (is_array($files) && is_array($found_files)) { 122 | $files = array_merge($files, $found_files); 123 | } 124 | } 125 | } 126 | return $files; 127 | } 128 | 129 | /** 130 | * Get hooks. 131 | * 132 | * @param array $files_to_scan Files to scan. 133 | * @return array 134 | */ 135 | protected static function getHooks(array $files_to_scan): array 136 | { 137 | $scanned = []; 138 | $results = []; 139 | 140 | foreach ($files_to_scan as $heading => $files) { 141 | $hooks_found = []; 142 | 143 | foreach ($files as $f) { 144 | $current_file = $f; 145 | $tokens = token_get_all(file_get_contents($f)); 146 | $token_type = false; 147 | $current_class = ''; 148 | $current_function = ''; 149 | 150 | if (in_array($current_file, $scanned)) { 151 | continue; 152 | } 153 | 154 | $scanned[] = $current_file; 155 | 156 | foreach ($tokens as $index => $token) { 157 | if (is_array($token)) { 158 | $trimmed_token_1 = trim($token[1]); 159 | if (T_CLASS == $token[0]) { 160 | $token_type = 'class'; 161 | } elseif (T_FUNCTION == $token[0]) { 162 | $token_type = 'function'; 163 | } elseif ('do_action' === $token[1]) { 164 | $token_type = 'action'; 165 | } elseif ('apply_filters' === $token[1]) { 166 | $token_type = 'filter'; 167 | } elseif ($token_type && ! empty($trimmed_token_1)) { 168 | switch ($token_type) { 169 | case 'class': 170 | $current_class = $token[1]; 171 | break; 172 | case 'function': 173 | $current_function = $token[1]; 174 | break; 175 | case 'filter': 176 | case 'action': 177 | $hook = trim($token[1], "'"); 178 | $hook = str_replace('_FUNCTION_', strtoupper($current_function), $hook); 179 | $hook = str_replace('_CLASS_', strtoupper($current_class), $hook); 180 | $hook = str_replace('$this', strtoupper($current_class), $hook); 181 | $hook = str_replace(array( '.', '{', '}', '"', "'", ' ', ')', '(' ), '', $hook); 182 | $hook = preg_replace('/\/\/phpcs\:(.*)/', '', $hook); 183 | $loop = 0; 184 | 185 | // Keep adding to hook until we find a comma or colon. 186 | while (1) { 187 | $loop++; 188 | $prev_hook = is_string($tokens[ $index + $loop - 1 ]) ? $tokens[ $index + $loop - 1 ] : $tokens[ $index + $loop - 1 ][1]; 189 | $next_hook = is_string($tokens[ $index + $loop ]) ? $tokens[ $index + $loop ] : $tokens[ $index + $loop ][1]; 190 | 191 | if (in_array($next_hook, array( '.', '{', '}', '"', "'", ' ', ')', '(' ))) { 192 | continue; 193 | } 194 | 195 | if (in_array($next_hook, array( ',', ';' ))) { 196 | break; 197 | } 198 | 199 | $hook_first = substr($next_hook, 0, 1); 200 | $hook_last = substr($next_hook, -1, 1); 201 | 202 | if ('{' === $hook_first || '}' === $hook_last || '$' === $hook_first || ')' === $hook_last || '>' === substr($prev_hook, -1, 1)) { 203 | $next_hook = strtoupper($next_hook); 204 | } 205 | 206 | $next_hook = str_replace(array( '.', '{', '}', '"', "'", ' ', ')', '(' ), '', $next_hook); 207 | 208 | $hook .= $next_hook; 209 | } 210 | 211 | $hook = trim($hook); 212 | 213 | if (isset($hooks_found[ $hook ])) { 214 | $hooks_found[ $hook ]['files'][] = ['path' => $current_file, 'line' => $token[2]]; 215 | } else { 216 | $hooks_found[ $hook ] = [ 217 | 'files' => [['path' => $current_file, 'line' => $token[2]]], 218 | 'class' => $current_class, 219 | 'function' => $current_function, 220 | 'type' => $token_type, 221 | ]; 222 | } 223 | break; 224 | } 225 | $token_type = false; 226 | } 227 | } 228 | } 229 | } 230 | 231 | foreach ($hooks_found as $hook => $details) { 232 | if (!strstr($hook, 'woocommerce') && !strstr($hook, 'product') && !strstr($hook, 'wc_')) { 233 | // unset( $hooks_found[ $hook ] ); 234 | } 235 | } 236 | 237 | ksort($hooks_found); 238 | 239 | if (!empty($hooks_found)) { 240 | $results[ $heading ] = $hooks_found; 241 | } 242 | } 243 | 244 | return $results; 245 | } 246 | 247 | /** 248 | * Get delimited list output. 249 | * 250 | * @param array $hook_list List of hooks. 251 | * @param array $files_to_scan List of files to scan. 252 | * @param string 253 | */ 254 | protected static function getDelimitedListOutput(array $hook_list, array $files_to_scan): string 255 | { 256 | $output = ''; 257 | 258 | $index = []; 259 | foreach ($files_to_scan as $heading => $files) { 260 | $index[] = '' . $heading . ''; 261 | } 262 | 263 | $output .= '

' . implode(', ', $index) . '

'; 264 | 265 | $output .= '
'; 266 | foreach ($hook_list as $heading => $hooks) { 267 | $output .= '

' . $heading . '

'; 268 | $output .= '
'; 269 | foreach ($hooks as $hook => $details) { 270 | $output .= '
' . $hook . '
'; 271 | $link_list = []; 272 | foreach ($details['files'] as $file) { 273 | $link_list[] = self::getFileLink($file); 274 | } 275 | $output .= '
' . implode(', ', $link_list) . '
'; 276 | } 277 | $output .= '
'; 278 | } 279 | 280 | $output .= '
'; 281 | 282 | return $output; 283 | } 284 | 285 | /** 286 | * Get JS output. 287 | * 288 | * @param array $hook_list List of hooks. 289 | * @param string 290 | */ 291 | protected static function getJSOutput(array $hook_list): string 292 | { 293 | $output = ''; 294 | 295 | foreach ($hook_list as $heading => $hooks) { 296 | foreach ($hooks as $hook => $details) { 297 | $type = 'filter' === $details['type'] ? 'Filter' : 'Action'; 298 | $summary = $heading . ' ' . $type; 299 | $name = '' . $type . ' hook: <\/strong>' . $hook; 300 | 301 | foreach ($details['files'] as $file) { 302 | $summary .= ' located in ' . str_replace('woocommerce/', '', $file['path']) . ': ' . $file['line']; 303 | 304 | $output .= ',{'; 305 | $output .= 'fqsen: "' . $name . '",'; 306 | $output .= 'name: "' . $hook . '",'; 307 | $output .= 'summary: "' . $summary . '",'; 308 | $output .= 'url: "' . str_replace('../', 'https://woocommerce.github.io/code-reference/', self::getFileURL($file)) . '"'; 309 | $output .= '}'; 310 | } 311 | } 312 | } 313 | 314 | return $output; 315 | } 316 | 317 | /** 318 | * Apply changes to build/. 319 | */ 320 | public static function applyChanges() 321 | { 322 | $files_to_scan = self::getFilesToScan(); 323 | $hook_list = self::getHooks($files_to_scan); 324 | 325 | if (empty($hook_list)) { 326 | return; 327 | } 328 | 329 | // Add hooks reference content. 330 | if (file_exists(self::HOOKS_TEMPLATE_PATH)) { 331 | $output = self::getDelimitedListOutput($hook_list, $files_to_scan); 332 | $template = file_get_contents(self::HOOKS_TEMPLATE_PATH); 333 | $template = str_replace('', $output, $template); 334 | file_put_contents(self::HOOKS_TEMPLATE_PATH, $template); 335 | } 336 | 337 | // Add hooks to search index. 338 | if (file_exists(self::SEARCH_INDEX_PATH)) { 339 | $output = self::getJSOutput($hook_list); 340 | $template = file_get_contents(self::SEARCH_INDEX_PATH); 341 | $template = str_replace('}];', '}' . $output . '];', $template); 342 | file_put_contents(self::SEARCH_INDEX_PATH, $template); 343 | } 344 | 345 | echo "Hook docs generated :)\n"; 346 | } 347 | } 348 | 349 | HookDocsGenerator::applyChanges(); 350 | -------------------------------------------------------------------------------- /phpcs.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | PHPCS configuration file. 4 | . 5 | 6 | 7 | 8 | 9 | 0 10 | 11 | 12 | 0 13 | 14 | 15 | -------------------------------------------------------------------------------- /phpdoc.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | WooCommerce Code Reference 4 | 5 | woocommerce/ 6 | woocommerce/src/Internal/ 7 | woocommerce/assets/ 8 | woocommerce/i18n/ 9 | woocommerce/includes/legacy/api/ 10 | woocommerce/includes/libraries/ 11 | woocommerce/sample-data/ 12 | woocommerce/vendor/ 13 | woocommerce/packages/action-scheduler/ 14 | woocommerce/packages/woocommerce-admin/dist/ 15 | woocommerce/packages/woocommerce-admin/images/ 16 | woocommerce/packages/woocommerce-admin/languages/ 17 | woocommerce/packages/woocommerce-admin/storybook/ 18 | woocommerce/packages/woocommerce-admin/vendor/ 19 | woocommerce/packages/woocommerce-blocks/ 20 | 21 | 22 | --------------------------------------------------------------------------------