Skip to content

Commit 232aa76

Browse files
authored
chore: Fix markdown lint issues (#283)
1 parent 69f964d commit 232aa76

File tree

12 files changed

+35
-17
lines changed

12 files changed

+35
-17
lines changed

.markdownlint.yaml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,4 +2,5 @@ MD001: false
22
MD013: false
33
MD014: false
44
MD024: false
5-
MD033: false # Allow inline HTML
5+
MD033: false # Allow inline HTML
6+
MD059: false # Allow non descriptive link text

docs/06-concepts/06-database/01-connection.md

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@ In Serverpod the connection details and password for the database are stored ins
44

55
The easiest way to get started is to use a Docker container to run your local Postgres server, and this is how Serverpod is set up out of the box. This page contains more detailed information if you want to connect to another database instance or run Postgres locally yourself.
66

7-
87
### Connection details
98

109
Each environment configuration contains a `database` keyword that specifies the connection details.
@@ -49,7 +48,6 @@ database:
4948

5049
In this example, Postgres will look for tables in the `custom` schema first, and then fall back to `public` if needed. This gives you more control over where your data lives and how it’s accessed
5150

52-
5351
### Database password
5452

5553
The database password is stored in a separate file called `passwords.yaml` in the same `config` directory. The password for each environment is stored under the `database` keyword in the file.
@@ -102,7 +100,6 @@ To connect to a remote Postgres server (that you have installed on a VPS or VDS)
102100
- You may need to open the database port on the machine. This may include configuring its firewall.
103101
- Update your Serverpod `database` config to use the public network address, database name, port, user, and password.
104102

105-
106103
### Connecting to Google Cloud SQL
107104

108105
You can connect to a Google Cloud SQL Postgres instance in two ways:
@@ -114,13 +111,14 @@ The next step is to update the database password in `passwords.yaml` and the con
114111

115112
:::info
116113

117-
If you are using the `isUnixSocket` don't forget to add **"/.s.PGSQL.5432"** to the end of the `host` IP address. Otherwise, your Google Cloud Run instance will not be able to connect to the database.
114+
If you are using the `isUnixSocket` don't forget to add __"/.s.PGSQL.5432"__ to the end of the `host` IP address. Otherwise, your Google Cloud Run instance will not be able to connect to the database.
118115

119116
:::
120117

121118
### Connecting to AWS RDS
122119

123120
You can connect to an AWS RDS Instance in two ways:
121+
124122
1. Enable public access to the database and configure VPC/Subnets to accept your Serverpod's IP address.
125123
2. Use the Endpoint `database-name.some-unique-id.server-location.rds.amazonaws.com` to connect to it from AWS ECS.
126124

docs/06-concepts/06-database/03-relations/05-referential-actions.md

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@ relation(onUpdate=<ACTION>, onDelete=<ACTION>)
2121
```
2222

2323
## Default values
24+
2425
If no referential actions are specified, the default behavior will be applied.
2526

2627
If the relation is defined as an [object relation](one-to-one#with-an-object), the default behavior is `NoAction` for both onUpdate and onDelete.
@@ -29,10 +30,8 @@ If the relation is defined as an [object relation](one-to-one#with-an-object), t
2930
parent: Model?, relation(onUpdate=NoAction, onDelete=NoAction)
3031
```
3132
32-
3333
If the relation is defined as an [id relation](one-to-one#with-an-id-field), the default behavior is `NoAction` for onUpdate and `Cascade` for onDelete.
3434

35-
3635
```yaml
3736
parentId: int?, relation(parent=model_table, onUpdate=NoAction, onDelete=Cascade)
3837
```

docs/06-concepts/06-database/08-transactions.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
The essential point of a database transaction is that it bundles multiple steps into a single, all-or-nothing operation. The intermediate states between the steps are not visible to other concurrent transactions, and if some failure occurs that prevents the transaction from completing, then none of the steps affect the database at all.
44

5-
Serverpod handles database transactions through the `session.db.transaction` method. The method takes a callback function that receives a transaction object.
5+
Serverpod handles database transactions through the `session.db.transaction` method. The method takes a callback function that receives a transaction object.
66

77
The transaction is committed when the callback function returns, and rolled back if an exception is thrown. Any return value of the callback function is returned by the `transaction` method.
88

@@ -63,6 +63,7 @@ A savepoint is a special mark inside a transaction that allows all commands that
6363
Read more about savepoints in the [PostgreSQL documentation](https://www.postgresql.org/docs/current/sql-savepoint.html).
6464

6565
### Creating savepoints
66+
6667
To create a savepoint, call the `createSavepoint` method on the transaction object:
6768

6869
```dart

docs/06-concepts/06-database/10-raw-access.md

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,6 @@ Simple query mode is suitable for:
3333
* Queries containing multiple statements.
3434
* Situations where the extended query protocol is not available (e.g., replication mode or with proxies like PGBouncer).
3535

36-
3736
```dart
3837
DatabaseResult result = await session.db.unsafeSimpleQuery(
3938
r'SELECT * FROM mytable WHERE id = 1; SELECT * FROM othertable;'
@@ -78,4 +77,3 @@ var result = await db.unsafeQuery(
7877
:::danger
7978
Always sanitize your input when using raw query methods. For the `unsafeQuery` and `unsafeExecute` methods, use query parameters to prevent SQL injection. Avoid using `unsafeSimpleQuery` and `unsafeSimpleExecute` unless the simple query protocol is strictly required.
8079
:::
81-

docs/06-concepts/11-authentication/01-setup.md

Lines changed: 16 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,7 @@ void run(List<String> args) async {
3434
...
3535
}
3636
```
37+
3738
Optionally, add a nickname for the module in the `config/generator.yaml` file. This nickname will be used as the name of the module in the code.
3839

3940
```yaml
@@ -71,8 +72,8 @@ $ dart run bin/main.dart --role maintenance --apply-migrations
7172
The full migration instructions can be found in the [migration guide](../database/migrations).
7273

7374
### Configure Authentication
74-
Serverpod's auth module comes with a default Authentication Configuration. To customize it, go to your main `server.dart` file, import the `serverpod_auth_server` module and set up the authentication configuration:
7575

76+
Serverpod's auth module comes with a default Authentication Configuration. To customize it, go to your main `server.dart` file, import the `serverpod_auth_server` module and set up the authentication configuration:
7677

7778
```dart
7879
import 'package:serverpod_auth_server/module.dart' as auth;
@@ -185,22 +186,27 @@ void main() async {
185186
The `SessionManager` has useful methods for viewing and monitoring the user's current state.
186187

187188
#### Check authentication state
189+
188190
To check if the user is signed in:
189191

190192
```dart
191193
sessionManager.isSignedIn;
192194
```
195+
193196
Returns `true` if the user is signed in, or `false` otherwise.
194197

195198
#### Access current user
199+
196200
To retrieve information about the current user:
197201

198202
```dart
199203
sessionManager.signedInUser;
200204
```
205+
201206
Returns a `UserInfo` object if the user is currently signed in, or `null` if the user is not.
202207

203208
#### Register authentication
209+
204210
To register a signed in user in the session manager:
205211

206212
```dart
@@ -210,9 +216,11 @@ await sessionManager.registerSignedInUser(
210216
authKey,
211217
);
212218
```
219+
213220
This will persist the user information and refresh any open streaming connection, see [Custom Providers - Client Setup](providers/custom-providers#client-setup) for more details.
214221

215222
#### Monitor authentication changes
223+
216224
To add a listener that tracks changes in the user's authentication state, useful for updating the UI:
217225

218226
```dart
@@ -226,24 +234,28 @@ void initState() {
226234
});
227235
}
228236
```
237+
229238
The listener is triggered whenever the user's sign-in state changes.
230239

231240
#### Sign out current device
241+
232242
To sign the user out on from the current device:
233243

234244
```dart
235245
await sessionManager.signOutDevice();
236246
```
247+
237248
Returns `true` if the sign-out is successful, or `false` if it fails.
238249

239250
#### Sign out all devices
251+
240252
To sign the user out across all devices:
241253

242254
```dart
243255
await sessionManager.signOutAllDevices();
244256
```
245-
Returns `true` if the user is successfully signed out from all devices, or `false` if it fails.
246257

258+
Returns `true` if the user is successfully signed out from all devices, or `false` if it fails.
247259

248260
:::info
249261

@@ -252,4 +264,5 @@ The `signOut` method is deprecated. This method calls the deprecated `signOut` s
252264
```dart
253265
await sessionManager.signOut(); // Deprecated
254266
```
255-
:::
267+
268+
:::

docs/06-concepts/11-authentication/02-basics.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -131,12 +131,12 @@ await client.modules.auth.status.signOutAllDevices();
131131

132132
This status endpoint retrieves the user ID from session's authentication information, then revokes all authentication keys related to that user.
133133

134-
:::info
134+
:::info
135135
The `signOut` status endpoint is deprecated. Use `signOutDevice` or `signOutAllDevices` instead.
136136

137137
```dart
138138
await client.modules.auth.status.signOut(); // Deprecated
139139
```
140140

141141
The behavior of `signOut` is controlled by `legacyUserSignOutBehavior`, which you can adjust in the [configure authentication](setup#configure-authentication) section. This allows you to control the signout behaviour of already shipped clients.
142-
:::
142+
:::

docs/06-concepts/11-authentication/04-providers/06-custom-providers.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -193,6 +193,7 @@ await UserAuthentication.signOutUser(
193193
userId: 123, // Optional: If omitted, the currently authenticated user will be signed out
194194
);
195195
```
196+
196197
This method deletes all authentication keys associated with the user.
197198

198199
##### Signing out a specific user

docs/06-concepts/11-authentication/05-custom-overrides.md

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ List<String> scopes = extractScopes(token);
5050
Set<Scope> userScopes = scopes.map((scope) => Scope(scope)).toSet();
5151
```
5252

53-
### Handling revoked authentication
53+
### Handling revoked authentication
5454

5555
When a user's authentication is revoked, the server must be notified to respect the changes (e.g. to close method streams). Invoke the `session.messages.authenticationRevoked` method and raise the appropriate event to notify the server.
5656

@@ -73,6 +73,7 @@ await session.messages.authenticationRevoked(
7373
- `message` - The revoked authentication event message. See below for the different type of messages.
7474

7575
#### Revoked authentication messages
76+
7677
There are three types of `RevokedAuthentication` messages that are used to specify the extent of the authentication revocation:
7778

7879
| Message type | Description |
@@ -200,6 +201,7 @@ You will also need to implement the `AuthenticationHandler` accordingly, in orde
200201

201202
The header value must be compliant with the HTTP header format defined in RFC 9110 HTTP Semantics, 11.6.2. Authorization.
202203
See:
204+
203205
- [HTTP Authorization header](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Authorization)
204206
- [RFC 9110, 11.6.2. Authorization](https://httpwg.org/specs/rfc9110.html#field.authorization)
205207

docs/06-concepts/19-testing/01-get-started.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ For Serverpod Mini projects, everything related to the database in this guide ca
88

99
:::
1010

11+
<!-- markdownlint-disable MD029 -->
1112
<details>
1213
<summary> Have an existing project? Follow these steps first!</summary>
1314
<p>
@@ -168,6 +169,7 @@ dev_dependencies:
168169
That's it, the project setup should be ready to start using the test tools!
169170
</p>
170171
</details>
172+
<!-- markdownlint-enable MD029 -->
171173
172174
Go to the server directory and generate the test tools:
173175
@@ -213,6 +215,7 @@ Before the test can be run the Postgres and Redis also have to be started:
213215
```bash
214216
docker-compose up --build --detach
215217
```
218+
216219
Now the test is ready to be run:
217220

218221
```bash

docs/06-concepts/19-testing/02-the-basics.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -206,6 +206,7 @@ dart test -t integration --concurrency=1
206206

207207
For the other cases this is not an issue, as each `withServerpod` has its own transaction and will therefore be isolated.
208208

209+
<!-- markdownlint-disable MD029 -->
209210
3. **Database exceptions that are quelled**: There is a specific edge case where the test tools behavior deviates from production behavior. See example below:
210211

211212
```dart
@@ -225,6 +226,7 @@ await transactionFuture;
225226
```
226227

227228
In production, the transaction call will throw if any database exception happened during its execution, _even_ if the exception was first caught inside the transaction. However, in the test tools this will not throw an exception due to how the nested transactions are emulated. Quelling exceptions like this is not best practise, but if the code under test does this setting `rollbackDatabase` to `RollbackDatabse.disabled` will ensure the code behaves like in production.
229+
<!-- markdownlint-enable MD029 -->
228230

229231
## Test exceptions
230232

docs/index.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -166,4 +166,4 @@ This will start the Flutter app in your browser. It should look like this:
166166

167167
## Next steps
168168

169-
The quickest way to learn Serverpod is to follow our 30-minute __[Getting Started](01-get-started/01-creating-endpoints.md)__ guide. This will give you an excellent overview of creating endpoints and models and working with the database. You will create a fun app that magically creates recipes from the ingredients you have in your fridge.
169+
The quickest way to learn Serverpod is to follow our 30-minute **[Getting Started](01-get-started/01-creating-endpoints.md)** guide. This will give you an excellent overview of creating endpoints and models and working with the database. You will create a fun app that magically creates recipes from the ingredients you have in your fridge.

0 commit comments

Comments
 (0)