Search Options

Results per page
Sort
Preferred Languages
Advance

Results 11 - 12 of 12 for syntaxHighlight (0.64 sec)

  1. docs/zh/docs/how-to/configure-swagger-ui.md

    当没有改变设置时,语法高亮默认启用:
    
    <img src="/img/tutorial/extending-openapi/image02.png">
    
    但是你可以通过设置 `syntaxHighlight` 为 `False` 来禁用 Swagger UI 中的语法高亮:
    
    {* ../../docs_src/configure_swagger_ui/tutorial001.py hl[3] *}
    
    ...在此之后,Swagger UI 将不会高亮代码:
    
    <img src="/img/tutorial/extending-openapi/image03.png">
    
    ## 改变主题
    
    同样地,你也可以通过设置键 `"syntaxHighlight.theme"` 来设置语法高亮主题(注意中间有一个点):
    
    {* ../../docs_src/configure_swagger_ui/tutorial002.py hl[3] *}
    
    Registered: Sun Dec 28 07:19:09 UTC 2025
    - Last Modified: Mon Nov 18 02:25:44 UTC 2024
    - 2.6K bytes
    - Viewed (0)
  2. docs_src/configure_swagger_ui/tutorial001_py39.py

    from fastapi import FastAPI
    
    app = FastAPI(swagger_ui_parameters={"syntaxHighlight": False})
    
    
    @app.get("/users/{username}")
    async def read_user(username: str):
    Registered: Sun Dec 28 07:19:09 UTC 2025
    - Last Modified: Wed Dec 17 20:41:43 UTC 2025
    - 205 bytes
    - Viewed (0)
Back to top