TTY: Document WriteStream.cursorTo and others#22893
TTY: Document WriteStream.cursorTo and others#22893ur0 wants to merge 3 commits intonodejs:masterfrom
Conversation
Adds documentation for the following WriteStream instance methods: - cursorTo - moveCursor - clearLine - clearScreenDown - getWindowSize Fixes nodejs#9853.
vsemozhetbyt
left a comment
There was a problem hiding this comment.
Hi @ur0. Thank you for an effort to improve the docs!
I do not know if these methods are intended to be documented but in case they do, I've mentioned some nits that can be fixed)
doc/api/tty.md
Outdated
| * `x` {number} | ||
| * `y` {number} | ||
|
|
||
| `writeStream.cursorTo` moves this `WriteStream`'s cursor to the specified |
There was a problem hiding this comment.
`writeStream.cursorTo` -> `writeStream.cursorTo()` as per our doc/STYLE_GUIDE.md. The same for the method mentions below.
doc/api/tty.md
Outdated
| `writeStream.cursorTo` moves this `WriteStream`'s cursor to the specified | ||
| position. | ||
|
|
||
| ### writeStream.moveCursor(dx, dy) |
There was a problem hiding this comment.
Doc sections need to be ABC-sorted by their headings.
doc/api/tty.md
Outdated
| <!-- YAML | ||
| added: v0.7.7 | ||
| --> | ||
| * Returns: {array} |
There was a problem hiding this comment.
{array} -> {Array} (non-primitive types are uppercased).
Or maybe, as we know the array's elements type, we can make this {number[]}.
doc/api/tty.md
Outdated
| --> | ||
| * Returns: {array} | ||
|
|
||
| `writeStream.getWindowSize` returns the size of the [TTY]() corresponding |
There was a problem hiding this comment.
It seems the link should be [TTY](tty.html) or [TTY](#tty_tty) here and below.
doc/api/tty.md
Outdated
|
|
||
| `writeStream.getWindowSize` returns the size of the [TTY]() corresponding | ||
| to this `WriteStream`. The array is of the type `[numColumns, numRows]` | ||
| where `numColumns` and `numRows` represents the number of columns and rows |
There was a problem hiding this comment.
represents -> represent.
|
cc @nodejs/documentation |
|
Thanks @vsemozhetbyt! I’ll fix the issues in a bit. |
|
ping @ur0 … anything we can help with? :) |
- Adds missing parens in function names - Changes `array` to `number[]` - Sorts headers - Adds missing link
|
Sorry for the delay, and thanks for the offer @addaleax! Just fixed all of the nits. CC @vsemozhetbyt @nodejs/documentation for a review. |
jasnell
left a comment
There was a problem hiding this comment.
Looks like CI failed so that'll need a look but otherwise LGTM
doc/api/tty.md
Outdated
| where `numColumns` and `numRows` represent the number of columns and rows | ||
| in the corresponding [TTY](tty.html). | ||
|
|
||
| ## tty.isatty(fd) |
There was a problem hiding this comment.
It seems this section should be the last one)
doc/api/tty.md
Outdated
| Use the `NODE_DISABLE_COLORS` environment variable to enforce this function to | ||
| always return 1. | ||
|
|
||
| ## writeStream.getWindowSize() |
doc/api/tty.md
Outdated
| --> | ||
| * Returns: {number[]} | ||
|
|
||
| `writeStream.getWindowSize()` returns the size of the [TTY](tty.html) corresponding |
There was a problem hiding this comment.
This line exceeds 80 characters limit (linter fails here).
|
@ur0 Thank you for the fixes and patience. Just a few nits remain to be addressed. |
|
@vsemozhetbyt all done, hopefully. |
Adds documentation for the following `WriteStream` instance methods: - `WriteStream.clearLine()` - `WriteStream.clearScreenDown()` - `WriteStream.cursorTo()` - `WriteStream.getWindowSize()` - `WriteStream.moveCursor()` PR-URL: #22893 Fixes: #9853 Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Vse Mozhet Byt <vsemozhetbyt@gmail.com>
|
Landed in 2ba19ff Thank you! |
Adds documentation for the following `WriteStream` instance methods: - `WriteStream.clearLine()` - `WriteStream.clearScreenDown()` - `WriteStream.cursorTo()` - `WriteStream.getWindowSize()` - `WriteStream.moveCursor()` PR-URL: #22893 Fixes: #9853 Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Vse Mozhet Byt <vsemozhetbyt@gmail.com>
Adds documentation for the following `WriteStream` instance methods: - `WriteStream.clearLine()` - `WriteStream.clearScreenDown()` - `WriteStream.cursorTo()` - `WriteStream.getWindowSize()` - `WriteStream.moveCursor()` PR-URL: #22893 Fixes: #9853 Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Vse Mozhet Byt <vsemozhetbyt@gmail.com>
Adds documentation for the following `WriteStream` instance methods: - `WriteStream.clearLine()` - `WriteStream.clearScreenDown()` - `WriteStream.cursorTo()` - `WriteStream.getWindowSize()` - `WriteStream.moveCursor()` PR-URL: #22893 Fixes: #9853 Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Vse Mozhet Byt <vsemozhetbyt@gmail.com>
This adds documentation for the following WriteStream instance methods:
Fixes #9853.
Checklist