Skip to content

Commit

Permalink
MNT Add documentation linting (#271)
Browse files Browse the repository at this point in the history
* MNT Add documentation linting

* DOC Fix linting issues in docs
  • Loading branch information
GuySartorelli authored Apr 4, 2024
1 parent d0c44eb commit 3a607ba
Show file tree
Hide file tree
Showing 7 changed files with 28 additions and 23 deletions.
1 change: 1 addition & 0 deletions .doclintrc
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
docs/en/
10 changes: 8 additions & 2 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,9 @@
"silverstripe/frameworktest": "^1",
"dnadesign/silverstripe-elemental": "^5",
"silverstripe/recipe-testing": "^3",
"squizlabs/php_codesniffer": "^3",
"silverstripe/standards": "^1",
"silverstripe/documentation-lint": "^1",
"squizlabs/php_codesniffer": "^3",
"phpstan/extension-installer": "^1.3"
},
"autoload": {
Expand All @@ -45,5 +46,10 @@
]
},
"minimum-stability": "dev",
"prefer-stable": true
"prefer-stable": true,
"config": {
"allow-plugins": {
"dealerdirect/phpcodesniffer-composer-installer": true
}
}
}
5 changes: 1 addition & 4 deletions docs/en/01_basic_usage.md
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ class MyModel extends DataObject
[
LinkField::create('HasOneLink'),
MultiLinkField::create('HasManyLinks'),
],
]
);

return $fields;
Expand All @@ -79,8 +79,6 @@ If you have multiple `has_many` relations on the same class, they should all poi
```php
namespace App\Model;

use SilverStripe\LinkField\Form\LinkField;
use SilverStripe\LinkField\Form\MultiLinkField;
use SilverStripe\LinkField\Models\Link;
use SilverStripe\ORM\DataObject;

Expand Down Expand Up @@ -117,7 +115,6 @@ class MyModel extends DataObject
private static $has_many = [
'HasManyLinks' => Link::class . '.Owner',
];

// ...

public function getCMSCompositeValidator(): CompositeValidator
Expand Down
8 changes: 4 additions & 4 deletions docs/en/02_configuration.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ summary: Advanced usage of the Link model and link fields

# Configuring links and link fields

## Controlling what type of links can be created in a LinkField
## Controlling what type of links can be created in a link field

By default, all [`Link`](api:SilverStripe\LinkField\Models\Link) subclasses can be created by a [`LinkField`](api:SilverStripe\LinkField\Form\LinkField) or [`MultiLinkField`](api:SilverStripe\LinkField\Form\MultiLinkField). This includes any custom `Link` subclasses defined in your project or via a third party module.

Expand Down Expand Up @@ -57,7 +57,7 @@ class MyModel extends DataObject
[
LinkField::create('EmailLink')->setAllowedTypes([EmailLink::class]),
MultiLinkField::create('LinkList')->setAllowedTypes([SiteTreeLink::class, EmailLink::class]),
],
]
);
return $fields;
}
Expand Down Expand Up @@ -90,7 +90,7 @@ class MyModel extends DataObject
[
LinkField::create('Link')->setExcludeLinkTextField(true),
MultiLinkField::create('LinkList')->setExcludeLinkTextField(true),
],
]
);
return $fields;
}
Expand All @@ -101,7 +101,7 @@ class MyModel extends DataObject

You can customise the position of the link type in the menu by setting the the [`menu_priority`](api:SilverStripe\LinkField\Models\Link->menu_priority) configuration property. The priority is in ascending order (i.e. a link with a lower priority value will be displayed higher in the list).

You can also set an icon that will correspond to a specific type of link by setting the value of the [`icon`](api:SilverStripe\LinkField\Models\Link->icon) configuration property. The value of this configuration corresponds to the css class of the icon to be used.
You can also set an icon that will correspond to a specific type of link by setting the value of the [`icon`](api:SilverStripe\LinkField\Models\Link->icon) configuration property. The value of this configuration corresponds to the CSS class of the icon to be used.

> [!TIP]
> You can find the set of available icons in the [pattern library](https://silverstripe.github.io/silverstripe-pattern-lib/?path=/story/admin-icons--icon-reference).
Expand Down
12 changes: 6 additions & 6 deletions docs/en/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,14 +6,14 @@ icon: link

# Linkfield

Make sure that your SilverStripe CMS installation has [`silverstripe/linkfield`](https://github.com/silverstripe/silverstripe-linkfield/) installed.
Make sure that your Silverstripe CMS installation has [`silverstripe/linkfield`](https://github.com/silverstripe/silverstripe-linkfield/) installed.

This module provides a Link model and CMS interface for managing different types of links. Including:

* Emails
* External links
* Links to pages within the CMS
* Links to assets within the CMS
* Phone numbers
- Emails
- External links
- Links to pages within the CMS
- Links to assets within the CMS
- Phone numbers

[CHILDREN includeFolders]
12 changes: 6 additions & 6 deletions docs/en/userguide/02_work_with_link_field.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,15 +9,15 @@ Previous sections provided fundamental knowledge for creating links. In contrast

The LinkField module offers two primary types of fields: one for managing a single link and the other for managing multiple links. While there are some differences in how these fields operate, let's first outline the key aspects that are common to both types of fields.

- To view more detailed information or make changes to an existing link, click anywhere on the link details. This opens the modal window where adjustments can be made. If no changes are required, you can simply close the modal window.
- To view more detailed information or make changes to an existing link, click anywhere on the link details. This opens the modal window where adjustments can be made. If no changes are required, you can simply close the modal window.

- Once a new link is created, basic information about it will be displayed in the Link field.
- Once a new link is created, basic information about it will be displayed in the Link field.

- Any information entered is automatically saved upon the creation of a new link or when you update the link data.
- Any information entered is automatically saved upon the creation of a new link or when you update the link data.

- To publish links, you need to publish a page or data object using the link field.
- To publish links, you need to publish a page or data object using the link field.

- Once created, you can modify the link type. To change a link to a different type, you must delete the existing link and create a new one.
- Once created, you can modify the link type. To change a link to a different type, you must delete the existing link and create a new one.

## Disabled or read-only links

Expand Down Expand Up @@ -62,7 +62,7 @@ You can remove an existing link by clicking on the "Archive" button.

![A screenshot of the multilink field](./_images/delete_button.png)

## Version history
## Version history

Link Field includes versioning support, meaning any changes made are recorded in the change history. Additionally, a badge will appear to indicate interference whenever modifications are made.

Expand Down
3 changes: 2 additions & 1 deletion docs/en/userguide/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,9 @@ summary: How to use the Link Field module to manage links in the CMS.
# Managing links in the CMS

## Before we begin
>
> [!IMPORTANT]
> Make sure that your SilverStripe CMS installation has the [LinkField](https://packagist.org/packages/silverstripe/linkfield) module installed.
> Make sure that your Silverstripe CMS installation has the [LinkField](https://packagist.org/packages/silverstripe/linkfield) module installed.
## Introduction

Expand Down

0 comments on commit 3a607ba

Please sign in to comment.