Skip to content

Commit a95bd38

Browse files
authored
🔧 Update config with new pymdown extensions (#712)
* 🔧 Update config with new pymdown extensions * 📝 Update admonition blocks syntax * 📝 Update syntax for tabs with new pymdown extensions
1 parent 71baff6 commit a95bd38

39 files changed

+709
-360
lines changed

docs/advanced/decimal.md

Lines changed: 22 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -21,15 +21,21 @@ In most cases this would probably not be a problem, for example measuring views
2121

2222
Pydantic has special support for `Decimal` types using the <a href="https://pydantic-docs.helpmanual.io/usage/types/#arguments-to-condecimal" class="external-link" target="_blank">`condecimal()` special function</a>.
2323

24-
!!! tip
25-
Pydantic 1.9, that will be released soon, has improved support for `Decimal` types, without needing to use the `condecimal()` function.
24+
/// tip
2625

27-
But meanwhile, you can already use this feature with `condecimal()` in **SQLModel** it as it's explained here.
26+
Pydantic 1.9, that will be released soon, has improved support for `Decimal` types, without needing to use the `condecimal()` function.
27+
28+
But meanwhile, you can already use this feature with `condecimal()` in **SQLModel** it as it's explained here.
29+
30+
///
2831

2932
When you use `condecimal()` you can specify the number of digits and decimal places to support. They will be validated by Pydantic (for example when using FastAPI) and the same information will also be used for the database columns.
3033

31-
!!! info
32-
For the database, **SQLModel** will use <a href="https://docs.sqlalchemy.org/en/14/core/type_basics.html#sqlalchemy.types.DECIMAL" class="external-link" target="_blank">SQLAlchemy's `DECIMAL` type</a>.
34+
/// info
35+
36+
For the database, **SQLModel** will use <a href="https://docs.sqlalchemy.org/en/14/core/type_basics.html#sqlalchemy.types.DECIMAL" class="external-link" target="_blank">SQLAlchemy's `DECIMAL` type</a>.
37+
38+
///
3339

3440
## Decimals in SQLModel
3541

@@ -72,8 +78,11 @@ We are also saying that the number of decimal places (to the right of the decima
7278
* `123`
7379
* Even though this number doesn't have any decimals, we still have 3 places saved for them, which means that we can **only use 2 places** for the **integer part**, and this number has 3 integer digits. So, the allowed number of integer digits is `max_digits` - `decimal_places` = 2.
7480

75-
!!! tip
76-
Make sure you adjust the number of digits and decimal places for your own needs, in your own application. 🤓
81+
/// tip
82+
83+
Make sure you adjust the number of digits and decimal places for your own needs, in your own application. 🤓
84+
85+
///
7786

7887
## Create models with Decimals
7988

@@ -142,7 +151,10 @@ Total money: 3.300
142151

143152
</div>
144153

145-
!!! warning
146-
Although Decimal types are supported and used in the Python side, not all databases support it. In particular, SQLite doesn't support decimals, so it will convert them to the same floating `NUMERIC` type it supports.
154+
/// warning
155+
156+
Although Decimal types are supported and used in the Python side, not all databases support it. In particular, SQLite doesn't support decimals, so it will convert them to the same floating `NUMERIC` type it supports.
157+
158+
But decimals are supported by most of the other SQL databases. 🎉
147159

148-
But decimals are supported by most of the other SQL databases. 🎉
160+
///

docs/databases.md

Lines changed: 21 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,12 @@
11
# Intro to Databases
22

3-
!!! info
4-
Are you a seasoned developer and already know everything about databases? 🤓
3+
/// info
54

6-
Then you can skip to the [Tutorial - User Guide: First Steps](tutorial/index.md){.internal-link target=_blank} right away.
5+
Are you a seasoned developer and already know everything about databases? 🤓
6+
7+
Then you can skip to the [Tutorial - User Guide: First Steps](tutorial/index.md){.internal-link target=_blank} right away.
8+
9+
///
710

811
If you don't know everything about databases, here's a quick overview.
912

@@ -17,8 +20,11 @@ So, what is a database?
1720

1821
A **database** is a system to store and manage data in a structured and very efficient way.
1922

20-
!!! tip
21-
It's very common to abbreviate the word "database" as **"DB"**.
23+
/// tip
24+
25+
It's very common to abbreviate the word "database" as **"DB"**.
26+
27+
///
2228

2329
As there's a lot of information about databases, and it can get very technical and academic, I'll give you a quick overview about some of the main concepts here.
2430

@@ -28,8 +34,11 @@ I'll even tell you a bit about different types of databases, including the ones
2834

2935
When starting to program, it might **not be obvious** why having a database apart from the code for your program is a **good idea**. Let's start with that.
3036

31-
!!! tip
32-
If that's obvious to you, just continue in the next section below. 👇
37+
/// tip
38+
39+
If that's obvious to you, just continue in the next section below. 👇
40+
41+
///
3342

3443
In your code you already have **variables**, **dictionaries**, **lists**, etc. They all store **data** in some way already. Why would you need to have a separate database?
3544

@@ -308,8 +317,11 @@ Next, it receives the data and puts it in Python objects that you can continue t
308317

309318
I'll tell you more about SQL, SQLModel, how to use them, and how they are related in the next sections.
310319

311-
!!! info "Technical Details"
312-
SQLModel is built on top of SQLAlchemy. It is, in fact, just <a href="https://www.sqlalchemy.org/" class="external-link" target="_blank">SQLAlchemy</a> and <a href="https://pydantic-docs.helpmanual.io/" class="external-link" target="_blank">Pydantic</a> mixed together with some sugar on top.
320+
/// info | Technical Details
321+
322+
SQLModel is built on top of SQLAlchemy. It is, in fact, just <a href="https://www.sqlalchemy.org/" class="external-link" target="_blank">SQLAlchemy</a> and <a href="https://pydantic-docs.helpmanual.io/" class="external-link" target="_blank">Pydantic</a> mixed together with some sugar on top.
323+
324+
///
313325

314326
## NoSQL Databases
315327

docs/db-to-code.md

Lines changed: 20 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -172,8 +172,11 @@ The difference in the final SQL statement is subtle, but it changes the meaning
172172
SELECT * FROM hero WHERE id = "2; DROP TABLE hero;";
173173
```
174174

175-
!!! tip
176-
Notice the double quotes (`"`) making it a string instead of more raw SQL.
175+
/// tip
176+
177+
Notice the double quotes (`"`) making it a string instead of more raw SQL.
178+
179+
///
177180

178181
The database will not find any record with that ID:
179182

@@ -187,8 +190,11 @@ Then your code will continue to execute and calmly tell the user that it couldn'
187190

188191
But we never deleted the `hero` table. 🎉
189192

190-
!!! info
191-
Of course, there are also other ways to do SQL data sanitization without using a tool like **SQLModel**, but it's still a nice feature you get by default.
193+
/// info
194+
195+
Of course, there are also other ways to do SQL data sanitization without using a tool like **SQLModel**, but it's still a nice feature you get by default.
196+
197+
///
192198

193199
### Editor Support
194200

@@ -291,8 +297,11 @@ There are many ORMs available apart from **SQLModel**, you can read more about s
291297

292298
## SQL Table Names
293299

294-
!!! info "Technical Background"
295-
This is a bit of boring background for SQL purists. Feel free to skip this section. 😉
300+
/// info | Technical Background
301+
302+
This is a bit of boring background for SQL purists. Feel free to skip this section. 😉
303+
304+
///
296305

297306
When working with pure SQL, it's common to name the tables in plural. So, the table would be named `heroes` instead of `hero`, because it could contain multiple rows, each with one hero.
298307

@@ -304,5 +313,8 @@ You will see **your own code** a lot more than the internal table names, so it's
304313

305314
So, to keep things consistent, I'll keep using the same table names that **SQLModel** would have generated.
306315

307-
!!! tip
308-
You can also override the table name. You can read about it in the Advanced User Guide.
316+
/// tip
317+
318+
You can also override the table name. You can read about it in the Advanced User Guide.
319+
320+
///

docs/features.md

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -40,12 +40,15 @@ You won't need to keep guessing the types of different attributes in your models
4040

4141
<img class="shadow" src="/img/index/autocompletion01.png">
4242

43-
!!! info
44-
Don't worry, adopting this in-development standard only affects/improves editor support.
43+
/// info
4544

46-
It doesn't affect performance or correctness. And if the in-progress standard was deprecated your code won't be affected.
45+
Don't worry, adopting this in-development standard only affects/improves editor support.
4746

48-
Meanwhile, you will get inline errors (like type checks) and autocompletion on places you wouldn't get with any other library. 🎉
47+
It doesn't affect performance or correctness. And if the in-progress standard was deprecated your code won't be affected.
48+
49+
Meanwhile, you will get inline errors (like type checks) and autocompletion on places you wouldn't get with any other library. 🎉
50+
51+
///
4952

5053
## Short
5154

docs/help.md

Lines changed: 13 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -157,12 +157,15 @@ And if there's any other style or consistency need, I'll ask directly for that,
157157

158158
* Then **comment** saying that you did that, that's how I will know you really checked it.
159159

160-
!!! info
161-
Unfortunately, I can't simply trust PRs that just have several approvals.
160+
/// info
162161

163-
Several times it has happened that there are PRs with 3, 5 or more approvals, probably because the description is appealing, but when I check the PRs, they are actually broken, have a bug, or don't solve the problem they claim to solve. 😅
162+
Unfortunately, I can't simply trust PRs that just have several approvals.
164163

165-
So, it's really important that you actually read and run the code, and let me know in the comments that you did. 🤓
164+
Several times it has happened that there are PRs with 3, 5 or more approvals, probably because the description is appealing, but when I check the PRs, they are actually broken, have a bug, or don't solve the problem they claim to solve. 😅
165+
166+
So, it's really important that you actually read and run the code, and let me know in the comments that you did. 🤓
167+
168+
///
166169

167170
* If the PR can be simplified in a way, you can ask for that, but there's no need to be too picky, there might be a lot of subjective points of view (and I will have my own as well 🙈), so it's better if you can focus on the fundamental things.
168171

@@ -209,10 +212,13 @@ If you can help me with that, **you are helping me maintain SQLModel** and makin
209212

210213
Join the 👥 <a href="https://discord.gg/VQjSZaeJmf" class="external-link" target="_blank">FastAPI and Friends Discord chat server</a> 👥 and hang out with others in the community. There's a `#sqlmodel` channel.
211214

212-
!!! tip
213-
For questions, ask them in <a href="https://github.com/tiangolo/sqlmodel/discussions/new?category=questions" class="external-link" target="_blank">GitHub Discussions</a>, there's a much better chance you will receive help there.
215+
/// tip
216+
217+
For questions, ask them in <a href="https://github.com/tiangolo/sqlmodel/discussions/new?category=questions" class="external-link" target="_blank">GitHub Discussions</a>, there's a much better chance you will receive help there.
218+
219+
Use the chat only for other general conversations.
214220

215-
Use the chat only for other general conversations.
221+
///
216222

217223
### Don't use the chat for questions
218224

docs/tutorial/automatic-id-none-refresh.md

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -445,10 +445,13 @@ Hero 3: age=48 id=3 name='Rusty-Man' secret_name='Tommy Sharp'
445445

446446
Now let's review all this code once again.
447447

448-
!!! tip
449-
Each one of the numbered bubbles shows what each line will print in the output.
448+
/// tip
450449

451-
And as we created the **engine** with `echo=True`, we can see the SQL statements being executed at each step.
450+
Each one of the numbered bubbles shows what each line will print in the output.
451+
452+
And as we created the **engine** with `echo=True`, we can see the SQL statements being executed at each step.
453+
454+
///
452455

453456
```{ .python .annotate }
454457
{!./docs_src/tutorial/automatic_id_none_refresh/tutorial002.py!}

docs/tutorial/code-structure.md

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -149,10 +149,13 @@ Let's say that for some reason you hate the idea of having all the database mode
149149

150150
You can also do it. 😎 There's a couple of things to keep in mind. 🤓
151151

152-
!!! warning
153-
This is a bit more advanced.
152+
/// warning
154153

155-
If the solution above already worked for you, that might be enough for you, and you can continue in the next chapter. 🤓
154+
This is a bit more advanced.
155+
156+
If the solution above already worked for you, that might be enough for you, and you can continue in the next chapter. 🤓
157+
158+
///
156159

157160
Let's assume that now the file structure is:
158161

docs/tutorial/connect/create-connected-rows.md

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -37,8 +37,11 @@ Each row in the table `hero` will point to a row in the table `team`:
3737

3838
<img alt="table relationships" src="/img/tutorial/relationships/select/relationships2.svg">
3939

40-
!!! info
41-
We will later update **Spider-Boy** to add him to the **Preventers** team too, but not yet.
40+
/// info
41+
42+
We will later update **Spider-Boy** to add him to the **Preventers** team too, but not yet.
43+
44+
///
4245

4346
We will continue with the code in the previous example and we will add more things to it.
4447

docs/tutorial/connect/create-connected-tables.md

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -126,8 +126,11 @@ This is the name of the **table** in the database, so it is `"team"`, not the na
126126

127127
If you had a custom table name, you would use that custom table name.
128128

129-
!!! info
130-
You can learn about setting a custom table name for a model in the Advanced User Guide.
129+
/// info
130+
131+
You can learn about setting a custom table name for a model in the Advanced User Guide.
132+
133+
///
131134

132135
### Create the Tables
133136

@@ -167,8 +170,11 @@ And as before, we'll call this function from another function `main()`, and we'l
167170

168171
## Run the Code
169172

170-
!!! tip
171-
Before running the code, make sure you delete the file `database.db` to make sure you start from scratch.
173+
/// tip
174+
175+
Before running the code, make sure you delete the file `database.db` to make sure you start from scratch.
176+
177+
///
172178

173179
If we run the code we have up to now, it will go and create the database file `database.db` and the tables in it we just defined, `team` and `hero`:
174180

docs/tutorial/connect/index.md

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,10 @@ But the main advantage and feature of SQL databases is being able to handle rela
66

77
Let's see how to use **SQLModel** to manage connected data in the next chapters. 🤝
88

9-
!!! tip
10-
We will extend this further in the next group of chapters making it even more convenient to work with in Python code, using **relationship attributes**.
9+
/// tip
1110

12-
But you should start in this group of chapters first. 🤓
11+
We will extend this further in the next group of chapters making it even more convenient to work with in Python code, using **relationship attributes**.
12+
13+
But you should start in this group of chapters first. 🤓
14+
15+
///

0 commit comments

Comments
 (0)