Three code examples do not parse (HttpService, OAuth 2.0 flow, Scout config.json on Windows)

未關閉 適合新手
#26,833 0 則留言 0 個 reaction 已指派 0 人 在 GitHub 檢視

維護者通常 1 天內回覆

還沒有人認領這個 Issue。

評估

難度
1/5
預估耗時
1 小時以內
新手友好度
91/100
Issue 類型
缺陷
描述清晰度
描述清楚
活躍度
活躍
技術堆疊
javascript, json, typescript
領域
documentation

研究方向

檢查指定的三個檔案:content/reference/api/extensions-sdk/HttpService.md、content/manuals/extensions/extensions-sdk/guides/oauth2-flow.md 和 content/manuals/scout/install.md。結合上下文檢查範例,並在每次修正後驗證 JavaScript 或 JSON 語法。三個範例都能依照原文解析即為完成。

由索引模型根據 Issue 內容生成。

描述

Is this a docs issue?
  • My issue is about the documentation content or website
Type of issue

Information is incorrect

Description

Three code examples can't be used as written, because they don't parse:

  1. HttpService get example (content/reference/api/extensions-sdk/HttpService.md, around line 25):
    .then((value: any) => console.log(value) is missing the closing ) and ;. The other examples on the same page end with console.log(value));.
  2. OAuth 2.0 flow (content/manuals/extensions/extensions-sdk/guides/oauth2-flow.md, around line 48): the openExternal URL is a double-quoted string that spans four lines, which is an unterminated string literal in JS/TS. ${REDIRECT_URI} inside it would only be substituted in a template literal.
  3. Scout config.json on Windows (content/manuals/scout/install.md, around line 111):
    "C:\Users\<USER>\.docker\scout" uses single backslashes. In JSON \U, \<, \. and \s are invalid escapes, so the file can't be parsed. They need to be \\.
Location
Suggestion
  1. Close the call: .then((value: any) => console.log(value));
  2. Use one template literal: `https://authorization-server.com/authorize?response_type=code&client_id=...&redirect_uri=${REDIRECT_URI}`
  3. Double the backslashes: "C:\\Users\\<USER>\\.docker\\scout"

I have a branch with these three one-line fixes ready and can open a PR that links this issue if a maintainer is OK with it. Following the moby AI policy: I found these with an AI coding assistant (a parser run over the docs' code blocks) and checked each one by hand.

主要語言
Markdown
星號
4.7k
分支
8.6k
平均合併
2 天 8 小時
30 天內合併 PR
188

環境準備

從這裡開始

  1. 先讀完整個 Issue,再讀專案的貢獻指南。
  2. 在 Issue 下留言說明你要接手 —— 這能避免兩個人做同樣的事。
  3. Fork 儲存庫,在一個分支上完成修改。
  4. 送出 Pull Request,並在描述裡引用這個 Issue 編號。

docker/docs 的其他 Issue

查看 docker/docs 的全部 Issue

相似的 Issue

更多 Documentation Issue

把新 issue 寄到你的電子郵件信箱

精選適合新手參與的 GitHub issue 摘要。