diff options
| author | Guillaume Gomez <guillaume1.gomez@gmail.com> | 2025-06-13 21:01:59 +0200 |
|---|---|---|
| committer | Guillaume Gomez <guillaume1.gomez@gmail.com> | 2025-08-28 15:56:29 +0200 |
| commit | ab0ee84eac9732e4e81e559c688846b4c1bd400a (patch) | |
| tree | c0da1c969d5c0729532b1bc435cb6147cb4e0dcf /src/librustdoc/html/static | |
| parent | b41634205b549a62cfa55363d1e00c4143d30033 (diff) | |
| download | rust-ab0ee84eac9732e4e81e559c688846b4c1bd400a.tar.gz rust-ab0ee84eac9732e4e81e559c688846b4c1bd400a.zip | |
Add new `doc(attribute = "...")` attribute
Diffstat (limited to 'src/librustdoc/html/static')
| -rw-r--r-- | src/librustdoc/html/static/css/noscript.css | 2 | ||||
| -rw-r--r-- | src/librustdoc/html/static/css/rustdoc.css | 7 | ||||
| -rw-r--r-- | src/librustdoc/html/static/js/main.js | 1 | ||||
| -rw-r--r-- | src/librustdoc/html/static/js/search.js | 5 |
4 files changed, 14 insertions, 1 deletions
diff --git a/src/librustdoc/html/static/css/noscript.css b/src/librustdoc/html/static/css/noscript.css index a3c6bf98161..5c02e2eb26a 100644 --- a/src/librustdoc/html/static/css/noscript.css +++ b/src/librustdoc/html/static/css/noscript.css @@ -75,6 +75,7 @@ nav.sub { --function-link-color: #ad7c37; --macro-link-color: #068000; --keyword-link-color: #3873ad; + --attribute-link-color: #3873ad; --mod-link-color: #3873ad; --link-color: #3873ad; --sidebar-link-color: #356da4; @@ -180,6 +181,7 @@ nav.sub { --function-link-color: #2bab63; --macro-link-color: #09bd00; --keyword-link-color: #d2991d; + --attribute-link-color: #d2991d; --mod-link-color: #d2991d; --link-color: #d2991d; --sidebar-link-color: #fdbf35; diff --git a/src/librustdoc/html/static/css/rustdoc.css b/src/librustdoc/html/static/css/rustdoc.css index 86f1a42bc01..09d289d570c 100644 --- a/src/librustdoc/html/static/css/rustdoc.css +++ b/src/librustdoc/html/static/css/rustdoc.css @@ -400,6 +400,10 @@ span.keyword, a.keyword { color: var(--keyword-link-color); } +span.attribute, a.attribute { + color: var(--attribute-link-color); +} + a { color: var(--link-color); text-decoration: none; @@ -3190,6 +3194,7 @@ by default. --function-link-color: #ad7c37; --macro-link-color: #068000; --keyword-link-color: #3873ad; + --attribute-link-color: #3873ad; --mod-link-color: #3873ad; --link-color: #3873ad; --sidebar-link-color: #356da4; @@ -3294,6 +3299,7 @@ by default. --function-link-color: #2bab63; --macro-link-color: #09bd00; --keyword-link-color: #d2991d; + --attribute-link-color: #d2991d; --mod-link-color: #d2991d; --link-color: #d2991d; --sidebar-link-color: #fdbf35; @@ -3407,6 +3413,7 @@ Original by Dempfi (https://github.com/dempfi/ayu) --function-link-color: #fdd687; --macro-link-color: #a37acc; --keyword-link-color: #39afd7; + --attribute-link-color: #39afd7; --mod-link-color: #39afd7; --link-color: #39afd7; --sidebar-link-color: #53b1db; diff --git a/src/librustdoc/html/static/js/main.js b/src/librustdoc/html/static/js/main.js index 4fcba5f120b..75febd6f737 100644 --- a/src/librustdoc/html/static/js/main.js +++ b/src/librustdoc/html/static/js/main.js @@ -790,6 +790,7 @@ function preLoadCss(cssUrl) { //block("associatedconstant", "associated-consts", "Associated Constants"); block("foreigntype", "foreign-types", "Foreign Types"); block("keyword", "keywords", "Keywords"); + block("attribute", "attributes", "Attributes"); block("attr", "attributes", "Attribute Macros"); block("derive", "derives", "Derive Macros"); block("traitalias", "trait-aliases", "Trait Aliases"); diff --git a/src/librustdoc/html/static/js/search.js b/src/librustdoc/html/static/js/search.js index 3fb4db3a89c..b003bcc7bf9 100644 --- a/src/librustdoc/html/static/js/search.js +++ b/src/librustdoc/html/static/js/search.js @@ -119,6 +119,7 @@ const itemTypes = [ "derive", "traitalias", // 25 "generic", + "attribute", ]; // used for special search precedence @@ -2058,7 +2059,7 @@ class DocSearch { displayPath = item.modulePath + "::"; href = this.rootPath + item.modulePath.replace(/::/g, "/") + "/index.html#reexport." + name; - } else if (type === "primitive" || type === "keyword") { + } else if (type === "primitive" || type === "keyword" || type === "attribute") { displayPath = ""; exactPath = ""; href = this.rootPath + path.replace(/::/g, "/") + @@ -4560,6 +4561,8 @@ const longItemTypes = [ "attribute macro", "derive macro", "trait alias", + "", + "attribute", ]; // @ts-expect-error let currentResults; |
