Skip to content

Commit

Permalink
Merge pull request #13636 from ckeditor/api-docs-fixes
Browse files Browse the repository at this point in the history
Docs: Fixed a dozen errors reported by the Typedoc validator.
  • Loading branch information
niegowski committed Mar 8, 2023
2 parents 76c9f34 + 8076517 commit 9c6f3d1
Show file tree
Hide file tree
Showing 48 changed files with 139 additions and 118 deletions.
4 changes: 2 additions & 2 deletions docs/framework/architecture/core-editor-architecture.md
Expand Up @@ -200,7 +200,7 @@ class MyPlugin extends Plugin {
}
```

The second listener to `'execute'` shows one of the very common practices in CKEditor 5 code. Basically, the default action of `'execute'` (which is calling the `execute()` method) is registered as a listener to that event with a default priority. Thanks to that, by listening to the event using `'low'` or `'high'` priorities you can execute some code before or after `execute()` is really called. If you stop the event, then the `execute()` method will not be called at all. In this particular case, the {@link module:core/command~Command#execute `Command#execute()`} method was decorated with the event using the {@link module:utils/observablemixin~ObservableMixin#decorate `ObservableMixin#decorate()`} function:
The second listener to `'execute'` shows one of the very common practices in CKEditor 5 code. Basically, the default action of `'execute'` (which is calling the `execute()` method) is registered as a listener to that event with a default priority. Thanks to that, by listening to the event using `'low'` or `'high'` priorities you can execute some code before or after `execute()` is really called. If you stop the event, then the `execute()` method will not be called at all. In this particular case, the {@link module:core/command~Command#execute `Command#execute()`} method was decorated with the event using the {@link module:utils/observablemixin~Observable#decorate `ObservableMixin#decorate()`} function:

```js
import ObservableMixin from '@ckeditor/ckeditor5-utils/src/observablemixin';
Expand All @@ -223,7 +223,7 @@ mix( Command, ObservableMixin );
Check out the {@link framework/deep-dive/event-system event system deep dive guide} and the {@link framework/deep-dive/observables observables deep dive guide} to learn more about the advanced usage of events and observables with some additional examples.
</info-box>

Besides decorating methods with events, observables allow to observe their chosen properties. For instance, the `Command` class makes its `#value` and `#isEnabled` observable by calling {@link module:utils/observablemixin~ObservableMixin#set `set()`}:
Besides decorating methods with events, observables allow to observe their chosen properties. For instance, the `Command` class makes its `#value` and `#isEnabled` observable by calling {@link module:utils/observablemixin~Observable#set `set()`}:

```js
class Command {
Expand Down
6 changes: 3 additions & 3 deletions docs/updating/migration-from-ckeditor-4.md
Expand Up @@ -198,11 +198,11 @@ Note: The number of options was reduced on purpose. We understood that configuri
</tr>
<tr>
<td><a href="/docs/ckeditor4/latest/api/CKEDITOR_config.html#cfg-cloudServices_tokenUrl">cloudServices_tokenUrl</a></td>
<td>See {@link module:cloud-services/cloudservices~CloudServicesConfig#tokenUrl `config.cloudServices.tokenUrl`}.</td>
<td>See {@link module:cloud-services/cloudservicesconfig~CloudServicesConfig#tokenUrl `config.cloudServices.tokenUrl`}.</td>
</tr>
<tr>
<td><a href="/docs/ckeditor4/latest/api/CKEDITOR_config.html#cfg-cloudServices_uploadUrl">cloudServices_uploadUrl</a></td>
<td>See {@link module:cloud-services/cloudservices~CloudServicesConfig#uploadUrl `config.cloudServices.uploadUrl`}. Check out the {@link features/image-upload comprehensive "Image upload" guide} to learn more.</td>
<td>See {@link module:cloud-services/cloudservicesconfig~CloudServicesConfig#uploadUrl `config.cloudServices.uploadUrl`}. Check out the {@link features/image-upload comprehensive "Image upload" guide} to learn more.</td>
</tr>
<tr>
<td><a href="/docs/ckeditor4/latest/api/CKEDITOR_config.html#cfg-codeSnippetGeshi_url">codeSnippetGeshi_url</a> <br> <a href="/docs/ckeditor4/latest/api/CKEDITOR_config.html#cfg-codeSnippet_codeClass">codeSnippet_codeClass</a> <br> <a href="/docs/ckeditor4/latest/api/CKEDITOR_config.html#cfg-codeSnippet_languages">codeSnippet_languages</a> <br> <a href="/docs/ckeditor4/latest/api/CKEDITOR_config.html#cfg-codeSnippet_theme">codeSnippet_theme</a></td>
Expand Down Expand Up @@ -432,7 +432,7 @@ Note: The number of options was reduced on purpose. We understood that configuri
</tr>
<tr>
<td><a href="/docs/ckeditor4/latest/api/CKEDITOR_config.html#cfg-format_h1">format_h1</a> <br> <a href="/docs/ckeditor4/latest/api/CKEDITOR_config.html#cfg-format_h2">format_h2</a> <br> <a href="/docs/ckeditor4/latest/api/CKEDITOR_config.html#cfg-format_h3">format_h3</a> <br> <a href="/docs/ckeditor4/latest/api/CKEDITOR_config.html#cfg-format_h4">format_h4</a> <br> <a href="/docs/ckeditor4/latest/api/CKEDITOR_config.html#cfg-format_h5">format_h5</a> <br> <a href="/docs/ckeditor4/latest/api/CKEDITOR_config.html#cfg-format_h6">format_h6</a></td>
<td>All headings are configurable via {@link module:heading/heading~HeadingConfig#options `config.heading.options`}. See also the {@link features/headings Headings feature guide}.</td>
<td>All headings are configurable via {@link module:heading/headingconfig~HeadingConfig#options `config.heading.options`}. See also the {@link features/headings Headings feature guide}.</td>
</tr>
<tr>
<td><a href="/docs/ckeditor4/latest/api/CKEDITOR_config.html#cfg-format_tags">format_tags</a></td>
Expand Down
4 changes: 2 additions & 2 deletions docs/updating/update-to-29.md
Expand Up @@ -191,8 +191,8 @@ Since the appearance of the image in the document depends on the image type (blo

* Several changes have been also made to the {@link module:image/imagestyle~ImageStyle} plugin API:
* In the {@link module:image/imagestyle/utils image style utilities} module:
* The `defaultIcons` were renamed to {@link module:image/imagestyle/utils~DEFAULT_ICONS}.
* The `defaultStyles` were renamed to {@link module:image/imagestyle/utils~DEFAULT_OPTIONS}.
* The `defaultIcons` were renamed to {@link module:image/imagestyle/utils#DEFAULT_ICONS}.
* The `defaultStyles` were renamed to {@link module:image/imagestyle/utils#DEFAULT_OPTIONS}.
* The `normalizeImageStyles()` function was removed from the public API.
* The `ImageStyleCommand#defaultStyle` and `ImageStyleCommand#styles` were removed from the public API.

Expand Down
2 changes: 1 addition & 1 deletion packages/ckeditor5-autoformat/docs/features/autoformat.md
Expand Up @@ -28,7 +28,7 @@ The following block formatting options are available:
* {@link features/lists Bulleted list} &ndash; Start a line with `*` or `-` followed by a space.
* {@link features/lists Numbered list} &ndash; Start a line with `1.` or `1)` followed by a space.
* {@link features/todo-lists To-do list} &ndash; Start a line with `[ ]` or `[x]` followed by a space to insert an unchecked or checked list item, respectively.
* {@link features/headings Headings} &ndash; Start a line with `#` or `##` or `###` followed by a space to create a heading 1, heading 2, or heading 3 (up to heading 6 if {@link module:heading/heading~HeadingConfig#options} defines more headings).
* {@link features/headings Headings} &ndash; Start a line with `#` or `##` or `###` followed by a space to create a heading 1, heading 2, or heading 3 (up to heading 6 if {@link module:heading/headingconfig~HeadingConfig#options} defines more headings).
* {@link features/block-quote Block quote} &ndash; Start a line with `>` followed by a space.
* {@link features/code-blocks Code block} &ndash; Start a line with `` ``` ``.
* {@link features/horizontal-line Horizontal line} &ndash; Start a line with `---`.
Expand Down
2 changes: 1 addition & 1 deletion packages/ckeditor5-ckbox/docs/features/ckbox.md
Expand Up @@ -195,7 +195,7 @@ Also, make sure to include the translation file after loading the CKBox library:

### Providing the token URL

The CKBox feature requires the token endpoint URL configured in the {@link module:ckbox/ckbox~CKBoxConfig#tokenUrl `config.ckbox.tokenUrl`} key. If not explicitly provided, the token URL from {@link module:cloud-services/cloudservices~CloudServicesConfig#tokenUrl `config.cloudServices.tokenUrl`} is used instead. If both are provided, the token URL defined in `config.ckbox.tokenUrl` takes precedence over the `config.cloudServices.tokenUrl`.
The CKBox feature requires the token endpoint URL configured in the {@link module:ckbox/ckbox~CKBoxConfig#tokenUrl `config.ckbox.tokenUrl`} key. If not explicitly provided, the token URL from {@link module:cloud-services/cloudservicesconfig~CloudServicesConfig#tokenUrl `config.cloudServices.tokenUrl`} is used instead. If both are provided, the token URL defined in `config.ckbox.tokenUrl` takes precedence over the `config.cloudServices.tokenUrl`.

```js
import CKBox from '@ckeditor/ckeditor5-ckbox/src/ckbox';
Expand Down
5 changes: 3 additions & 2 deletions packages/ckeditor5-clipboard/src/clipboardobserver.ts
Expand Up @@ -139,7 +139,8 @@ function getDropViewRange( view: View, domEvent: DragEvent & { rangeParent?: Nod
}

/**
* Fired as a continuation of the {@link #event:paste} and {@link #event:drop} events.
* Fired as a continuation of the {@link module:engine/view/document~Document#event:paste} and
* {@link module:engine/view/document~Document#event:drop} events.
*
* It is a part of the {@glink framework/deep-dive/clipboard#input-pipeline clipboard input pipeline}.
*
Expand Down Expand Up @@ -299,7 +300,7 @@ export type ViewDocumentCutEvent = {
};

/**
* Fired as a continuation of the {@link #event:dragover} event.
* Fired as a continuation of the {@link module:engine/view/document~Document#event:dragover} event.
*
* It is a part of the {@glink framework/deep-dive/clipboard#input-pipeline clipboard input pipeline}.
*
Expand Down
Expand Up @@ -6,7 +6,7 @@ category: api-reference

[![npm version](https://badge.fury.io/js/%40ckeditor%2Fckeditor5-cloud-services.svg)](https://www.npmjs.com/package/@ckeditor/ckeditor5-cloud-services)

CKEditor 5's [Cloud Services](https://ckeditor.com/ckeditor-cloud-services/) integration layer, which handles {@link module:cloud-services/cloudservices~CloudServicesConfig `config.cloudServices`} and tokens.
CKEditor 5's [Cloud Services](https://ckeditor.com/ckeditor-cloud-services/) integration layer, which handles {@link module:cloud-services/cloudservicesconfig~CloudServicesConfig `config.cloudServices`} and tokens.

## Installation

Expand Down
2 changes: 1 addition & 1 deletion packages/ckeditor5-core/src/command.ts
Expand Up @@ -244,7 +244,7 @@ function forceDisable( evt: EventInfo<string, boolean> ) {
}

/**
* Event fired by the {@link ~Command#execute} method. The command action is a listener to this event so it's
* Event fired by the {@link module:core/command~Command#execute} method. The command action is a listener to this event so it's
* possible to change/cancel the behavior of the command by listening to this event.
*
* See {@link module:utils/observablemixin~Observable#decorate} for more information and samples.
Expand Down
6 changes: 3 additions & 3 deletions packages/ckeditor5-core/src/editor/editor.ts
Expand Up @@ -346,9 +346,9 @@ export default abstract class Editor extends ObservableMixin() {

public set isReadOnly( value: boolean ) {
/**
* The {@link ~Editor#isReadOnly Editor#isReadOnly} property is read-only since version `34.0.0` and can be set only using
* {@link ~Editor#enableReadOnlyMode `Editor#enableReadOnlyMode( lockId )`} and
* {@link ~Editor#disableReadOnlyMode `Editor#disableReadOnlyMode( lockId )`}.
* The {@link module:core/editor/editor~Editor#isReadOnly Editor#isReadOnly} property is read-only since version `34.0.0`
* and can be set only using {@link module:core/editor/editor~Editor#enableReadOnlyMode `Editor#enableReadOnlyMode( lockId )`} and
* {@link module:core/editor/editor~Editor#disableReadOnlyMode `Editor#disableReadOnlyMode( lockId )`}.
*
* Usage before version `34.0.0`:
*
Expand Down
4 changes: 2 additions & 2 deletions packages/ckeditor5-core/src/editor/utils/elementapimixin.ts
Expand Up @@ -28,8 +28,8 @@ export default function ElementApiMixin<Base extends Constructor<Editor>>( base:
/**
* Cannot update the source element of a detached editor.
*
* The {@link ~ElementApi#updateSourceElement `updateSourceElement()`} method cannot be called if you did not
* pass an element to `Editor.create()`.
* The {@link module:core/editor/utils/elementapimixin~ElementApi#updateSourceElement `updateSourceElement()`}
* method cannot be called if you did not pass an element to `Editor.create()`.
*
* @error editor-missing-sourceelement
*/
Expand Down
2 changes: 1 addition & 1 deletion packages/ckeditor5-easy-image/docs/features/easy-image.md
Expand Up @@ -42,7 +42,7 @@ The demo below uses the {@link installation/getting-started/predefined-builds#cl
To make enabling image upload in CKEditor 5 a breeze, by default all builds include the {@link module:easy-image/easyimage~EasyImage `EasyImage` plugin}. It integrates with the Easy Image service provided by [CKEditor Cloud Services](https://ckeditor.com/ckeditor-cloud-services/). Enabling it is straightforward and the results are immediate:

1. Follow the [Easy Image &mdash; Quick start guide](https://ckeditor.com/docs/cs/latest/guides/easy-image/quick-start.html) to set up an account.
2. Configure CKEditor 5 (see {@link module:cloud-services/cloudservices~CloudServicesConfig `CloudServicesConfig`}):
2. Configure CKEditor 5 (see {@link module:cloud-services/cloudservicesconfig~CloudServicesConfig `CloudServicesConfig`}):

```js
ClassicEditor
Expand Down
Expand Up @@ -612,7 +612,7 @@ Which, in turn, has these [semantics](#defining-additional-semantics):

## Defining advanced rules in `checkChild()` callbacks

The {@link module:engine/model/schema~Schema#checkChild `Schema#checkChild()`} method which is the a base method used to check whether some element is allowed in a given structure is {@link module:utils/observablemixin~ObservableMixin#decorate a decorated method}. It means that you can add listeners to implement your specific rules which are not limited by the {@link module:engine/model/schema~SchemaItemDefinition declarative `SchemaItemDefinition` API}.
The {@link module:engine/model/schema~Schema#checkChild `Schema#checkChild()`} method which is the a base method used to check whether some element is allowed in a given structure is {@link module:utils/observablemixin~Observable#decorate a decorated method}. It means that you can add listeners to implement your specific rules which are not limited by the {@link module:engine/model/schema~SchemaItemDefinition declarative `SchemaItemDefinition` API}.

These listeners can be added either by listening directly to the {@link module:engine/model/schema~Schema#event:checkChild} event or by using the handy {@link module:engine/model/schema~Schema#addChildCheck `Schema#addChildCheck()`} method.

Expand Down
21 changes: 12 additions & 9 deletions packages/ckeditor5-engine/src/controller/datacontroller.ts
Expand Up @@ -193,9 +193,10 @@ export default class DataController extends EmitterMixin() {

if ( !this._checkIfRootsExists( [ rootName ] ) ) {
/**
* Cannot get data from a non-existing root. This error is thrown when {@link ~DataController#get DataController#get() method}
* Cannot get data from a non-existing root. This error is thrown when
* {@link module:engine/controller/datacontroller~DataController#get `DataController#get()` method}
* is called with a non-existent root name. For example, if there is an editor instance with only `main` root,
* calling {@link ~DataController#get} like:
* calling {@link module:engine/controller/datacontroller~DataController#get} like:
*
* ```ts
* data.get( { rootName: 'root2' } );
Expand Down Expand Up @@ -326,9 +327,10 @@ export default class DataController extends EmitterMixin() {

if ( !this._checkIfRootsExists( Object.keys( initialData ) ) ) {
/**
* Cannot init data on a non-existent root. This error is thrown when {@link ~DataController#init DataController#init() method}
* Cannot init data on a non-existent root. This error is thrown when
* {@link module:engine/controller/datacontroller~DataController#init DataController#init() method}
* is called with non-existent root name. For example, if there is an editor instance with only `main` root,
* calling {@link ~DataController#init} like:
* calling {@link module:engine/controller/datacontroller~DataController#init} like:
*
* ```ts
* data.init( { main: '<p>Foo</p>', root2: '<p>Bar</p>' } );
Expand Down Expand Up @@ -399,9 +401,10 @@ export default class DataController extends EmitterMixin() {

if ( !this._checkIfRootsExists( Object.keys( newData ) ) ) {
/**
* Cannot set data on a non-existent root. This error is thrown when the {@link ~DataController#set DataController#set() method}
* Cannot set data on a non-existent root. This error is thrown when the
* {@link module:engine/controller/datacontroller~DataController#set DataController#set() method}
* is called with non-existent root name. For example, if there is an editor instance with only the default `main` root,
* calling {@link ~DataController#set} like:
* calling {@link module:engine/controller/datacontroller~DataController#set} like:
*
* ```ts
* data.set( { main: '<p>Foo</p>', root2: '<p>Bar</p>' } );
Expand Down Expand Up @@ -537,9 +540,9 @@ export type DataControllerReadyEvent = {
};

/**
* An event fired after the {@link ~DataController#init `init()` method} was run. It can be {@link #listenTo listened to} in order to adjust
* or modify the initialization flow. However, if the `init` event is stopped or prevented, the {@link #event:ready `ready` event}
* should be fired manually.
* An event fired after the {@link ~DataController#init `init()` method} was run. It can be {@link ~DataController#listenTo listened to} in
* order to adjust or modify the initialization flow. However, if the `init` event is stopped or prevented,
* the {@link ~DataController#event:ready `ready` event} should be fired manually.
*
* The `init` event is fired by the decorated {@link ~DataController#init} method.
* See {@link module:utils/observablemixin~Observable#decorate} for more information and samples.
Expand Down
Expand Up @@ -152,7 +152,7 @@ export default class DowncastDispatcher extends EmitterMixin() {
* @fires remove
* @fires attribute
* @fires addMarker
* @fires removeMarker
* @fires removeMarker
* @fires reduceChanges
* @param differ The differ object with buffered changes.
* @param markers Markers related to the model fragment to convert.
Expand Down
4 changes: 2 additions & 2 deletions packages/ckeditor5-engine/src/conversion/upcastdispatcher.ts
Expand Up @@ -576,15 +576,15 @@ export type UpcastElementEvent = UpcastEvent<'element', ViewElement>;
* Fired when a {@link module:engine/view/text~Text} is converted.
*
* @eventName ~UpcastDispatcher#text
* @see #event:element
* @see ~UpcastDispatcher#event:element
*/
export type UpcastTextEvent = UpcastEvent<'text', ViewText>;

/**
* Fired when a {@link module:engine/view/documentfragment~DocumentFragment} is converted.
*
* @eventName ~UpcastDispatcher#documentFragment
* @see #event:element
* @see ~UpcastDispatcher#event:element
*/
export type UpcastDocumentFragmentEvent = UpcastEvent<'documentFragment', ViewDocumentFragment>;

Expand Down
1 change: 1 addition & 0 deletions packages/ckeditor5-engine/src/model/document.ts
Expand Up @@ -438,6 +438,7 @@ export default class Document extends EmitterMixin() {
* ```
*
* @eventName ~Document#change
* @eventName ~Document#change:data
* @param batch The batch that was used in the executed changes block.
*/
export type DocumentChangeEvent = {
Expand Down
8 changes: 4 additions & 4 deletions packages/ckeditor5-engine/src/model/schema.ts
Expand Up @@ -79,9 +79,9 @@ export default class Schema extends ObservableMixin() {
*
* This situation may happen when:
*
* * Two or more plugins called {@link ~Schema#register `register()`} with the same name. This will usually mean that
* there is a collision between plugins which try to use the same element in the model. Unfortunately,
* the only way to solve this is by modifying one of these plugins to use a unique model element name.
* * Two or more plugins called {@link module:engine/model/schema~Schema#register `register()`} with the same name.
* This will usually mean that there is a collision between plugins which try to use the same element in the model.
* Unfortunately, the only way to solve this is by modifying one of these plugins to use a unique model element name.
* * A single plugin was loaded twice. This happens when it is installed by npm/yarn in two versions
* and usually means one or more of the following issues:
* * a version mismatch (two of your dependencies require two different versions of this plugin),
Expand Down Expand Up @@ -138,7 +138,7 @@ export default class Schema extends ObservableMixin() {
* Cannot extend an item which was not registered yet.
*
* This error happens when a plugin tries to extend the schema definition of an item which was not
* {@link ~Schema#register registered} yet.
* {@link module:engine/model/schema~Schema#register registered} yet.
*
* @param itemName The name of the model element which is being extended.
* @error schema-cannot-extend-missing-item
Expand Down
1 change: 0 additions & 1 deletion packages/ckeditor5-engine/src/view/documentfragment.ts
Expand Up @@ -214,7 +214,6 @@ export default class DocumentFragment extends EmitterMixin( TypeCheckable ) impl
* @internal
* @param type Type of the change.
* @param node Changed node.
* @fires change
*/
public _fireChange( type: ChangeType, node: Node | DocumentFragment ): void {
this.fire( 'change:' + type, node );
Expand Down

0 comments on commit 9c6f3d1

Please sign in to comment.