Skip to content
This repository has been archived by the owner on Jun 26, 2020. It is now read-only.

[Docs] Fix some typos #256

Merged
merged 1 commit into from
Dec 3, 2018
Merged

[Docs] Fix some typos #256

merged 1 commit into from
Dec 3, 2018

Conversation

denisname
Copy link
Contributor

Examples for fixes can be found in tests/.

There are some typos I don't know how to fix:

  • KeystrokeInfo: the properties altKey, ctrlKey and shiftKey are all optional.
  • Options: the properties fitInViewport and limiter are all optional.
  • Emitter#delegate: type for events is ...String.
  • Observable#bind: type for bindProperties is ...String.
  • Observable#unbind: type for unbindProperties is ...String.

@denisname
Copy link
Contributor Author

Do you really need a Contributor License Agreement for such trival non code fixes?

@coveralls
Copy link

Coverage Status

Coverage remained the same at 100.0% when pulling 5978e4c on denisname:types-typos into 6202253 on ckeditor:master.

@Reinmar
Copy link
Member

Reinmar commented Nov 7, 2018

Thank you so much for tracking all those mistakes ❤️❤️❤️

Do you really need a Contributor License Agreement for such trival non code fixes?

Frankly speaking, I don't know. But then, I'd go with the safe: yes. It just saves us from thinking about possible problems that could arise in all possible universes in the future.

@Reinmar Reinmar requested a review from pomek November 7, 2018 15:57
@Reinmar
Copy link
Member

Reinmar commented Dec 3, 2018

Hi @denisname! We received your CLA (along with 2 other PRs :)). I understand now, though, why you asked whether you have to sign it – if I had to do that via traditional mail, I'd be a bit surprised too (you could have signed it online). We'd like to thank you for your troubles with a small souvenir – could email me ([email protected]) your t-shirt size and address?

@Reinmar Reinmar merged commit 5978e4c into ckeditor:master Dec 3, 2018
Reinmar added a commit that referenced this pull request Dec 3, 2018
Copy link
Member

@Reinmar Reinmar left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

A couple of comments (I made the necessary changes myself). Thank you!

@@ -20,8 +20,8 @@ import { isString } from 'lodash-es';
*
* @param {Document} doc Document used to create element.
* @param {String} name Name of the element.
* @param {Object} attributes Object keys will become attributes keys and object values will became attributes values.
* @param {Node|String|Array.<Node|String>} children Child or array of children. Strings will be automatically turned
* @param {Object|null} [attributes] Object keys will become attributes keys and object values will became attributes values.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The null is unnecessary, since the param is marked as optional.

@@ -12,7 +12,7 @@ import global from './global';
/**
* For a given element, returns the nearest ancestor element which CSS position is not "static".
*
* @param {HTMLElement} element Native DOM element to be checked.
* @param {HTMLElement} [element] Native DOM element to be checked.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What would this function be doing if the element was not specified? This param is required for it do work.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It returns null. There is a test for it. That said, required make more sense indeed.

@@ -43,7 +43,7 @@ export const keyCodes = generateKnownKeyCodes();
*
* Note: Key names are matched with {@link module:utils/keyboard~keyCodes} in a case-insensitive way.
*
* @param {String|module:utils/keyboard~KeystrokeInfo} Key name (see {@link module:utils/keyboard~keyCodes})
* @param {String|module:utils/keyboard~KeystrokeInfo} key name (see {@link module:utils/keyboard~keyCodes})
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That's a sentence so it should start with an uppercased letter.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

When looking in documentation (https://ckeditor.com/docs/ckeditor5/latest/api/module_utils_keyboard.html#static-function-getCode), there is

getCode( Key ) → Number

Although all functions always have they parameters with lower case. Also in the Parameters part, sentence is broken between "key" and "name".

What about the following code instead (twice key)?

* @param {String|module:utils/keyboard~KeystrokeInfo} key Key name (see {@link module:utils/keyboard~keyCodes})

By the way, how do you generate the documentation? I did not find anything in the doc about it. Do you use internal tools?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi, @denisname!

By the way, how do you generate the documentation? I did not find anything in the doc about it. Do you use internal tools?

Yes, we use the JSDoc3 package with a few custom plugins available here - https://github.com/ckeditor/ckeditor5-dev/tree/master/packages/jsdoc-plugins to generate proper AST tree and then we generate the documentation using our internal tool called Umberto.

What about the following code instead (twice key)?

* @param {String|module:utils/keyboard~KeystrokeInfo} key Key name (see {@link module:utils/keyboard~keyCodes})

Yep, you're right, the sentence should include both keys as the first key must match the param's name.

Btw I've proposed ckeditor/ckeditor5#1415, it should solve many of such typos and small documentation errors.

@@ -81,7 +81,7 @@ export default class KeystrokeHandler {
* @param {String|Array.<String|Number>} keystroke Keystroke defined in a format accepted by
* the {@link module:utils/keyboard~parseKeystroke} function.
* @param {Function} callback A function called with the
* {@link module:engine/view/observer/keyobserver~KeyEventData key event data} object and
* {@link module:utils/keyboard~KeystrokeInfo keystroke info} object and
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That's a bit messy now, but it's actually called with KeyEventData. The KeyEventData objects implements KeystrokeInfo but it adds preventDefault() and stopPropagation() methods (which are mentioned later in this sentence. It'd be good to not rely on engine's object type, so that's why I said it's messy. But other than that, KeyEventData is more correct.

@Reinmar
Copy link
Member

Reinmar commented Dec 3, 2018

I merged the PR. Some changes weren't correct (I left comments), but most of them were. Thank you!

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants