mirror of
https://github.com/Fechin/reference.git
synced 2026-11-27 16:09:05 +03:00
feat: fix code highlighting and upgrade dependencies
- Fix markdown-it-highlightjs configuration for Hexo 7.0+ - Create custom highlight.js instance to handle unknown languages gracefully - Eliminate 'Could not find language' warning messages - Upgrade ESLint to v9 with flat config format - Update Fuse.js from 6.4.6 to 7.1.0 - Update multiple dependencies to latest versions Technical changes: - Set syntax_highlighter to empty in _config.yml - Add langPrefix: 'hljs language-' configuration - Migrate ESLint to eslint.config.js (flat config) - Update Service Worker for new Fuse.js version
This commit is contained in:
1 parent
3b60a4c9fa
commit
8fd81decca
18 files changed
+756
-769
No files matched your search
@@ -1,7 +1,7 @@
|
||||
---
|
||||
title: FastAPI
|
||||
date: 2025-06-07 18:40:00
|
||||
background: bg-[#059669]
|
||||
title: FastAPI
|
||||
date: 2025-06-07 18:40:00
|
||||
background: bg-[#059669]
|
||||
tags:
|
||||
- web
|
||||
- python
|
||||
@@ -40,8 +40,6 @@ def root():
|
||||
uvicorn main:app --reload
|
||||
```
|
||||
|
||||
|
||||
|
||||
## Routing & Parameters {.cols-3}
|
||||
|
||||
### Path Parameter
|
||||
@@ -68,8 +66,6 @@ def filter_data(limit: int = 10, active: bool = True):
|
||||
return {"limit": limit, "active": active}
|
||||
```
|
||||
|
||||
|
||||
|
||||
## Request Body & Validation {.cols-3}
|
||||
|
||||
### Using Pydantic
|
||||
@@ -98,8 +94,6 @@ def create(item: Item):
|
||||
return item
|
||||
```
|
||||
|
||||
|
||||
|
||||
## Forms, Files, Headers {.cols-3}
|
||||
|
||||
### Form Input
|
||||
@@ -132,8 +126,6 @@ def info(ua: str = Header(None)):
|
||||
return {"UA": ua}
|
||||
```
|
||||
|
||||
|
||||
|
||||
## Middleware & Dependency {.cols-2}
|
||||
|
||||
### Middleware
|
||||
@@ -159,8 +151,6 @@ def secure(_: bool = Depends(auth)):
|
||||
return {"secure": True}
|
||||
```
|
||||
|
||||
|
||||
|
||||
## Errors & JSON API {.cols-2}
|
||||
|
||||
### HTTP Error
|
||||
@@ -183,8 +173,6 @@ def get_data():
|
||||
return {"status": "ok"}
|
||||
```
|
||||
|
||||
|
||||
|
||||
## Templates & Static {.cols-2}
|
||||
|
||||
### Mount Static
|
||||
@@ -201,8 +189,6 @@ from fastapi.templating import Jinja2Templates
|
||||
templates = Jinja2Templates("templates")
|
||||
```
|
||||
|
||||
|
||||
|
||||
## Routers & Structure {.cols-2}
|
||||
|
||||
### Routers (Blueprints)
|
||||
@@ -230,14 +216,12 @@ project/
|
||||
└── models/
|
||||
```
|
||||
|
||||
|
||||
|
||||
## Docs & Status {.cols-2}
|
||||
|
||||
### Built-in Docs
|
||||
|
||||
* Swagger: `/docs`
|
||||
* ReDoc: `/redoc`
|
||||
- Swagger: `/docs`
|
||||
- ReDoc: `/redoc`
|
||||
|
||||
### Custom Status Code
|
||||
|
||||
@@ -248,4 +232,3 @@ from fastapi import status
|
||||
def create():
|
||||
return {"msg": "Created"}
|
||||
```
|
||||
|
||||
Reference in new issue
Block a user