Skip to content

Commit

Permalink
Test docs build using CI (#2086)
Browse files Browse the repository at this point in the history
  • Loading branch information
mvorisek authored Aug 20, 2023
1 parent afea482 commit d6c8af0
Show file tree
Hide file tree
Showing 31 changed files with 285 additions and 150 deletions.
25 changes: 25 additions & 0 deletions .github/workflows/test-unit.yml
Original file line number Diff line number Diff line change
Expand Up @@ -455,3 +455,28 @@ jobs:
token: ${{ secrets.CODECOV_TOKEN }}
fail_ci_if_error: true
files: coverage/merged.xml,coverage/js/clover.xml

docs-test:
name: Docs
runs-on: ubuntu-latest
container:
image: ghcr.io/mvorisek/image-php:latest
steps:
- name: Checkout
uses: actions/checkout@v3

- name: Install Python and dependencies
run: |
apk add python3 py3-pip
python --version
(cd docs && pip install -r requirements.txt)
- name: Build
run: |
mv docs/baseline.txt docs/baseline.orig.txt
(cd docs && python -m sphinx -T -b html . out 2>&1 | tee baseline.txt)
sed -i -r 's~[^:]*/docs/([^:]*:)([0-9]+:)?~\1~;t;d' docs/baseline.txt
- name: Diff build baseline
run: |
diff -u docs/baseline.orig.txt docs/baseline.txt
12 changes: 6 additions & 6 deletions docs/app.md
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ You may use App class hook to impact behavior of your application:
- using hooks to globally impact object initialization
- override methods to create different behavior, for example url() method may use advanced router logic
to create beautiful URLs.
- you may re-define set-up of {php:class}`Persistence_i_Ui` and affect how data is loaded from UI.
- you may re-define set-up of {php:class}`Persistence\Ui` and affect how data is loaded from UI.
- load templates from different files
- use a different CDN settings for static files

Expand Down Expand Up @@ -161,8 +161,8 @@ HelloWorld::addTo($app);
$app->run();
```

If you do not want the application to automatically execute `run()` you can either set `$alwaysRun` to false
or use {php:meth}`terminate()` to the app with desired output.
If you do not want the application to automatically execute `run()` you can either set {php:attr}`App::$alwaysRun` to false
or use {php:meth}`App::terminate()` to the app with desired output.

## Exception handling

Expand Down Expand Up @@ -210,7 +210,7 @@ Initializes all includes required by Agile UI. You may extend this class to add
:::

Decodes current request without any arguments. If you are changing URL generation pattern, you
probably need to change this method to properly identify the current page. See {php:class}`App::url()`
probably need to change this method to properly identify the current page. See {php:meth}`App::url()`

## Loading Templates for Views

Expand Down Expand Up @@ -286,7 +286,7 @@ No much magic in these methods.

## Database Connection

:::{php:property} db
:::{php:attr} db
:::

If your `App` needs a DB connection, set this property to an instance of `Persistence`.
Expand Down Expand Up @@ -434,7 +434,7 @@ Each layout, depending on it's content, may come with several views that you can

## Admin Layout

:::{php:class} Layout_i_Admin
:::{php:class} Layout\Admin
:::

Agile Toolkit comes with a ready to use admin layout for your application. The layout is built
Expand Down
2 changes: 1 addition & 1 deletion docs/autocomplete.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@

# AutoComplete Form Control

:::{php:class} Form_i_Control_i_AutoComplete
:::{php:class} Form\Control\AutoComplete
:::

Agile UI uses "Form\Control\Dropdown" by default on the form, but there is also implementation
Expand Down
103 changes: 103 additions & 0 deletions docs/baseline.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,103 @@
components.md: WARNING: toctree contains reference to nonexisting document 'field'
components.md: WARNING: toctree contains reference to nonexisting document 'loader'
components.md: WARNING: toctree contains reference to nonexisting document 'columns'
components.md: WARNING: toctree contains reference to nonexisting document 'dropdown'
core.md: WARNING: toctree contains reference to nonexisting document 'init'
core.md: WARNING: toctree contains reference to nonexisting document 'callback'
core.md: WARNING: toctree contains reference to nonexisting document 'stickyget'
tablecolumn.md: WARNING: duplicate object description of Atk4\Ui\Table\Column, other instance in /__w/ui/ui/docs/table.md
autocomplete.md: WARNING: document isn't included in any toctree
form-control.md: WARNING: document isn't included in any toctree
menu.md: WARNING: document isn't included in any toctree
multiline.md: WARNING: document isn't included in any toctree
session.md: WARNING: document isn't included in any toctree
tree-item-selector.md: WARNING: document isn't included in any toctree
app.md: [phpdomain] Target Atk4\Ui\Persistence\Ui not found
app.md: [phpdomain] Target Atk4\Ui\View::stickyGet not found
breadcrumb.md: [phpdomain] Target Atk4\Ui\View::url not found
components.md: [phpdomain] Target Atk4\Ui\Console::output not found
data.md: [phpdomain] Target Atk4\Ui\View::setSource not found
fileupload.md: [phpdomain] Target Atk4\Ui\Form\Control\Upload::onUpload not found
form.md: [phpdomain] Target Atk4\Ui\Form\Layout\Columns not found
form.md: [phpdomain] Target Atk4\Ui\ProxyModel not found
form.md: [phpdomain] Target Atk4\Ui\ProxyModel not found
form.md: [phpdomain] Target Atk4\Ui\Form\Control\Calendar::$type not found
form-control.md: [phpdomain] Target Atk4\Ui\Form::$typeToDecorator not found
form-control.md: [phpdomain] Target Atk4\Ui\Form\Control\Password not found
form-control.md: [phpdomain] Target Atk4\Ui\Form::renderRowFunction not found
form-control.md: [phpdomain] Target Atk4\Ui\Form::renderRowFunction not found
grid.md: [phpdomain] Target Atk4\Ui\Table\Column\Actions not found
grid.md: [phpdomain] Target Atk4\Ui\Table\Column\Actions::addAction not found
grid.md: [phpdomain] Target Atk4\Ui\Table\Column\Actions::addModal not found
icon.md: [phpdomain] Target Atk4\Ui\HtmlTemplate not found
js.md: [phpdomain] Target #modals-and-reloading not found
js.md: [phpdomain] Target #modals-and-reloading not found
js.md: [phpdomain] Target #modals-and-reloading not found
js.md: [phpdomain] Target #modals-and-reloading not found
js.md: [phpdomain] Target #modals-and-reloading not found
js.md: [phpdomain] Target #modals-and-reloading not found
js.md: [phpdomain] Target #modals-and-reloading not found
js.md: [phpdomain] Target #modals-and-reloading not found
js.md: [phpdomain] Target #modals-and-reloading not found
js.md: [phpdomain] Target #modals-and-reloading not found
js.md: [phpdomain] Target #modals-and-reloading not found
js.md: [phpdomain] Target #modals-and-reloading not found
js.md: [phpdomain] Target Atk4\Ui\App:requireJs not found
js.md: [phpdomain] Target Atk4\Ui\Js\JsChain::_jsonEncode not found
js.md: [phpdomain] Target Atk4\Ui\App::includeJS not found
js.md: [phpdomain] Target Atk4\Ui\App::includeCSS not found
message.md: [phpdomain] Target Atk4\Ui\Text::addParagraph not found
overview.md: [phpdomain] Target Atk4\Ui\HtmlTemplate not found
popup.md: [phpdomain] Target Atk4\Ui\Dropdown not found
table.md: [phpdomain] Target Atk4\Ui\View::setSource not found
table.md: [phpdomain] Target Atk4\Ui\Table::$useHtmlTags not found
table.md: [phpdomain] Target Atk4\Ui\Table::addTotals not found
table.md: [phpdomain] Target Atk4\Ui\Table::$tRow not found
table.md: [phpdomain] Target Atk4\Ui\Table::$tRow not found
table.md: [phpdomain] Target Atk4\Ui\Table::$tEmpty not found
table.md: [phpdomain] Target Atk4\Ui\addTotals not found
table.md: [phpdomain] Target Atk4\Ui\Table\Column\Money::getDataCellTemplate not found
table.md: [phpdomain] Target Atk4\Ui\Table\Column\Link::getDataCellTemplate not found
table.md: [phpdomain] Target Atk4\Ui\Lister::addJsPaginator not found
tablecolumn.md: [phpdomain] Target Atk4\Ui\Card not found
tablecolumn.md: [phpdomain] Target Atk4\Ui\Money not found
tablecolumn.md: [phpdomain] Target Atk4\Ui\Action not found
tablecolumn.md: [phpdomain] Target Atk4\Ui\CheckBox not found
tablecolumn.md: [phpdomain] Target Atk4\Ui\Ordering not found
tablecolumn.md: [phpdomain] Target Atk4\Ui\Multiformat not found
tablecolumn.md: [phpdomain] Target Atk4\Ui\Table::addTotals not found
tablecolumn.md: [phpdomain] Target Atk4\Ui\Table:jsRow not found
template.md: [phpdomain] Target Atk4\Ui\HtmlTemplate::loadTemplate not found
template.md: [phpdomain] Target Atk4\Ui\HtmlTemplate::loadFromString not found
template.md: [phpdomain] Target Atk4\Ui\HtmlTemplate::set not found
template.md: [phpdomain] Target Atk4\Ui\HtmlTemplate::renderToHtml not found
template.md: [phpdomain] Target Atk4\Ui\PathFinder not found
template.md: [phpdomain] Target Atk4\Ui\PathFinder not found
template.md: [phpdomain] Target Atk4\Ui\defaultTemplate not found
template.md: [phpdomain] Target Atk4\Ui\App_Web::setTags not found
type-presentation.md: [phpdomain] Target Atk4\Ui\Persistence\Ui not found
type-presentation.md: [phpdomain] Target Atk4\Ui\Form\Control\Calendar not found
type-presentation.md: [phpdomain] Target Atk4\Ui\Table::decoratorFactory not found
type-presentation.md: [phpdomain] Target Atk4\Data\Field not found
type-presentation.md: [phpdomain] Target Atk4\Ui\Table::$useHtmlTags not found
type-presentation.md: [phpdomain] Target Atk4\Ui\Persistence\Ui not found
view.md: [phpdomain] Target Atk4\Ui\string|array not found
view.md: [phpdomain] Target Atk4\Ui\HtmlTemplate not found
view.md: [phpdomain] Target Atk4\Ui\HtmlTemplate not found
view.md: [phpdomain] Target Atk4\Ui\HtmlTemplate not found
wizard.md: [phpdomain] Target Atk4\Ui\View::url not found
app.md: WARNING: undefined label: system_pattern
app.md: WARNING: undefined label: page_manager
app.md: WARNING: undefined label: page_manager
form-control.md: WARNING: undefined label: field_visibility
js.md: WARNING: 'myst' reference target not found: #modals-and-reloading
lister.md: WARNING: undefined label: uipersistence
loremipsum.md: WARNING: undefined label: reloading
rightpanel.md: WARNING: undefined label: dynamic
seed.md: WARNING: undefined label: render tree
table.md: WARNING: undefined label: field_visibility
table.md: WARNING: undefined label: uipersistence
table.md: WARNING: undefined label: universal_data_access
table.md: WARNING: undefined label: uipersistence
tablecolumn.md: WARNING: undefined label: uipersistence
template.md: WARNING: undefined label: resource
2 changes: 1 addition & 1 deletion docs/breadcrumb.md
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ Calling addCrumb adds more elements into the $path property. Each element there
- link - where to go if clicked
- divider - which divider to use after the crumb

By default `divider` is set to {php:attr}`Breadcrumb::dividerClass`. You may also manipulate $path array yourself.
By default `divider` is set to {php:attr}`Breadcrumb::$dividerClass`. You may also manipulate $path array yourself.
For example the next code will use some logic:

```
Expand Down
4 changes: 2 additions & 2 deletions docs/callbacks.md
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,7 @@ if ($cb->set(function () { return true; })) {
```

This example uses return of the {php:meth}`Callback::set()` to add class to a label, however a
much more preferred way is to use {php:attr}`$triggered`.
much more preferred way is to use {php:attr}`Callback::$triggered`.

:::{php:attr} triggered
:::
Expand Down Expand Up @@ -176,7 +176,7 @@ CallbackLater is used by several actions in Agile UI, such as JsReload(), and en
you are reloading are fully rendered by the time callback is executed.

Given our knowledge of Callbacks, lets take a closer look at how JsReload actually works. So what do we
know about {php:class}`Js_i_JsReload` already?
know about {php:class}`Js\JsReload` already?

- JsReload is class implementing JsExpressionable
- you must specify a view to JsReload
Expand Down
2 changes: 1 addition & 1 deletion docs/components.md
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ label
text
loremipsum
header
beadcrumb
breadcrumb
icon
image
message
Expand Down
4 changes: 2 additions & 2 deletions docs/console.md
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ $console->runMethod('StaticLib', 'myStaticMethod');
:::{php:method} exec($cmd, $args)
:::

:::{php:argument} lastExitCode
:::{php:attr} lastExitCode
:::

To execute a command, use:
Expand Down Expand Up @@ -122,7 +122,7 @@ Console::addTo($app)->set(function (Console $c) {
```

Method exec() will return `$this` if command was run inside callback and was successful. It will return `false` on error
and will return `null` if called outside of callback. You may also refer to {php:attr}`Console::lastExitCode` which
and will return `null` if called outside of callback. You may also refer to {php:attr}`Console::$lastExitCode` which
contains exit code of the last command.

Normally it's safe to chain `exec` which ensures that execution will stack. Should any command fail, the subsequent
Expand Down
20 changes: 10 additions & 10 deletions docs/dataexecutor.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,15 +19,15 @@ Demo: https://ui.atk4.org/demos/data-action/actions.php

All executors must implement the ExecutorInterface or JsExecutorInterface interface.

:::{php:interface} UserAction_i_ExecutorInterface
:::{php:interface} UserAction\ExecutorInterface
:::

:::{php:interface} UserAction_i_JsExecutorInterface
:::{php:interface} UserAction\JsExecutorInterface
:::

## Basic Executor

:::{php:class} UserAction_i_BasicExecutor
:::{php:class} UserAction\BasicExecutor
:::

This is the base view for most of the other action executors. This executor generally
Expand All @@ -40,23 +40,23 @@ BasicExecutor will display:

## Preview Executor

:::{php:class} UserAction_i_PreviewExecutor
:::{php:class} UserAction\PreviewExecutor
:::

This executor is specifically set in order to display the $preview property of the current model UserAction.
You can select to display the preview using regular console type container, regular text or using HTML content.

## Form Executor

:::{php:class} UserAction_i_FormExecutor
:::{php:class} UserAction\FormExecutor
:::

This executor will display a form where user is required to fill in either all model fields or certain model fields
depending on the model UserAction $field property. Form control will depend on model field type.

## Argument Form Executor

:::{php:class} UserAction_i_ArgumentFormExecutor
:::{php:class} UserAction\ArgumentFormExecutor
:::

This executor will display a form but instead of filling form control with model field, it will use model UserAction
Expand All @@ -65,15 +65,15 @@ The type of form control type to be used in form will depend on how $args is set

## JS Callaback Executor

:::{php:class} UserAction_i_JsCallbackExecutor
:::{php:class} UserAction\JsCallbackExecutor
:::

This type of executor will output proper javascript that you can assign to a view event using View::on() method.
It is also possible to pass the UserAction argument via $_POST argument.

## Modal Executor

:::{php:class} UserAction_i_ModalExecutor
:::{php:class} UserAction\ModalExecutor
:::

The ModalExecutor is base on Modal view. This is a one size fits all for model UserAction. When setting the UserAction via the
Expand All @@ -93,7 +93,7 @@ Modal::$title property.

## Confirmation Executor

:::{php:class} UserAction_i_ConfirmationExecutor
:::{php:class} UserAction\ConfirmationExecutor
:::

Like ModalExecutor, Confirmation executor is also based on a Modal view. It allow to display UserAction::confirmation property prior to
Expand Down Expand Up @@ -129,7 +129,7 @@ other hand, if MODIFIER_UPDATE is set, then Table needs to be reloaded.

## The Executor Factory

:::{php:class} UserAction_i_ExecutorFactory
:::{php:class} UserAction\ExecutorFactory
:::

:::{php:attr} executorSeed
Expand Down
6 changes: 3 additions & 3 deletions docs/fileupload.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ in steps:
1. User arrives at the page with a form
2. User selects file.
3. File begins uploading.
4. PHP upload callback {php:meth}`Form_i_Control_i_Upload::onUpload` is called, returns "file_id"
4. PHP upload callback {php:meth}`Form\Control\Upload::onUpload` is called, returns "file_id"
5. "file_id" is placed inside form.
6. User submits the form
7. {php:meth}`Form::onSubmit()` receives "file_id"
Expand All @@ -24,7 +24,7 @@ it can be removed. Both Upload and UploadImage controls contain an upload button
open a File Selection dialog. UploadImage also implements image preview icon.
During upload, a progress bar will appear.

:::{php:class} Form_i_Control_i_Upload
:::{php:class} Form\Control\Upload
:::

## Attributes
Expand Down Expand Up @@ -134,7 +134,7 @@ $img->onDelete(function (string $fileId) use ($img) {

Similar to Upload, this is a control implementation for uploading images. Here are additional properties:

:::{php:class} Form_i_Control_i_UploadImage
:::{php:class} Form\Control\UploadImage
:::

UploadImage form control inherits all of the Upload properties plus these ones:
Expand Down
Loading

0 comments on commit d6c8af0

Please sign in to comment.