Skip to content

Commit f500dc8

Browse files
authored
[PHP] Migrated include_file to include_code. Added remove_indent for partial includes (#3209)
* [PHP] Migrated include_file to include_code. Added remove_indent for partial includes * Bumped file limit
1 parent a571ffa commit f500dc8

126 files changed

Lines changed: 380 additions & 380 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.github/workflows/preview_comment.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ jobs:
2828

2929
- name: Create comment for changed files
3030
run: |
31-
file_limit=100
31+
file_limit=150
3232
build_url="https://ez-systems-developer-documentation--${{ github.event.pull_request.number }}.com.readthedocs.build/${{inputs.project}}en/${{ github.event.pull_request.number }}/"
3333
3434
md_change_list=$(git diff --name-only HEAD "origin/$GITHUB_BASE_REF" -- docs/ | grep -E "^docs\/.*\.md$" | sed -E "s|^docs/(.*)\.md$|- [docs/\1.md](${build_url}\1/)|")

docs/administration/back_office/add_user_setting.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ To do so, create a setting class implementing two interfaces: `ValueDefinitionIn
1313
In this example the class is located in `src/Setting/Unit.php` and enables the user to select their preference for metric or imperial unit systems.
1414

1515
``` php
16-
[[= include_file('code_samples/back_office/settings/src/Setting/Unit.php') =]]
16+
[[= include_code('code_samples/back_office/settings/src/Setting/Unit.php') =]]
1717
```
1818

1919
Register the setting as a service:
@@ -30,7 +30,7 @@ It can be one of the built-in groups, or a custom one.
3030
To create a custom setting group, create an `App/Setting/Group/MyGroup.php` file:
3131

3232
``` php
33-
[[= include_file('code_samples/back_office/settings/src/Setting/Group/MyGroup.php') =]]
33+
[[= include_code('code_samples/back_office/settings/src/Setting/Group/MyGroup.php') =]]
3434
```
3535

3636
Register the setting group as a service:

docs/administration/back_office/back_office_elements/extending_thumbnails.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ First, create base strategy for returning custom thumbnails from a static file.
4242
Create `StaticStrategy.php` in `src/Strategy`.
4343

4444
```php
45-
[[= include_file('code_samples/back_office/thumbnails/src/Strategy/StaticThumbnailStrategy.php') =]]
45+
[[= include_code('code_samples/back_office/thumbnails/src/Strategy/StaticThumbnailStrategy.php') =]]
4646
```
4747

4848
Next, add the strategy with the `ibexa.repository.thumbnail.strategy.content` tag and `priority: 100` to `config/services.yaml`:

docs/administration/back_office/back_office_menus/add_menu_item.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ The route indicates a controller that fetches all visible content items and rend
3535
Create the following controller file in `src/Controller/AllContentListController.php`:
3636

3737
``` php
38-
[[= include_file('code_samples/back_office/menu/menu_item/src/Controller/AllContentListController.php') =]]
38+
[[= include_code('code_samples/back_office/menu/menu_item/src/Controller/AllContentListController.php') =]]
3939
```
4040

4141
## Add template

docs/administration/back_office/back_office_menus/back_office_menus.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,7 @@ To add an inactive menu section, don't add a route to its parameters.
7272
The following method adds a new menu section under **Content**, and under it, a new item with custom attributes:
7373

7474
``` php
75-
[[= include_file('code_samples/back_office/menu/menu_item/src/EventSubscriber/MyMenuSubscriber.php', 30, 43) =]]
75+
[[= include_code('code_samples/back_office/menu/menu_item/src/EventSubscriber/MyMenuSubscriber.php', 31, 43, remove_indent=True) =]]
7676
```
7777

7878
`label` is used for the new menu item in the interface.
@@ -127,13 +127,13 @@ You can use the `extras.icon` parameter to define an icon for a menu item.
127127
For example, the following code changes the default icon for the **Create content** button in content view:
128128

129129
``` php
130-
[[= include_file('code_samples/back_office/menu/menu_item/src/EventSubscriber/MyMenuSubscriber.php', 46, 48) =]]
130+
[[= include_code('code_samples/back_office/menu/menu_item/src/EventSubscriber/MyMenuSubscriber.php', 47, 48, remove_indent=True) =]]
131131
```
132132

133133
## Removing menu items
134134

135135
To remove a menu item, for example, to remove the **Copy subtree** item from the right menu in content view, use the following event listener:
136136

137137
``` php
138-
[[= include_file('code_samples/back_office/menu/menu_item/src/EventSubscriber/MyMenuSubscriber.php', 44, 45) =]]
138+
[[= include_code('code_samples/back_office/menu/menu_item/src/EventSubscriber/MyMenuSubscriber.php', 45, 45, remove_indent=True) =]]
139139
```

docs/administration/back_office/back_office_tabs/back_office_tabs.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ You can order the tabs by making the tab implement `OrderedTabInterface`.
4747
The order depends on the numerical value returned by the `getOrder` method:
4848

4949
``` php
50-
[[= include_file('code_samples/back_office/dashboard/article_tab/src/Tab/Dashboard/Everyone/EveryoneArticleTab.php', 37, 41) =]]
50+
[[= include_code('code_samples/back_office/dashboard/article_tab/src/Tab/Dashboard/Everyone/EveryoneArticleTab.php', 38, 41, remove_indent=True) =]]
5151
```
5252

5353
Tabs are displayed according to this value in ascending order.

docs/administration/back_office/back_office_tabs/create_dashboard_tab.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ To create a new tab in the dashboard, create an `EveryoneArticleTab.php` file in
88
This adds a tab to the **Common content** dashboard block that displays all articles in the repository.
99

1010
``` php hl_lines="17 38 50-53 64-66"
11-
[[= include_file('code_samples/back_office/dashboard/article_tab/src/Tab/Dashboard/Everyone/EveryoneArticleTab.php') =]]
11+
[[= include_code('code_samples/back_office/dashboard/article_tab/src/Tab/Dashboard/Everyone/EveryoneArticleTab.php') =]]
1212
```
1313

1414
This tab searches for content with content type "Article" (lines 50-53) and uses the built-in `all_content.html.twig` template to render the results, which ensures that the tab looks the same as the existing tabs (lines 64-66).

docs/administration/back_office/content_tab_switcher.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,7 @@ The `meta_field_groups_list` configuration can be overridden.
7474
First, create an event listener in the `src/EventListener/TextAnchorMenuTabListener.php`:
7575

7676
``` php hl_lines="28 31"
77-
[[= include_file('code_samples/back_office/content_type/src/EventListener/TextAnchorMenuTabListener.php') =]]
77+
[[= include_code('code_samples/back_office/content_type/src/EventListener/TextAnchorMenuTabListener.php') =]]
7878
```
7979

8080
A new custom tab is defined in the line 28, the line 31 defines items for the second level.

docs/administration/back_office/customize_calendar.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -40,15 +40,15 @@ The following example shows how to create custom events which add different holi
4040
First, create a new event in `src/Calendar/Holidays/Event.php`:
4141

4242
``` php
43-
[[= include_file('code_samples/back_office/calendar/src/Calendar/Holidays/Event.php') =]]
43+
[[= include_code('code_samples/back_office/calendar/src/Calendar/Holidays/Event.php') =]]
4444
```
4545

4646
Here, you define a new class for your event based on `Ibexa\Contracts\Calendar\Event`.
4747

4848
Next, create `src/Calendar/Holidays/EventType.php`:
4949

5050
```php hl_lines="20-23"
51-
[[= include_file('code_samples/back_office/calendar/src/Calendar/Holidays/EventType.php') =]]
51+
[[= include_code('code_samples/back_office/calendar/src/Calendar/Holidays/EventType.php') =]]
5252
```
5353

5454
You can use the identifier defined in lines 20-23 to configure [event colors](#customize-colors-and-icons).
@@ -109,7 +109,7 @@ To do this, place the following `holidays.json` file in `src/Calendar/Holidays`:
109109
Next, import this file in `src/Calendar/Holidays/EventSourceFactory.php`:
110110

111111
``` php hl_lines="6-9"
112-
[[= include_file('code_samples/back_office/calendar/src/Calendar/Holidays/EventSourceFactory.php', 16, 30) =]]
112+
[[= include_code('code_samples/back_office/calendar/src/Calendar/Holidays/EventSourceFactory.php', 17, 30, remove_indent=True) =]]
113113
```
114114

115115
The calendar now displays the events listed in the JSON file.

docs/administration/back_office/customize_integrated_help.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -96,7 +96,7 @@ In this example, it removes a product roadmap entry from the menu and adds a hel
9696
The tab is displayed in a production environment only.
9797

9898
``` php
99-
[[= include_file('code_samples/back_office/menu/menu_item/src/EventSubscriber/HelpMenuSubscriber.php') =]]
99+
[[= include_code('code_samples/back_office/menu/menu_item/src/EventSubscriber/HelpMenuSubscriber.php') =]]
100100
```
101101

102102
!!! tip

0 commit comments

Comments
 (0)