Skip to content
This repository was archived by the owner on Jan 7, 2025. It is now read-only.

Commit 6dbaf8c

Browse files
authored
Merge pull request #23 from ably/edx-218-update-readme
[EDX-218] Update README with an introduction and further information
2 parents f5a47c1 + 0e96bb6 commit 6dbaf8c

File tree

1 file changed

+85
-14
lines changed

1 file changed

+85
-14
lines changed

README.md

Lines changed: 85 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,85 @@
1-
# Canonical descriptions
2-
3-
When creating and updating descriptions, use the following guidelines:
4-
5-
* Never use “optionally”. This should be defined by the spec and the SDK dev should take it from there.
6-
* Use a verb with an `s` e.g. Retrieves or Sends.
7-
* Retrieves instead of Gets for describing a GET request.
8-
* Parameters should always have their own row.
9-
* Return value should always be after the listed parameters (on its own row).
10-
* Descriptions always go in the last column.
11-
* Method signature should always be left intact.
12-
* Class descriptions should start "The XXX object…"
13-
* Parameter and return values should be in backticks.
14-
* The expression key-value pairs should be hyphenated as used on [Wikipedia](https://en.wikipedia.org/wiki/Name%E2%80%93value_pair).
1+
# Canonical table
2+
3+
This repository is intended to be a language-agnostic reference for SDK developers to use when adding docstring comments to Ably SDKs.
4+
5+
The repository contains a set of tables in [descriptions.md](/descriptions.md) that complements the [Ably features spec](https://docs.ably.io/client-lib-development-guide/features). Each class and enum has its own table with an associated description for the class or enum. Every method and property is documented within the appropriate table.
6+
7+
## Table format
8+
9+
### Classes
10+
11+
The table for each class contains the following columns:
12+
13+
```
14+
| Method / Property | Parameter | Returns | Spec | Description |
15+
```
16+
17+
* **Method/Property**: The full method signature (code formatted only where necessary, e.g. where it includes `<`, or property name.
18+
* **Parameter**: Each parameter should have its own row and be code formatted.
19+
* **Returns**: The return value should be code formatted and has its own row, after the parameters have been listed.
20+
* **Spec**: The spec point related to the method or property.
21+
* **Description**: The language-agnostic description that will form the docstrings.
22+
23+
### Enums
24+
25+
The table for each enum contains the following columns:
26+
27+
```
28+
| Enum | Spec | Description |
29+
```
30+
31+
* **Enum**: The name of each value for the enum.
32+
* **Spec**: The spec point related to the enum.
33+
* **Description**: The language-agnostic description that will form the docstrings.
34+
35+
## Conventions
36+
37+
The following conventions should be followed when adding a new method or property to the table:
38+
39+
* Use a verb with an `s` for method descriptions. Common uses are:
40+
* `get` --> `retrieves`
41+
* `subscribe` --> `registers (a listener)`
42+
* `publish` --> `Publishes`
43+
* The expression key-value pairs should be hyphenated.
44+
* Parameters or returns that refer to another class are referred to in terms of objects, for example:
45+
```
46+
A [`Channels`]{@link Channels} object.
47+
```
48+
49+
* Links to other classes/enums are written in the format:
50+
```
51+
[`<text>`]{@link <class>#<property>}
52+
```
53+
54+
For example:
55+
```
56+
[`ClientOptions.logLevel`]{@link ClientOptions#logLevel}`
57+
```
58+
* If a method references its own class, it should just be code formatted, and not link to itself.
59+
* Descriptions can link out to conceptual docs hosted on `ably.com/docs`, but should never link to the API references hosted there.
60+
* A class or object should always be capitalized.
61+
* Methods and parameters should always be lower-case.
62+
* If adding a method/property to separate REST and realtime classes, ensure the descriptions are consistent (where possible).
63+
* When a return value is returned in a paginated list, the description should link to the PaginatedResult class, as well as the class of whatever is returned.
64+
* Items deprecated in the features spec should include the following text at the beginning of the description: `DEPRECATED: this <property/method> is deprecated and will be removed in a future version.`
65+
* Default values should be listed in the description field.
66+
* If a minimum or maximum value exists for a parameter then it should be listed in the description field.
67+
* Time values should be referred to as `milliseconds since the Unix epoch` where applicable.
68+
69+
## Static site introduction
70+
71+
The following text is an introduction that can be added to each static site generated from an SDK after docstring comments have been added:
72+
73+
```
74+
# Ably `<Language>` Client Library SDK API Reference
75+
76+
The `<Language>` Client Library SDK supports a realtime and a REST interface.
77+
78+
The realtime interface enables a client to maintain a persistent connection to Ably and publish, subscribe and be present on channels. The REST interface is stateless and typically implemented server-side. It is used to make requests such as retrieving statistics, token authentication and publishing to a channel.
79+
80+
**Note**: The `<Language>` Client Library SDK implements the realtime and REST interfaces as two separate libraries.
81+
82+
The `<Language>` API references are generated from the [Ably `<Language>` Client Library SDK source code](link-to-Ably-repo) using [`<Tool>`](link-to-tool). View the [Ably docs](http://ably.com/docs/) for conceptual information on using Ably and for client library API references split between the [realtime](http://ably.com/docs/api/realtime-sdk) and [REST](http://ably.com/docs/api/rest-sdk) interfaces.
83+
```
84+
85+
It can be amended as necessary, for example where an SDK implements the REST and realtime interfaces as two separate libraries.

0 commit comments

Comments
 (0)