Skip to content

docs: show core middleware import (#302) + drop $ from copyable shell blocks (#343)#416

Merged
vishr merged 1 commit into
masterfrom
docs-fix-mw-imports-copy
Jun 16, 2026
Merged

docs: show core middleware import (#302) + drop $ from copyable shell blocks (#343)#416
vishr merged 1 commit into
masterfrom
docs-fix-mw-imports-copy

Conversation

@vishr

@vishr vishr commented Jun 16, 2026

Copy link
Copy Markdown
Member

Fixes two long-standing docs issues.

#302 — Missing middleware package import

Core middleware pages showed middleware.CORS(...), middleware.BasicAuth(...), etc. but never indicated which package middleware is, so newcomers couldn't find the import. This adds a prominent import block right after each core middleware page's intro:

import "github.com/labstack/echo/v5/middleware"
  • Applied to all 20 core middleware pages (basic-auth, body-dump, body-limit, context-timeout, cors, csrf, decompress, gzip, key-auth, logger, method-override, proxy, rate-limiter, recover, redirect, request-id, rewrite, secure, static, trailing-slash).
  • Across all 5 locales (en / zh-cn / ja / es / pt-br). The lead-in sentence is translated per locale; the import code block is byte-identical everywhere, preserving cross-locale code parity.

#343 — Copy button included the $ prompt

session.md showed curl examples with a leading $ prompt inside the code block, so clicking copy grabbed the $ and made pasting awkward. Removed the $ prompt from the command lines (all 5 locales).

Verification

  • Production build passes (301 pages).
  • Spot-checked translated lead-ins (ja/es/pt-br) and the stripped curl lines; no $ prompts remain anywhere in the docs.

Closes #302
Closes #343

🤖 Generated with Claude Code

…ble shell blocks (#343)

#302 — Core middleware pages used `middleware.X(...)` without ever showing
where the `middleware` package comes from, which newcomers couldn't locate.
Add a prominent import block right after each core middleware page's intro:

    import "github.com/labstack/echo/v5/middleware"

Applied to all 20 core middleware pages across every locale (en/zh-cn/ja/es/
pt-br); the lead-in sentence is translated per locale, the import code block
is identical everywhere.

#343 — session.md showed curl examples with a leading `$ ` prompt inside the
code block, so the copy button included the `$` and made pasting awkward.
Drop the `$ ` prompt from the command lines (all 5 locales).

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@vishr vishr merged commit 1a0a436 into master Jun 16, 2026
2 checks passed
@vishr vishr deleted the docs-fix-mw-imports-copy branch June 16, 2026 19:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Documentation Code Blocks Copy $ Missing Middleware Package Import in Echo v4 Documentation

1 participant