Skip to content

Commit

Permalink
Finalize the port of the documentation to MkDocs
Browse files Browse the repository at this point in the history
  • Loading branch information
cedx committed Apr 8, 2024
1 parent 41e9118 commit 1d89ec7
Show file tree
Hide file tree
Showing 6 changed files with 16 additions and 15 deletions.
10 changes: 4 additions & 6 deletions docs/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,11 @@
Used by millions of websites, [Akismet](https://akismet.com) filters out hundreds of millions of spam comments from the Web every day.
Add Akismet to your [JavaScript](https://developer.mozilla.org/docs/Web/JavaScript) applications so you don't have to worry about spam again.

## Quick start

### Get an API key
The Akismet service requires an API key.
If you are not already registered, [sign up for an Akismet account](https://akismet.com/developers).
!!! warning
The Akismet service requires an API key.
If you are not already registered, [sign up for an Akismet account](https://akismet.com/developers).

### Get the library
## Quick start
Install the latest version of **Akismet for JS** with [npm](https://getcomposer.org) package manager:

```shell
Expand Down
5 changes: 3 additions & 2 deletions docs/usage/check_comment.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ This is the call you will make the most. It takes a number of arguments and char
and then returns a thumbs up or thumbs down. **Performance can drop dramatically if you choose to exclude data points.**
The more data you send Akismet about each comment, the greater the accuracy. We recommend erring on the side of including too much data.

```js
```ts
Client.checkComment(comment: Comment): Promise<CheckResult>
```

Expand All @@ -21,7 +21,8 @@ The `Comment` providing the user's message to be checked.
## Return value
A `Promise` that resolves with a `CheckResult` value indicating whether the given `Comment` is ham, spam or pervasive spam.

> A comment classified as pervasive spam can be safely discarded.
!!! tip
A comment classified as pervasive spam can be safely discarded.

The promise rejects with an `Error` when an issue occurs.
The error `message` usually includes some debug information, provided by the `X-akismet-debug-help` HTTP header,
Expand Down
5 changes: 3 additions & 2 deletions docs/usage/submit_ham.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
This call is intended for the submission of false positives - items that were incorrectly classified as spam by Akismet.
It takes identical arguments as [comment check](check_comment.md) and [submit spam](submit_spam.md).

```js
```ts
Client.submitHam(comment: Comment): Promise<void>
```

Expand All @@ -16,7 +16,8 @@ See the [Akismet API documentation](https://akismet.com/developers/detailed-docs
### **comment**: Comment
The user's `Comment` to be submitted, incorrectly classified as spam.

> Ideally, it should be the same object as the one passed to the original [comment check](check_comment.md) API call.
!!! note
Ideally, it should be the same object as the one passed to the original [comment check](check_comment.md) API call.

## Return value
A `Promise` that resolves when the given `Comment` has been submitted.
Expand Down
5 changes: 3 additions & 2 deletions docs/usage/submit_spam.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# Submit spam
This call is for submitting comments that weren't marked as spam but should have been.

```js
```ts
Client.submitSpam(comment: Comment): Promise<void>
```

Expand All @@ -18,7 +18,8 @@ See the [Akismet API documentation](https://akismet.com/developers/detailed-docs
### **comment**: Comment
The user's `Comment` to be submitted, incorrectly classified as ham.

> Ideally, it should be the same object as the one passed to the original [comment check](check_comment.md) API call.
!!! note
Ideally, it should be the same object as the one passed to the original [comment check](check_comment.md) API call.

## Return value
A `Promise` that resolves when the given `Comment` has been submitted.
Expand Down
2 changes: 1 addition & 1 deletion docs/usage/verify_key.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
Key verification authenticates your API key before calling the [comment check](check_comment.md),
[submit spam](submit_spam.md) or [submit ham](submit_ham.md) methods.

```js
```ts
Client.verifyKey(): Promise<boolean>
```

Expand Down
4 changes: 2 additions & 2 deletions etc/mkdocs.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -43,10 +43,10 @@ nav:
- Comment check: usage/check_comment.md
- Submit spam: usage/submit_spam.md
- Submit ham: usage/submit_ham.md
- Further reading:
- Related topics:
- API reference: api/
- Testing: testing.md
- About:
- See also:
- Changelog: changelog.md
- License: license.md

Expand Down

0 comments on commit 1d89ec7

Please sign in to comment.