Skip to content

Commit

Permalink
Cleanup Scalar API docs
Browse files Browse the repository at this point in the history
  • Loading branch information
wolveix committed Apr 19, 2024
1 parent 5ff2225 commit af6ccf1
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion cmd/dss/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ var (
Use: "dss",
Short: "Scan a domain's DNS records.",
Long: "Scan a domain's DNS records.\nhttps://github.com/GlobalCyberAlliance/domain-security-scanner",
Version: "3.0.8",
Version: "3.0.9",
PersistentPreRun: func(cmd *cobra.Command, args []string) {
var logWriter io.Writer

Expand Down
2 changes: 1 addition & 1 deletion pkg/http/server.go
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ func NewServer(logger zerolog.Logger, version string) *Server {
Path: server.apiPath + "/docs",
}, func(ctx huma.Context) {
ctx.SetHeader("Content-Type", "text/html")
if _, err := ctx.BodyWriter().Write([]byte(`<!doctype html><html lang=en><head><title>Domain Security Scanner - API Reference</title><meta charset=utf-8><meta name=viewport content="width=device-width,initial-scale=1"><style>body{margin:0}</style><style>:root{--theme-font:'Inter',var(--system-fonts)}.light-mode{--theme-color-1:rgb(9, 9, 11);--theme-color-2:rgb(113, 113, 122);--theme-color-3:rgba(25, 25, 28, 0.5);--theme-color-accent:rgba(14, 29, 72);--theme-background-1:#fff;--theme-background-2:#f4f4f5;--theme-background-3:#e3e3e6;--theme-background-accent:#212E56;--theme-border-color:rgb(228, 228, 231);--theme-button-1:rgb(49 53 56);--theme-button-1-color:#fff13;--theme-button-1-hover:rgb(28 31 33);--theme-color-green:#069061;--theme-color-red:#ef0006;--theme-color-yellow:#edbe20;--theme-color-blue:#0082d0;--theme-color-orange:#fb892c;--theme-color-purple:#5203d1;--theme-scrollbar-color:rgba(0, 0, 0, 0.18);--theme-scrollbar-color-active:rgba(0, 0, 0, 0.36)}.dark-mode{--theme-color-1:#fafafa;--theme-color-2:rgb(161, 161, 170);--theme-color-3:rgba(255, 255, 255, 0.533);--theme-color-accent:var(--theme-color-1);--theme-background-1:#000e23;--theme-background-2:#01132e;--theme-background-3:#03193b;--theme-background-accent:#8ab4f81f;--theme-border-color:rgba(255, 255, 255, 0.12);--theme-code-language-color-supersede:var(--theme-color-1);--theme-button-1:#f6f6f6;--theme-button-1-color:#000;--theme-button-1-hover:#e7e7e7;--theme-color-green:rgba(69, 255, 165, 0.823);--theme-color-red:#ff8589;--theme-color-yellow:#ffcc4d;--theme-color-blue:#6bc1fe;--theme-color-orange:#f98943;--theme-color-purple:#b191f9;--theme-scrollbar-color:rgba(255, 255, 255, 0.24);--theme-scrollbar-color-active:rgba(255, 255, 255, 0.48)}.dark-mode .t-doc__sidebar,.light-mode .t-doc__sidebar{--sidebar-background-1:transparent;--sidebar-item-hover-color:currentColor;--sidebar-item-hover-background:var(--theme-background-2);--sidebar-item-active-background:var(--theme-background-3);--sidebar-border-color:var(--theme-border-color);--sidebar-color-1:var(--theme-color-1);--sidebar-color-2:var(--theme-color-2);--sidebar-color-active:var(--theme-color-accent);--sidebar-search-background:rgba(255, 255, 255, 0.1);--sidebar-search-border-color:var(--theme-border-color);--sidebar-search--color:var(--theme-color-3);z-index:1}.light-mode .t-doc__sidebar{--sidebar-search-background:white}.show-api-client-button:before{background:#fff!important}.show-api-client-button span,.show-api-client-button svg{color:#000!important}.download-cta,.references-rendered .markdown a{text-decoration:underline!important}@keyframes headerbackground{from{background:0 0;backdrop-filter:none}to{background:var(--header-background-1);backdrop-filter:blur(12px)}}.dark-mode .t-doc__header,.light-mode .t-doc__header{animation:forwards headerbackground;animation-timeline:scroll();animation-range:0px 200px}.dark-mode .markdown h1,.dark-mode .markdown h2,.dark-mode .markdown h3,.dark-mode .markdown h4,.dark-mode .markdown h5,.dark-mode .markdown h6,.dark-mode .t-editor__page-title h1,.dark-mode h1.section-header,.dark-mode h2.t-editor__heading{-webkit-text-fill-color:transparent;background-image:linear-gradient(to right bottom,#fff 30%,rgba(255,255,255,.38));-webkit-background-clip:text;background-clip:text}.sidebar-heading-type{color:var(--theme-background-1)!important}.active_page .sidebar-heading-type{color:var(--sidebar-color-1)!important}.sidebar-heading-type:after{content:'';position:absolute;top:0;left:0;width:100%;height:100%;background:linear-gradient(9deg,var(--theme-background-1),transparent);border-radius:30px;opacity:.3}.code-languages-icon{padding:12px!important}.code-languages span{margin-top:5px!important}.section-flare{top:-150px!important;height:100vh;background:linear-gradient(#000,var(--theme-background-1));width:100vw}.light-mode .section-flare{background:linear-gradient(180deg,#f4fdff 30%,transparent 100%)}.light-mode .section-flare-item:first-of-type{--c1:#ffffff;--c2:#eff0f5;--c3:#ffffff;--c4:#ffffff;--c5:#ffffff;--c6:#ffffff;--c7:#ebf2f5;filter:blur(5px);mix-blend-mode:initial}.light-mode .section-flare-item:nth-of-type(2){opacity:.1}</style></head><body><script id=api-reference data-url=` + server.apiPath + `/docs.json></script><script>let configuration={theme:"none"},apiReference=document.getElementById("api-reference");apiReference.dataset.configuration=JSON.stringify(configuration)</script><script src=https://cdn.jsdelivr.net/npm/@scalar/api-reference></script></body></html>`)); err != nil {
if _, err := ctx.BodyWriter().Write([]byte(`<!doctype html><html lang="en"><head><title>Domain Security Scanner - API Reference</title><meta charset="utf-8"><meta content="width=device-width,initial-scale=1" name="viewport"></head><body><script data-url="` + server.apiPath + `/docs.json" id="api-reference"></script><script>let apiReference = document.getElementById("api-reference")</script><script src="https://cdn.jsdelivr.net/npm/@scalar/api-reference"></script></body></html>`)); err != nil {
server.logger.Error().Err(err).Msg("an error occurred while serving the API documentation")
}
})
Expand Down

0 comments on commit af6ccf1

Please sign in to comment.