Polish the built-in docs UI (v0.6.6)#95
Merged
Merged
Conversation
The built-in page stays minimal, flat and dependency-free, but is no longer quite so bare: operations carry coloured method badges (custom methods included), a padlock marks the ones that require auth, deprecated operations are dimmed and flagged, and the header shows the API version, description, and links to the JSON and YAML spec. Grouping stays by path. It remains under the page's strict CSP: no inline style attributes, the padlock is a static inline SVG cloned from a <template> rather than an emoji or an injected string, and the inline script/style hashes are re-pinned. A structural test guards the new markup and the ui-smoke browser test still renders it under the enforced policy.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes #94.
A light polish of the minimal built-in docs page — still tiny, flat, dependency-free, no CDN, under the same strict CSP.
What changed
<svg>cloned from a<template>(no emoji, noinnerHTML).openapi.json/openapi.yaml.CSP / safety
style=""attributes (the policy has nounsafe-inline); the notice and template hide via thehiddenattribute.sha256hashes indefaultDocsCSPare re-pinned (the parity test recomputes them from the served page).Validation
TestDefaultUINoticeextended to guard the new markup (lock template, spec links).TestDefaultDocsCSP(hash parity) +TestUISmoke/builtin(renders under the enforced CSP in real headless Chrome) +TestDefaultUINoticeDismiss(dismiss + localStorage) all pass.go vet, gofmt, golangci-lint (0 issues with and without theuismoketag).Cuts v0.6.6.