Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add Ayu theme to rustdoc #71237

Merged
merged 2 commits into from
Jul 14, 2020
Merged

Add Ayu theme to rustdoc #71237

merged 2 commits into from
Jul 14, 2020

Conversation

Cldfire
Copy link
Contributor

@Cldfire Cldfire commented Apr 17, 2020

This is a port of a theme I maintain (https://github.com/Cldfire/ayu-rs) to the native rustdoc theme system. Ayu (dark) is a richly-colored dark theme that many people enjoy using across a wide variety of environments.

Corresponds to the Ayu theme in mdBook.

Some screenshots:

image

image

image

image

image

Note that this pull request also makes some small code changes to allow for disabling theme stylesheets, preventing the rules from all the different themes from conflicting with one another. The only stylesheet that is not disabled is light.css; the theming system (quite hackily) switches themes by changing the href on this stylesheet and so permanently disabling all the others works perfectly fine.

@@ -53,7 +53,8 @@ pub fn render<T: Print, S: Print>(
<link rel=\"stylesheet\" type=\"text/css\" href=\"{static_root_path}rustdoc{suffix}.css\" \
id=\"mainThemeStyle\">\
{themes}\
<link rel=\"stylesheet\" type=\"text/css\" href=\"{static_root_path}dark{suffix}.css\">\
<link rel=\"stylesheet\" type=\"text/css\" href=\"{static_root_path}ayu{suffix}.css\" disabled=\"true\">\
<link rel=\"stylesheet\" type=\"text/css\" href=\"{static_root_path}dark{suffix}.css\" disabled=\"true\">\
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That is super cool!

@GuillaumeGomez
Copy link
Member

My only concern is that the logo is super difficult to see now. Otherwise everything else looks good!

cc @rust-lang/rustdoc

@rust-highfive
Copy link
Collaborator

The job x86_64-gnu-llvm-7 of your PR failed (pretty log, raw log). Through arcane magic we have determined that the following fragments from the build log may contain information about the problem.

Click to expand the log.
2020-04-17T08:22:56.1118559Z ========================== Starting Command Output ===========================
2020-04-17T08:22:56.1121523Z [command]/bin/bash --noprofile --norc /home/vsts/work/_temp/3e93baa0-d79c-45f2-b468-b47a2e660a74.sh
2020-04-17T08:22:56.1121788Z 
2020-04-17T08:22:56.1126488Z ##[section]Finishing: Disable git automatic line ending conversion
2020-04-17T08:22:56.1146843Z ##[section]Starting: Checkout rust-lang/rust@refs/pull/71237/merge to s
2020-04-17T08:22:56.1150261Z Task         : Get sources
2020-04-17T08:22:56.1150563Z Description  : Get sources from a repository. Supports Git, TfsVC, and SVN repositories.
2020-04-17T08:22:56.1150853Z Version      : 1.0.0
2020-04-17T08:22:56.1151074Z Author       : Microsoft
---
2020-04-17T08:22:57.1089550Z ##[command]git remote add origin https://github.com/rust-lang/rust
2020-04-17T08:22:57.1102020Z ##[command]git config gc.auto 0
2020-04-17T08:22:57.1112330Z ##[command]git config --get-all http.https://github.com/rust-lang/rust.extraheader
2020-04-17T08:22:57.1125460Z ##[command]git config --get-all http.proxy
2020-04-17T08:22:57.1132747Z ##[command]git -c http.extraheader="AUTHORIZATION: basic ***" fetch --force --tags --prune --progress --no-recurse-submodules --depth=2 origin +refs/heads/*:refs/remotes/origin/* +refs/pull/71237/merge:refs/remotes/pull/71237/merge
---
2020-04-17T08:26:01.4469384Z  ---> f58a2bb1e753
2020-04-17T08:26:01.4471059Z Step 5/8 : ENV RUST_CONFIGURE_ARGS       --build=x86_64-unknown-linux-gnu       --llvm-root=/usr/lib/llvm-7       --enable-llvm-link-shared       --set rust.thin-lto-import-instr-limit=10
2020-04-17T08:26:01.4475615Z  ---> Using cache
2020-04-17T08:26:01.4475994Z  ---> d079cc6b6db8
2020-04-17T08:26:01.4476864Z Step 6/8 : ENV SCRIPT python2.7 ../x.py test --exclude src/tools/tidy &&            python2.7 ../x.py test src/test/mir-opt --pass=build                                   --target=armv5te-unknown-linux-gnueabi &&            python2.7 ../x.py test src/tools/tidy
2020-04-17T08:26:01.4488721Z  ---> 4183ca46ee56
2020-04-17T08:26:01.4488949Z Step 7/8 : ENV NO_DEBUG_ASSERTIONS=1
2020-04-17T08:26:01.4489298Z  ---> Using cache
2020-04-17T08:26:01.4489614Z  ---> 69e7f8a2a2fb
---
2020-04-17T08:26:01.4929320Z Looks like docker image is the same as before, not uploading
2020-04-17T08:26:09.1589935Z [CI_JOB_NAME=x86_64-gnu-llvm-7]
2020-04-17T08:26:09.1905491Z [CI_JOB_NAME=x86_64-gnu-llvm-7]
2020-04-17T08:26:09.1937094Z == clock drift check ==
2020-04-17T08:26:09.1945573Z   local time: Fri Apr 17 08:26:09 UTC 2020
2020-04-17T08:26:09.2658988Z   network time: Fri, 17 Apr 2020 08:26:09 GMT
2020-04-17T08:26:09.2681335Z Starting sccache server...
2020-04-17T08:26:09.3654025Z configure: processing command line
2020-04-17T08:26:09.3654339Z configure: 
2020-04-17T08:26:09.3655393Z configure: rust.dist-src        := False
---
2020-04-17T08:31:31.0782159Z    Compiling rustc_feature v0.0.0 (/checkout/src/librustc_feature)
2020-04-17T08:31:32.5553350Z    Compiling fmt_macros v0.0.0 (/checkout/src/libfmt_macros)
2020-04-17T08:31:34.0856560Z    Compiling rustc_ast_pretty v0.0.0 (/checkout/src/librustc_ast_pretty)
2020-04-17T08:31:35.5869470Z    Compiling rustc_hir v0.0.0 (/checkout/src/librustc_hir)
2020-04-17T08:31:44.4474606Z    Compiling rustc_query_system v0.0.0 (/checkout/src/librustc_query_system)
2020-04-17T08:31:47.5564424Z    Compiling rustc_hir_pretty v0.0.0 (/checkout/src/librustc_hir_pretty)
2020-04-17T08:31:52.2335526Z    Compiling rustc_attr v0.0.0 (/checkout/src/librustc_attr)
2020-04-17T08:31:56.5537645Z    Compiling rustc_parse v0.0.0 (/checkout/src/librustc_parse)
2020-04-17T08:32:05.4704385Z    Compiling rustc_ast_lowering v0.0.0 (/checkout/src/librustc_ast_lowering)
---
2020-04-17T08:55:12.1154464Z    Compiling rustc_feature v0.0.0 (/checkout/src/librustc_feature)
2020-04-17T08:55:13.9296363Z    Compiling fmt_macros v0.0.0 (/checkout/src/libfmt_macros)
2020-04-17T08:55:15.9758998Z    Compiling rustc_ast_pretty v0.0.0 (/checkout/src/librustc_ast_pretty)
2020-04-17T08:55:17.8302150Z    Compiling rustc_hir v0.0.0 (/checkout/src/librustc_hir)
2020-04-17T08:55:28.2840992Z    Compiling rustc_query_system v0.0.0 (/checkout/src/librustc_query_system)
2020-04-17T08:55:31.6751275Z    Compiling rustc_hir_pretty v0.0.0 (/checkout/src/librustc_hir_pretty)
2020-04-17T08:55:37.0691586Z    Compiling rustc_attr v0.0.0 (/checkout/src/librustc_attr)
2020-04-17T08:55:42.5886332Z    Compiling rustc_parse v0.0.0 (/checkout/src/librustc_parse)
2020-04-17T08:55:53.4543865Z    Compiling rustc_ast_lowering v0.0.0 (/checkout/src/librustc_ast_lowering)
---
2020-04-17T09:21:52.2073942Z .................................................................................................... 1700/9903
2020-04-17T09:21:56.8941843Z .................................................................................................... 1800/9903
2020-04-17T09:22:05.1285418Z .................................................................................................... 1900/9903
2020-04-17T09:22:14.1850497Z .........i.......................................................................................... 2000/9903
2020-04-17T09:22:20.7649605Z ...................................................................................................i 2100/9903
2020-04-17T09:22:35.3179720Z iiii................................................................................................ 2200/9903
2020-04-17T09:22:44.0540272Z .................................................................................................... 2400/9903
2020-04-17T09:22:46.2945384Z .................................................................................................... 2500/9903
2020-04-17T09:22:51.7181353Z .................................................................................................... 2600/9903
2020-04-17T09:23:11.2191657Z .................................................................................................... 2700/9903
---
2020-04-17T09:25:49.8900719Z .................................................................................................... 5100/9903
2020-04-17T09:25:57.5058577Z .................................................................................................... 5200/9903
2020-04-17T09:26:01.9361376Z .....................i.............................................................................. 5300/9903
2020-04-17T09:26:11.9751403Z ...........i........................................................................................ 5400/9903
2020-04-17T09:26:17.6308459Z ...........ii.ii........i...i....................................................................... 5500/9903
2020-04-17T09:26:25.2241760Z .........................................................i.......................................... 5700/9903
2020-04-17T09:26:34.4649141Z .............................................................................ii..................... 5800/9903
2020-04-17T09:26:41.1923279Z ................i................................................................................... 5900/9903
2020-04-17T09:26:46.7304405Z .................................................................................................... 6000/9903
2020-04-17T09:26:46.7304405Z .................................................................................................... 6000/9903
2020-04-17T09:26:57.1509259Z .................................................................................................... 6100/9903
2020-04-17T09:27:07.5323327Z ..........ii....i.ii...........i.................................................................... 6200/9903
2020-04-17T09:27:23.1596592Z .................................................................................................... 6400/9903
2020-04-17T09:27:29.4984275Z .................................................................................................... 6500/9903
2020-04-17T09:27:29.4984275Z .................................................................................................... 6500/9903
2020-04-17T09:27:46.1444402Z ........................................i..ii....................................................... 6600/9903
2020-04-17T09:28:08.1575237Z .................................................................................................... 6800/9903
2020-04-17T09:28:10.2258684Z .........................................i.......................................................... 6900/9903
2020-04-17T09:28:12.2334378Z .................................................................................................... 7000/9903
2020-04-17T09:28:14.3676229Z .................................................................................i.................. 7100/9903
---
2020-04-17T09:29:51.3883852Z .................................................................................................... 7800/9903
2020-04-17T09:29:55.9018393Z .................................................................................................... 7900/9903
2020-04-17T09:30:02.2824022Z .................................................................................................... 8000/9903
2020-04-17T09:30:08.2349071Z ...............................................i.................................................... 8100/9903
2020-04-17T09:30:18.0220282Z ...............................................................................................iiiii 8200/9903
2020-04-17T09:30:23.6384518Z i.iiiii.i........................................................................................... 8300/9903
2020-04-17T09:30:36.7486782Z .................................................................................................... 8500/9903
2020-04-17T09:30:44.9726870Z .................................................................................................... 8600/9903
2020-04-17T09:30:59.1520032Z .................................................................................................... 8700/9903
2020-04-17T09:31:05.8409813Z .................................................................................................... 8800/9903
---
2020-04-17T09:33:22.8557422Z Suite("src/test/codegen") not skipped for "bootstrap::test::Codegen" -- not in ["src/tools/tidy"]
2020-04-17T09:33:22.8771905Z Check compiletest suite=codegen mode=codegen (x86_64-unknown-linux-gnu -> x86_64-unknown-linux-gnu)
2020-04-17T09:33:23.1054700Z 
2020-04-17T09:33:23.1055053Z running 185 tests
2020-04-17T09:33:25.7467551Z iiii......i............ii.i..iiii....i....i...........i............i..i..................i....i..... 100/185
2020-04-17T09:33:28.3630568Z .......i.i.i...iii..iiiiiiiiiiiiiiii.......................iii...............ii......
2020-04-17T09:33:28.3635350Z 
2020-04-17T09:33:28.3644547Z  finished in 5.487
2020-04-17T09:33:28.3724367Z Suite("src/test/codegen-units") not skipped for "bootstrap::test::CodegenUnits" -- not in ["src/tools/tidy"]
2020-04-17T09:33:28.3817952Z Check compiletest suite=codegen-units mode=codegen-units (x86_64-unknown-linux-gnu -> x86_64-unknown-linux-gnu)
---
2020-04-17T09:33:30.4523930Z Suite("src/test/assembly") not skipped for "bootstrap::test::Assembly" -- not in ["src/tools/tidy"]
2020-04-17T09:33:30.4702728Z Check compiletest suite=assembly mode=assembly (x86_64-unknown-linux-gnu -> x86_64-unknown-linux-gnu)
2020-04-17T09:33:30.6101639Z 
2020-04-17T09:33:30.6101825Z running 9 tests
2020-04-17T09:33:30.6102749Z iiiiiiiii
2020-04-17T09:33:30.6104113Z 
2020-04-17T09:33:30.6104482Z  finished in 0.140
2020-04-17T09:33:30.6112569Z Suite("src/test/incremental") not skipped for "bootstrap::test::Incremental" -- not in ["src/tools/tidy"]
2020-04-17T09:33:30.6269666Z Check compiletest suite=incremental mode=incremental (x86_64-unknown-linux-gnu -> x86_64-unknown-linux-gnu)
---
2020-04-17T09:33:50.8822803Z Suite("src/test/debuginfo") not skipped for "bootstrap::test::Debuginfo" -- not in ["src/tools/tidy"]
2020-04-17T09:33:50.9041043Z Check compiletest suite=debuginfo mode=debuginfo (x86_64-unknown-linux-gnu -> x86_64-unknown-linux-gnu)
2020-04-17T09:33:51.0902887Z 
2020-04-17T09:33:51.0903257Z running 115 tests
2020-04-17T09:34:05.4219870Z iiiii..i.....i..i...i..i.i.i..i..i..ii....i.i....ii..........iiii.........i.....i..i.......ii.i.ii.. 100/115
2020-04-17T09:34:07.3358235Z ...iiii.....ii.
2020-04-17T09:34:07.3359250Z 
2020-04-17T09:34:07.3359384Z  finished in 16.432
2020-04-17T09:34:07.3359906Z Suite("src/test/ui-fulldeps") not skipped for "bootstrap::test::UiFullDeps" -- not in ["src/tools/tidy"]
2020-04-17T09:34:07.3360514Z Uplifting stage1 rustc (x86_64-unknown-linux-gnu -> x86_64-unknown-linux-gnu)
---
2020-04-17T09:47:09.8733456Z 
2020-04-17T09:47:09.8740279Z    Doc-tests core
2020-04-17T09:47:14.5391665Z 
2020-04-17T09:47:14.5392593Z running 2496 tests
2020-04-17T09:47:23.4561799Z ......iiiii......................................................................................... 100/2496
2020-04-17T09:47:32.4403163Z .....................................................................................ii............. 200/2496
2020-04-17T09:47:52.7813679Z ....................i............................................................................... 400/2496
2020-04-17T09:47:52.7813679Z ....................i............................................................................... 400/2496
2020-04-17T09:48:02.4367528Z ..........................................................................i..i..................iiii 500/2496
2020-04-17T09:48:18.4690412Z .................................................................................................... 700/2496
2020-04-17T09:48:26.8476250Z .................................................................................................... 800/2496
2020-04-17T09:48:35.0232419Z .................................................................................................... 900/2496
2020-04-17T09:48:43.2190650Z .................................................................................................... 1000/2496
---
2020-04-17T09:52:18.9189720Z 
2020-04-17T09:52:18.9190260Z running 1020 tests
2020-04-17T09:52:36.4193382Z i................................................................................................... 100/1020
2020-04-17T09:52:46.5260910Z .................................................................................................... 200/1020
2020-04-17T09:52:54.0526546Z ...................iii......i......i...i......i..................................................... 300/1020
2020-04-17T09:52:58.8486579Z .................................................................................................... 400/1020
2020-04-17T09:53:05.6010284Z ....................................................i....i......................................ii.. 500/1020
2020-04-17T09:53:18.6641703Z .................................................................................................... 700/1020
2020-04-17T09:53:18.6641703Z .................................................................................................... 700/1020
2020-04-17T09:53:25.8673894Z ..............................................iiii.................................................. 800/1020
2020-04-17T09:53:40.2212241Z .................................................................................................... 900/1020
2020-04-17T09:53:46.3033644Z ....................................................................iiii............................ 1000/1020
2020-04-17T09:53:47.6222304Z test result: ok. 1000 passed; 0 failed; 20 ignored; 0 measured; 0 filtered out
2020-04-17T09:53:47.6222515Z 
2020-04-17T09:53:47.6341428Z  finished in 167.582
2020-04-17T09:53:47.6347626Z Set({"src/libterm"}) not skipped for "bootstrap::test::Crate" -- not in ["src/tools/tidy"]
---
2020-04-17T09:57:05.4262826Z 
2020-04-17T09:57:05.4263148Z test result: ok. 0 passed; 0 failed; 0 ignored; 0 measured; 0 filtered out
2020-04-17T09:57:05.4263393Z 
2020-04-17T09:57:05.4335089Z  finished in 1.027
2020-04-17T09:57:05.4336436Z Set({"/checkout/src/librustc_query_system"}) not skipped for "bootstrap::test::CrateLibrustc" -- not in ["src/tools/tidy"]
2020-04-17T09:57:06.3789128Z Testing rustc_query_system stage1 (x86_64-unknown-linux-gnu -> x86_64-unknown-linux-gnu)
2020-04-17T09:57:06.3789919Z    Compiling rustc_query_system v0.0.0 (/checkout/src/librustc_query_system)
2020-04-17T09:57:06.6358948Z      Running build/x86_64-unknown-linux-gnu/stage1-rustc/x86_64-unknown-linux-gnu/release/deps/rustc_query_system-fb111e24749be64b
2020-04-17T09:57:06.6386008Z 
2020-04-17T09:57:06.6386243Z running 0 tests
2020-04-17T09:57:06.6386426Z 
---
2020-04-17T10:11:47.3219013Z Set({"/checkout/src/librustc_parse"}) not skipped for "bootstrap::doc::Rustc" -- not in ["src/tools/tidy"]
2020-04-17T10:11:47.3219720Z Set({"/checkout/src/librustc_passes"}) not skipped for "bootstrap::doc::Rustc" -- not in ["src/tools/tidy"]
2020-04-17T10:11:47.3220429Z Set({"/checkout/src/librustc_plugin_impl"}) not skipped for "bootstrap::doc::Rustc" -- not in ["src/tools/tidy"]
2020-04-17T10:11:47.3221137Z Set({"/checkout/src/librustc_privacy"}) not skipped for "bootstrap::doc::Rustc" -- not in ["src/tools/tidy"]
2020-04-17T10:11:47.3222036Z Set({"/checkout/src/librustc_query_system"}) not skipped for "bootstrap::doc::Rustc" -- not in ["src/tools/tidy"]
2020-04-17T10:11:47.3223478Z Set({"/checkout/src/librustc_save_analysis"}) not skipped for "bootstrap::doc::Rustc" -- not in ["src/tools/tidy"]
2020-04-17T10:11:47.3226811Z Set({"/checkout/src/librustc_session"}) not skipped for "bootstrap::doc::Rustc" -- not in ["src/tools/tidy"]
2020-04-17T10:11:47.3227570Z Set({"/checkout/src/librustc_span"}) not skipped for "bootstrap::doc::Rustc" -- not in ["src/tools/tidy"]
2020-04-17T10:11:47.3228505Z Set({"/checkout/src/librustc_symbol_mangling"}) not skipped for "bootstrap::doc::Rustc" -- not in ["src/tools/tidy"]
---
2020-04-17T10:12:49.9124632Z Suite("src/test/run-make-fulldeps") not skipped for "bootstrap::test::RunMakeFullDeps" -- not in ["src/tools/tidy"]
2020-04-17T10:12:49.9369669Z Check compiletest suite=run-make-fulldeps mode=run-make (x86_64-unknown-linux-gnu -> x86_64-unknown-linux-gnu)
2020-04-17T10:12:50.1369161Z 
2020-04-17T10:12:50.1369558Z running 211 tests
2020-04-17T10:13:22.7126293Z ......................i...ii.......................................................................i 100/211
2020-04-17T10:14:00.5638479Z ........................................iiiiii......i..............iii.............................. 200/211
2020-04-17T10:14:05.3904672Z .......ii..
2020-04-17T10:14:05.3906511Z 
2020-04-17T10:14:05.3910285Z  finished in 75.454
2020-04-17T10:14:05.3925991Z Set({"src/doc/rustdoc"}) not skipped for "bootstrap::test::RustdocBook" -- not in ["src/tools/tidy"]
2020-04-17T10:14:05.3937021Z doc tests for: /checkout/src/doc/rustdoc/src/advanced-features.md
---
2020-04-17T10:14:19.0002962Z doc tests for: /checkout/src/doc/rustc/src/targets/index.md
2020-04-17T10:14:19.0164432Z doc tests for: /checkout/src/doc/rustc/src/what-is-rustc.md
2020-04-17T10:14:19.1545777Z  finished in 4.190
2020-04-17T10:14:19.1558583Z Set({"src/test/rustdoc-js-std"}) not skipped for "bootstrap::test::RustdocJSStd" -- not in ["src/tools/tidy"]
2020-04-17T10:14:19.9956359Z Checking "alias-1" ... OK
2020-04-17T10:14:20.0593286Z Checking "alias-2" ... OK
2020-04-17T10:14:20.1197970Z Checking "alias-3" ... OK
2020-04-17T10:14:20.1785339Z Checking "alias" ... OK
2020-04-17T10:14:20.2560905Z Checking "basic" ... OK
2020-04-17T10:14:20.3454795Z Checking "deduplication" ... OK
2020-04-17T10:14:20.4045853Z Checking "enum-option" ... OK
2020-04-17T10:14:20.4830770Z Checking "filter-crate" ... OK
2020-04-17T10:14:20.5615898Z Checking "fn-forget" ... OK
2020-04-17T10:14:20.6829733Z Checking "from_u" ... OK
2020-04-17T10:14:20.7734631Z Checking "keyword" ... OK
2020-04-17T10:14:20.8168253Z Checking "macro-check" ... OK
2020-04-17T10:14:20.8467336Z Checking "macro-print" ... OK
2020-04-17T10:14:20.9158199Z Checking "multi-query" ... OK
2020-04-17T10:14:20.9414068Z Checking "never" ... OK
2020-04-17T10:14:20.9561286Z Checking "quoted" ... OK
2020-04-17T10:14:20.9799322Z Checking "return-specific-literal" ... OK
2020-04-17T10:14:21.0455840Z Checking "return-specific" ... OK
2020-04-17T10:14:21.0805684Z Checking "should-fail" ... OK
2020-04-17T10:14:21.1406755Z Checking "string-from_ut" ... OK
2020-04-17T10:14:21.1925844Z Checking "struct-vec" ... OK
2020-04-17T10:14:21.2959684Z Checking "vec-new" ... OK
2020-04-17T10:14:21.3200305Z Check compiletest suite=rustdoc-js mode=js-doc-test (x86_64-unknown-linux-gnu -> x86_64-unknown-linux-gnu)
2020-04-17T10:14:21.4798043Z 
2020-04-17T10:14:21.4798304Z running 6 tests
2020-04-17T10:14:27.5126635Z ......
---
2020-04-17T10:14:27.6600164Z    Compiling rustdoc-themes v0.1.0 (/checkout/src/tools/rustdoc-themes)
2020-04-17T10:14:28.3587061Z     Finished release [optimized] target(s) in 0.84s
2020-04-17T10:14:28.3858369Z rustdoc: [check-theme] Starting tests! (Ignoring all other arguments)
2020-04-17T10:14:28.3861679Z  - Checking "/checkout/src/librustdoc/html/static/themes/dark.css"... OK
2020-04-17T10:14:28.3867209Z  - Checking "/checkout/src/librustdoc/html/static/themes/ayu.css"... FAILED
2020-04-17T10:14:28.3867571Z   Missing ".content .highlighted.mod,.content .highlighted.externcrate" rule
2020-04-17T10:14:28.3868034Z   Missing ".content span.attr,.content a.attr,.block a.current.attr,.content span.derive,.content a.derive,.block a.current.derive,.content span.macro,.content a.macro,.block a.current.macro" rule
2020-04-17T10:14:28.3868477Z   Missing ".content .highlighted.trait" rule
2020-04-17T10:14:28.3868744Z   Missing ".content span.struct,.content a.struct,.block a.current.struct" rule
2020-04-17T10:14:28.3869030Z   Missing "#titles>div:hover,#titles>div.selected" rule
2020-04-17T10:14:28.3869292Z   Missing ".content .highlighted.traitalias" rule
2020-04-17T10:14:28.3869567Z   Missing ".content span.type,.content a.type,.block a.current.type" rule
2020-04-17T10:14:28.3869864Z   Missing ".content span.union,.content a.union,.block a.current.union" rule
2020-04-17T10:14:28.3870587Z   Missing "::-webkit-scrollbar-track" rule
2020-04-17T10:14:28.3870815Z   Missing ".content .highlighted.foreigntype" rule
2020-04-17T10:14:28.3871243Z   Missing "#crate-search+.search-input:focus" rule
2020-04-17T10:14:28.3871481Z   Missing "pre.rust .lifetime" rule
2020-04-17T10:14:28.3871691Z   Missing ".content .highlighted.primitive" rule
2020-04-17T10:14:28.3871958Z   Missing ".content .highlighted.constant,.content .highlighted.static" rule
2020-04-17T10:14:28.3872219Z   Missing ".stab.unstable" rule
2020-04-17T10:14:28.3872499Z   Missing ".content .highlighted.fn,.content .highlighted.method,.content .highlighted.tymethod" rule
2020-04-17T10:14:28.3872934Z   Missing "h2,h3:not(.impl):not(.method):not(.type):not(.tymethod),h4:not(.method):not(.type):not(.tymethod)" rule
2020-04-17T10:14:28.3873468Z   Missing ".content span.enum,.content a.enum,.block a.current.enum" rule
2020-04-17T10:14:28.3873855Z   Missing ".content span.constant,.content a.constant,.block a.current.constant,.content span.static,.content a.static,.block a.current.static" rule
2020-04-17T10:14:28.3874264Z   Missing ".content span.keyword,.content a.keyword,.block a.current.keyword" rule
2020-04-17T10:14:28.3874533Z   Missing "pre.rust .comment" rule
2020-04-17T10:14:28.3874738Z   Missing ".content .highlighted.enum" rule
2020-04-17T10:14:28.3874956Z   Missing ".content .highlighted.struct" rule
2020-04-17T10:14:28.3875194Z   Missing ".content .highlighted.keyword" rule
2020-04-17T10:14:28.3875474Z   Missing ".content span.traitalias,.content a.traitalias,.block a.current.traitalias" rule
2020-04-17T10:14:28.3876181Z   Missing ".content span.fn,.content a.fn,.block a.current.fn,.content span.method,.content a.method,.block a.current.method,.content span.tymethod,.content a.tymethod,.block a.current.tymethod,.content .fnname" rule
2020-04-17T10:14:28.3876731Z   Missing "pre.rust .kw" rule
2020-04-17T10:14:28.3877371Z   Missing "pre.rust .self,pre.rust .bool-val,pre.rust .prelude-val,pre.rust .attribute,pre.rust .attribute .ident" rule
2020-04-17T10:14:28.3877827Z   Missing "*" rule
2020-04-17T10:14:28.3878081Z   Missing ".content span.foreigntype,.content a.foreigntype,.block a.current.foreigntype" rule
2020-04-17T10:14:28.3878472Z   Missing "pre.rust .doccomment" rule
2020-04-17T10:14:28.3878695Z   Missing ".stab.deprecated" rule
2020-04-17T10:14:28.3879144Z   Missing ".content .highlighted.attr,.content .highlighted.derive,.content .highlighted.macro" rule
2020-04-17T10:14:28.3879452Z   Missing ".stab.portability" rule
2020-04-17T10:14:28.3880188Z   Missing ".sidebar::-webkit-scrollbar-track" rule
2020-04-17T10:14:28.3880679Z   Missing ".sidebar::-webkit-scrollbar-thumb" rule
2020-04-17T10:14:28.3880935Z   Missing ".content .highlighted.union" rule
2020-04-17T10:14:28.3881514Z   Missing ".content span.primitive,.content a.primitive,.block a.current.primitive" rule
2020-04-17T10:14:28.3882486Z   Missing "::-webkit-scrollbar-thumb" rule
2020-04-17T10:14:28.3882801Z   Missing ".content span.externcrate,.content span.mod,.content a.mod,.block a.current.mod" rule
2020-04-17T10:14:28.3883259Z   Missing ".content .highlighted.type" rule
2020-04-17T10:14:28.3883945Z   Missing "pre.rust .kw-2,pre.rust .prelude-ty" rule
2020-04-17T10:14:28.3884463Z   Missing ".content span.trait,.content a.trait,.block a.current.trait" rule
2020-04-17T10:14:28.3884759Z   Missing ".stab.internal" rule
2020-04-17T10:14:28.3885773Z 
2020-04-17T10:14:28.3886716Z command did not execute successfully: "/checkout/obj/build/x86_64-unknown-linux-gnu/stage0-tools-bin/rustdoc-themes" "/checkout/obj/build/bootstrap/debug/rustdoc" "/checkout/src/librustdoc/html/static/themes"
2020-04-17T10:14:28.3887339Z expected success, got: exit code: 1
2020-04-17T10:14:28.3887511Z 
2020-04-17T10:14:28.3887511Z 
2020-04-17T10:14:28.3887594Z 
2020-04-17T10:14:28.3897571Z failed to run: /checkout/obj/build/bootstrap/debug/bootstrap test --exclude src/tools/tidy
2020-04-17T10:14:28.3897915Z Build completed unsuccessfully in 1:46:38
2020-04-17T10:14:28.3961233Z == clock drift check ==
2020-04-17T10:14:28.3989095Z   local time: Fri Apr 17 10:14:28 UTC 2020
2020-04-17T10:14:28.4665306Z   network time: Fri, 17 Apr 2020 10:14:28 GMT
2020-04-17T10:14:29.2451482Z 
2020-04-17T10:14:29.2451482Z 
2020-04-17T10:14:29.2549592Z ##[error]Bash exited with code '1'.
2020-04-17T10:14:29.2567228Z ##[section]Finishing: Run build
2020-04-17T10:14:29.2628316Z ##[section]Starting: Checkout rust-lang/rust@refs/pull/71237/merge to s
2020-04-17T10:14:29.2634763Z Task         : Get sources
2020-04-17T10:14:29.2635125Z Description  : Get sources from a repository. Supports Git, TfsVC, and SVN repositories.
2020-04-17T10:14:29.2635485Z Version      : 1.0.0
2020-04-17T10:14:29.2635728Z Author       : Microsoft
2020-04-17T10:14:29.2635728Z Author       : Microsoft
2020-04-17T10:14:29.2636110Z Help         : [More Information](https://go.microsoft.com/fwlink/?LinkId=798199)
2020-04-17T10:14:29.2636559Z ==============================================================================
2020-04-17T10:14:29.6118906Z Cleaning any cached credential from repository: rust-lang/rust (GitHub)
2020-04-17T10:14:29.6167881Z ##[section]Finishing: Checkout rust-lang/rust@refs/pull/71237/merge to s
2020-04-17T10:14:29.6270859Z Cleaning up task key
2020-04-17T10:14:29.6272276Z Start cleaning up orphan processes.
2020-04-17T10:14:29.6493643Z Terminate orphan process: pid (4363) (python)
2020-04-17T10:14:29.6782773Z ##[section]Finishing: Finalize Job

I'm a bot! I can only do what humans tell me to, so if this was not helpful or you have suggestions for improvements, please ping or otherwise contact @rust-lang/infra. (Feature Requests)

@Dylan-DPC-zz
Copy link

Dylan-DPC-zz commented Apr 17, 2020

r?@GuillaumeGomez

@Dylan-DPC-zz Dylan-DPC-zz added the S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. label Apr 17, 2020
@Cldfire
Copy link
Contributor Author

Cldfire commented Apr 17, 2020

My only concern is that the logo is super difficult to see now.

I agree, I have the same concern.

I think the best course of action here is a quick filter: invert(90%);:

image

The issue of course being that this can't just be added as a general rule in the stylesheet. There are likely many third-party logos that would look horrendous after color inversion.

I could add a little JS to the theme switcher to add and remove the filter when changing to / from the ayu theme in the std docs, which seems like the simplest way forward with the current system. However, if you'd rather come up with a more robust solution (light and dark theme logo support in rustdoc) in a future PR, that's fine as well. I don't think anyone stares at the logo in the docs 😄.

2020-04-17T10:14:28.3867571Z   Missing ".content .highlighted.mod,.content .highlighted.externcrate" rule
2020-04-17T10:14:28.3868034Z   Missing ".content span.attr,.content a.attr,.block a.current.attr,.content span.derive,.content a.derive,.block a.current.derive,.content span.macro,.content a.macro,.block a.current.macro" rule
2020-04-17T10:14:28.3868477Z   Missing ".content .highlighted.trait" rule
2020-04-17T10:14:28.3868744Z   Missing ".content span.struct,.content a.struct,.block a.current.struct" rule
2020-04-17T10:14:28.3869030Z   Missing "#titles>div:hover,#titles>div.selected" rule
2020-04-17T10:14:28.3869292Z   Missing ".content .highlighted.traitalias" rule
2020-04-17T10:14:28.3869567Z   Missing ".content span.type,.content a.type,.block a.current.type" rule
2020-04-17T10:14:28.3869864Z   Missing ".content span.union,.content a.union,.block a.current.union" rule
2020-04-17T10:14:28.3870587Z   Missing "::-webkit-scrollbar-track" rule
2020-04-17T10:14:28.3870815Z   Missing ".content .highlighted.foreigntype" rule
2020-04-17T10:14:28.3871243Z   Missing "#crate-search+.search-input:focus" rule
2020-04-17T10:14:28.3871481Z   Missing "pre.rust .lifetime" rule
2020-04-17T10:14:28.3871691Z   Missing ".content .highlighted.primitive" rule
2020-04-17T10:14:28.3871958Z   Missing ".content .highlighted.constant,.content .highlighted.static" rule
2020-04-17T10:14:28.3872219Z   Missing ".stab.unstable" rule
2020-04-17T10:14:28.3872499Z   Missing ".content .highlighted.fn,.content .highlighted.method,.content .highlighted.tymethod" rule
2020-04-17T10:14:28.3872934Z   Missing "h2,h3:not(.impl):not(.method):not(.type):not(.tymethod),h4:not(.method):not(.type):not(.tymethod)" rule
2020-04-17T10:14:28.3873468Z   Missing ".content span.enum,.content a.enum,.block a.current.enum" rule
2020-04-17T10:14:28.3873855Z   Missing ".content span.constant,.content a.constant,.block a.current.constant,.content span.static,.content a.static,.block a.current.static" rule
2020-04-17T10:14:28.3874264Z   Missing ".content span.keyword,.content a.keyword,.block a.current.keyword" rule
2020-04-17T10:14:28.3874533Z   Missing "pre.rust .comment" rule
2020-04-17T10:14:28.3874738Z   Missing ".content .highlighted.enum" rule
2020-04-17T10:14:28.3874956Z   Missing ".content .highlighted.struct" rule
2020-04-17T10:14:28.3875194Z   Missing ".content .highlighted.keyword" rule
2020-04-17T10:14:28.3875474Z   Missing ".content span.traitalias,.content a.traitalias,.block a.current.traitalias" rule
2020-04-17T10:14:28.3876181Z   Missing ".content span.fn,.content a.fn,.block a.current.fn,.content span.method,.content a.method,.block a.current.method,.content span.tymethod,.content a.tymethod,.block a.current.tymethod,.content .fnname" rule
2020-04-17T10:14:28.3876731Z   Missing "pre.rust .kw" rule
2020-04-17T10:14:28.3877371Z   Missing "pre.rust .self,pre.rust .bool-val,pre.rust .prelude-val,pre.rust .attribute,pre.rust .attribute .ident" rule
2020-04-17T10:14:28.3877827Z   Missing "*" rule
2020-04-17T10:14:28.3878081Z   Missing ".content span.foreigntype,.content a.foreigntype,.block a.current.foreigntype" rule
2020-04-17T10:14:28.3878472Z   Missing "pre.rust .doccomment" rule
2020-04-17T10:14:28.3878695Z   Missing ".stab.deprecated" rule
2020-04-17T10:14:28.3879144Z   Missing ".content .highlighted.attr,.content .highlighted.derive,.content .highlighted.macro" rule
2020-04-17T10:14:28.3879452Z   Missing ".stab.portability" rule
2020-04-17T10:14:28.3880188Z   Missing ".sidebar::-webkit-scrollbar-track" rule
2020-04-17T10:14:28.3880679Z   Missing ".sidebar::-webkit-scrollbar-thumb" rule
2020-04-17T10:14:28.3880935Z   Missing ".content .highlighted.union" rule
2020-04-17T10:14:28.3881514Z   Missing ".content span.primitive,.content a.primitive,.block a.current.primitive" rule
2020-04-17T10:14:28.3882486Z   Missing "::-webkit-scrollbar-thumb" rule
2020-04-17T10:14:28.3882801Z   Missing ".content span.externcrate,.content span.mod,.content a.mod,.block a.current.mod" rule
2020-04-17T10:14:28.3883259Z   Missing ".content .highlighted.type" rule
2020-04-17T10:14:28.3883945Z   Missing "pre.rust .kw-2,pre.rust .prelude-ty" rule
2020-04-17T10:14:28.3884463Z   Missing ".content span.trait,.content a.trait,.block a.current.trait" rule
2020-04-17T10:14:28.3884759Z   Missing ".stab.internal" rule
2020-04-17T10:14:28.3885773Z 
2020-04-17T10:14:28.3886716Z command did not execute successfully: "/checkout/obj/build/x86_64-unknown-linux-gnu/stage0-tools-bin/rustdoc-themes" "/checkout/obj/build/bootstrap/debug/rustdoc" "/checkout/src/librustdoc/html/static/themes"
2020-04-17T10:14:28.3887339Z expected success, got: exit code: 1

So, this is another systematic question to answer here. Now that the stylesheets are disabled in such a way that they don't conflict with one another, it is no longer necessary to have every theme match 1:1 rule-wise. (This would result in a lot of unnecessary lines for the ayu theme; I don't need any of the many .block a.current.* rules, for instance.) However, it did catch (along with your comment) that I didn't have the newly-added scrollbar rules in my checkout when I started working on this, and will probably want to take a look at and add those.

I'm obviously not familiar with the workflow around here, so I'll let you determine what the best course of action is (perhaps changing the rule check to a warning instead of a hard error?).

@Cldfire
Copy link
Contributor Author

Cldfire commented Apr 19, 2020

I came up with a better idea for resolving the rule-checker issue. Missing rules can be added as empty rules to the bottom of the file, allowing the rule-checker to be kept on as an error in CI and ensuring that the developer has to explicitly state they don't want to do anything for those rules. The minification process can then remove the empty rules from the assets when compiling.

@GuillaumeGomez
Copy link
Member

Even if you don't use all the rules, please use all of them and don't create new one. It's exactly because in the past we had a lot of "forgotten" ones that I decided to add this check.

I think the best course of action here is a quick filter: invert(90%);

Huuuuuum... I have to admit that I'm not sure what's the best course here. I guess it's fine for the moment. :) (let's avoid adding JS if possible)

@Cldfire
Copy link
Contributor Author

Cldfire commented Apr 23, 2020

Okay, I just pushed fixes for the above discussion.

I added empty rules for the rules I didn't need to do anything with as discussed above.

Note the comment here. There's a bug in the theme checker; this line breaks the parsing of the @media (max-width: 700px) rules. It finishes parsing all the rules inside of the @media (max-width: 700px) correctly, but then when it checks the loop condition again, the event that pos is referencing next is another InBlock(_), causing the loop to begin another iteration and parsing all of the events following the @media (max-width: 700px) block as its children.

I was able to fix that issue by changing the while let to an if let (unsure if this is a correct fix for all cases). However, I then ran into an issue with the diff checking between the @media (max-width: 700px) blocks once parsing is finished. I pinpointed the problem to this block; basically, the code assumes finding two CssPaths with the same name indicates a matching rule has been found, but it makes this determination without considering whether the children match. This means the the @media (max-width: 700px) blocks can end up being matched to other @media (max-width: 700px) blocks that have differing children, causing get_differences to be called and reporting that there are missing rules.

At this point I bailed on attempting to fix the bug and decided to just leave a writeup here as fixing it feels out-of-scope for this PR.

A couple other things to note:

  • The minification process that CSS goes through does not strip empty rules. I went to change that and discovered that the minifier is a dependency from crates.io, so I can't do that here
  • There would be far fewer empty rules if the CSS checker were smarter about splitting up rules with commas into separate rules for more precise diffing

@Mark-Simulacrum
Copy link
Member

We also need to make sure we're able to include this theme from a licensing perspective. As far as I can tell, the repository you've linked is only licensed under MIT, but we need both MIT and Apache, especially for code that we'll be including in pages generated by rustdoc.

Cc @skade @joshtriplett

@Cldfire
Copy link
Contributor Author

Cldfire commented Apr 23, 2020

We also need to make sure we're able to include this theme from a licensing perspective. As far as I can tell, the repository you've linked is only licensed under MIT, but we need both MIT and Apache, especially for code that we'll be including in pages generated by rustdoc.

Cc @skade @joshtriplett

Ah, good point.

If the need arises it should be fairly straightforward to get ahold of the relevant people; the file this is based off of has 3 contributors, all of which are very active on Github.

@joshtriplett
Copy link
Member

joshtriplett commented Apr 28, 2020

@Mark-Simulacrum Thanks for the CC; yes, we'll need permission to use this under both MIT and Apache-2.0. You may want to start inquiring after that with the contributors.

How does this compare with the existing dark theme? Any chance you could provide some side-by-side comparisons that highlight notable differences introduced in this theme?

Is this intended as a third theme option, or as a replacement theme?

@Cldfire
Copy link
Contributor Author

Cldfire commented Apr 28, 2020

Pushed a fix for a bug I discovered while taking the below screenshots (I was mixing in the official styles after source pages were rendered which was causing source pages to be missing stylesheets).

How does this compare with the existing dark theme? Any chance you could provide some side-by-side comparisons that highlight notable differences introduced in this theme?

Sure:

image

image

image

image

Ayu differs from the existing dark theme in that:

  • It is a "darker" dark theme, whereas the existing dark theme is on the lighter side
  • It prefers saturated, vibrant colors over de-saturated, grey tones

Is this intended as a third theme option, or as a replacement theme?

This is intended as a third theme option.

@joshtriplett
Copy link
Member

joshtriplett commented Apr 29, 2020

This looks excellent to me. And thank you for the detailed clarifications and comparisons.

This is what I would expect a dark theme to look like, and I think it'd be the most suitable choice for what rust documentation should use when the user's browser indicates a preference for a dark theme.

Looking at those screenshots, I do think that comments need a more contrasting color, though. And could you run this through an appropriate accessibility checker to confirm color contrasts?

@tesuji
Copy link
Contributor

tesuji commented Apr 29, 2020

Could we change Rust logo to orange or brighter color?

@Cldfire
Copy link
Contributor Author

Cldfire commented Apr 30, 2020

This looks excellent to me. And thank you for the detailed clarifications and comparisons.

This is what I would expect a dark theme to look like, and I think it'd be the most suitable choice for what rust documentation should use when the user's browser indicates a preference for a dark theme.

@joshtriplett I'm glad you like it!

Personally, I just want to see the theme shipping with rustdoc. Whether or not it's a default is irrelevant to me. I think it'd be best to land the theme, give it some time out in the field, and then open an RFC and discuss the issue if people are interested.

Looking at those screenshots, I do think that comments need a more contrasting color, though. And could you run this through an appropriate accessibility checker to confirm color contrasts?

Oh yeah, I totally missed that! I was actually paying very close attention to the accessibility checker in Firefox's devtools as I combed through and put this together, so 95% of everything is meeting AA standards or better (including the comments after the commit I just pushed).

I grabbed https://addons.mozilla.org/en-US/firefox/addon/wcag-contrast-checker/ and took a quick perusal around some pages; on the whole I would subjectively say that glancing at the numbers for Ayu vs. the existing dark theme results in a slight win for Ayu. The extension has some false positives, but I manually checked those in devtools and they are good as well.

There are a couple of elements that don't quite meet AA that I noticed (line numbers and issue links on stability warnings). Line numbers I would like to avoid making higher-contrast as they distract from the main content and are useless 99% of the time; in the few cases where you do need to check one, it's easy to click on them in the source view or highlight them with the mouse elsewhere (we could also potentially brighten line numbers on hover in the future?). Issue links in stability warnings are not something you need to read, just be able to notice and click on, so I'd say those are fine as well.

Could we change Rust logo to orange or brighter color?

@lzutao Orange could potentially work, yes, and I agree that the logo will need improvement. However, I would say that this discussion is out of place for this PR; some sort of theme-dependent logo system needs to be added to rustdoc which needs to be discussed and implemented elsewhere, imo.


Anyhow, beyond fixing comments in the previous commit, I also fixed code blocks in headers (before they were orange like inline code; now they are the standard code text color, which is much more pleasant) and fixed attributes in the source pages (I had previously left them styled like comments). Here's a couple more comparison screenshots:

image

image

image

@evanjs
Copy link

evanjs commented Apr 30, 2020

I had been meaning to open a PR re merging the two doc theming systems (mdBook and rustdoc) but the scope is way too large and I don't even know where I'd create that issue.

Thanks for opening this PR!

@joelpalmer
Copy link

Ping from Triage: Hi @Cldfire - any updates?

@Cldfire
Copy link
Contributor Author

Cldfire commented May 7, 2020

@joelpalmer Yeah! Current status:

  • CI failure was caused by network issues and is spurious, the run needs to be retried (not sure if I have perms to do that?) CI has been retried and is passing ✔️
  • Waiting on @joshtriplett to reply to the accessibility improvements I made above
  • Waiting on whoever has a good idea of what needs to be asked of the 3 contributors to this file to make sure we can use this under the appropriate licensing (see this comment). (I would do it but I don't know what the Rust project needs as far as confirmation here. If someone provides me with a template I am happy to drive the discussion in this regard.)
  • Waiting on a final review from @GuillaumeGomez on the additions I made to satisfy the theme checker (see this comment and this commit)

The theme itself is ready-to-go from my point of view.

@Cldfire
Copy link
Contributor Author

Cldfire commented May 7, 2020

@bors: retry

@bors
Copy link
Contributor

bors commented May 7, 2020

@Cldfire: 🔑 Insufficient privileges: not in try users

@bors bors added S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. and removed S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. labels Jul 12, 2020
Manishearth added a commit to Manishearth/rust that referenced this pull request Jul 13, 2020
…aumeGomez

Add Ayu theme to rustdoc

This is a port of a theme I maintain (https://github.com/Cldfire/ayu-rs) to the native rustdoc theme system. [Ayu](https://github.com/dempfi/ayu) (dark) is a richly-colored dark theme that many people enjoy using across a wide variety of environments.

Corresponds to the Ayu theme in [mdBook](https://github.com/rust-lang/mdBook).

Some screenshots:

![image](https://user-images.githubusercontent.com/13814214/79547087-6c935780-8061-11ea-8a33-38e9472e9fec.png)

![image](https://user-images.githubusercontent.com/13814214/79547150-8339ae80-8061-11ea-97be-9e13a8b275d7.png)

![image](https://user-images.githubusercontent.com/13814214/79547221-98164200-8061-11ea-9649-9b11ccbb33e3.png)

![image](https://user-images.githubusercontent.com/13814214/79547310-b419e380-8061-11ea-9965-d4f90b2280ab.png)

![image](https://user-images.githubusercontent.com/13814214/79547443-e7f50900-8061-11ea-8872-06d74010691e.png)

Note that this pull request also makes some small code changes to allow for disabling theme stylesheets, preventing the rules from all the different themes from conflicting with one another. The only stylesheet that is not disabled is `light.css`; the theming system (quite hackily) switches themes by changing the href on this stylesheet and so permanently disabling all the others works perfectly fine.
Manishearth added a commit to Manishearth/rust that referenced this pull request Jul 14, 2020
…aumeGomez

Add Ayu theme to rustdoc

This is a port of a theme I maintain (https://github.com/Cldfire/ayu-rs) to the native rustdoc theme system. [Ayu](https://github.com/dempfi/ayu) (dark) is a richly-colored dark theme that many people enjoy using across a wide variety of environments.

Corresponds to the Ayu theme in [mdBook](https://github.com/rust-lang/mdBook).

Some screenshots:

![image](https://user-images.githubusercontent.com/13814214/79547087-6c935780-8061-11ea-8a33-38e9472e9fec.png)

![image](https://user-images.githubusercontent.com/13814214/79547150-8339ae80-8061-11ea-97be-9e13a8b275d7.png)

![image](https://user-images.githubusercontent.com/13814214/79547221-98164200-8061-11ea-9649-9b11ccbb33e3.png)

![image](https://user-images.githubusercontent.com/13814214/79547310-b419e380-8061-11ea-9965-d4f90b2280ab.png)

![image](https://user-images.githubusercontent.com/13814214/79547443-e7f50900-8061-11ea-8872-06d74010691e.png)

Note that this pull request also makes some small code changes to allow for disabling theme stylesheets, preventing the rules from all the different themes from conflicting with one another. The only stylesheet that is not disabled is `light.css`; the theming system (quite hackily) switches themes by changing the href on this stylesheet and so permanently disabling all the others works perfectly fine.
Dylan-DPC-zz pushed a commit to Dylan-DPC-zz/rust that referenced this pull request Jul 14, 2020
…aumeGomez

Add Ayu theme to rustdoc

This is a port of a theme I maintain (https://github.com/Cldfire/ayu-rs) to the native rustdoc theme system. [Ayu](https://github.com/dempfi/ayu) (dark) is a richly-colored dark theme that many people enjoy using across a wide variety of environments.

Corresponds to the Ayu theme in [mdBook](https://github.com/rust-lang/mdBook).

Some screenshots:

![image](https://user-images.githubusercontent.com/13814214/79547087-6c935780-8061-11ea-8a33-38e9472e9fec.png)

![image](https://user-images.githubusercontent.com/13814214/79547150-8339ae80-8061-11ea-97be-9e13a8b275d7.png)

![image](https://user-images.githubusercontent.com/13814214/79547221-98164200-8061-11ea-9649-9b11ccbb33e3.png)

![image](https://user-images.githubusercontent.com/13814214/79547310-b419e380-8061-11ea-9965-d4f90b2280ab.png)

![image](https://user-images.githubusercontent.com/13814214/79547443-e7f50900-8061-11ea-8872-06d74010691e.png)

Note that this pull request also makes some small code changes to allow for disabling theme stylesheets, preventing the rules from all the different themes from conflicting with one another. The only stylesheet that is not disabled is `light.css`; the theming system (quite hackily) switches themes by changing the href on this stylesheet and so permanently disabling all the others works perfectly fine.
Manishearth added a commit to Manishearth/rust that referenced this pull request Jul 14, 2020
…aumeGomez

Add Ayu theme to rustdoc

This is a port of a theme I maintain (https://github.com/Cldfire/ayu-rs) to the native rustdoc theme system. [Ayu](https://github.com/dempfi/ayu) (dark) is a richly-colored dark theme that many people enjoy using across a wide variety of environments.

Corresponds to the Ayu theme in [mdBook](https://github.com/rust-lang/mdBook).

Some screenshots:

![image](https://user-images.githubusercontent.com/13814214/79547087-6c935780-8061-11ea-8a33-38e9472e9fec.png)

![image](https://user-images.githubusercontent.com/13814214/79547150-8339ae80-8061-11ea-97be-9e13a8b275d7.png)

![image](https://user-images.githubusercontent.com/13814214/79547221-98164200-8061-11ea-9649-9b11ccbb33e3.png)

![image](https://user-images.githubusercontent.com/13814214/79547310-b419e380-8061-11ea-9965-d4f90b2280ab.png)

![image](https://user-images.githubusercontent.com/13814214/79547443-e7f50900-8061-11ea-8872-06d74010691e.png)

Note that this pull request also makes some small code changes to allow for disabling theme stylesheets, preventing the rules from all the different themes from conflicting with one another. The only stylesheet that is not disabled is `light.css`; the theming system (quite hackily) switches themes by changing the href on this stylesheet and so permanently disabling all the others works perfectly fine.
bors added a commit to rust-lang-ci/rust that referenced this pull request Jul 14, 2020
…arth

Rollup of 15 pull requests

Successful merges:

 - rust-lang#71237 (Add Ayu theme to rustdoc)
 - rust-lang#73720 (Clean up E0704 error explanation)
 - rust-lang#73866 (Obviate #[allow(improper_ctypes_definitions)])
 - rust-lang#73965 (typeck: check for infer before type impls trait)
 - rust-lang#73986 (add (unchecked) indexing methods to raw (and NonNull) slices)
 - rust-lang#74173 (Detect tuple struct incorrectly used as struct pat)
 - rust-lang#74220 (Refactor Windows `parse_prefix`)
 - rust-lang#74227 (Remove an unwrap in layout computation)
 - rust-lang#74239 (Update llvm-project to latest origin/rustc/10.0-2020-05-05 commit )
 - rust-lang#74257 (don't mark linux kernel module targets as a unix environment)
 - rust-lang#74270 (typeck: report placeholder type error w/out span)
 - rust-lang#74296 (Clarify the description for rfind)
 - rust-lang#74310 (Use `ArrayVec` in `SparseBitSet`.)
 - rust-lang#74316 (Remove unnecessary type hints from Wake internals)
 - rust-lang#74324 (Update Clippy)

Failed merges:

r? @ghost
@bors bors merged commit 03f565c into rust-lang:master Jul 14, 2020
@Cldfire Cldfire deleted the rustdoc-ayu-theme branch July 14, 2020 21:06
@ollie27 ollie27 modified the milestones: 1.46, 1.47 Jul 24, 2020
yvt added a commit to r3-os/r3 that referenced this pull request Jul 31, 2020
This theme was recently added to rustdoc.
<rust-lang/rust#71237>
@dbrgn
Copy link
Contributor

dbrgn commented Oct 8, 2020

Awesome work! I like it much more than the previous dark theme 🙂 💪

netbsd-srcmastr pushed a commit to NetBSD/pkgsrc that referenced this pull request Nov 13, 2020
Pkgsrc changes:
 * Remove patches now integrated upstream, many related to SunOS / Illumos.
 * The LLVM fix for powerpc is also now integrated upstream.
 * Adapt those patches where the source has moved or parts are integrated.
 * The randomness patches no longer applies, and I could not find
   where those files went...
 * Provide a separate bootstrap for NetBSD/powerpc 9.0, since apparently
   the C++ ABI is different from 8.0.  Yes, this appears to be specific to
   the NetBSD powerpc ports.

Upstream changes:

Version 1.47.0 (2020-10-08)
==========================

Language
--------
- [Closures will now warn when not used.][74869]

Compiler
--------
- [Stabilized the `-C control-flow-guard` codegen option][73893], which enables
  [Control Flow Guard][1.47.0-cfg] for Windows platforms, and is ignored on
  other platforms.
- [Upgraded to LLVM 11.][73526]
- [Added tier 3\* support for the `thumbv4t-none-eabi` target.][74419]
- [Upgrade the FreeBSD toolchain to version 11.4][75204]
- [`RUST_BACKTRACE`'s output is now more compact.][75048]

\* Refer to Rust's [platform support page][forge-platform-support] for more
information on Rust's tiered platform support.

Libraries
---------
- [`CStr` now implements `Index<RangeFrom<usize>>`.][74021]
- [Traits in `std`/`core` are now implemented for arrays of any length, not just
  those of length less than 33.][74060]
- [`ops::RangeFull` and `ops::Range` now implement Default.][73197]
- [`panic::Location` now implements `Copy`, `Clone`, `Eq`, `Hash`, `Ord`,
  `PartialEq`, and `PartialOrd`.][73583]

Stabilized APIs
---------------
- [`Ident::new_raw`]
- [`Range::is_empty`]
- [`RangeInclusive::is_empty`]
- [`Result::as_deref`]
- [`Result::as_deref_mut`]
- [`Vec::leak`]
- [`pointer::offset_from`]
- [`f32::TAU`]
- [`f64::TAU`]

The following previously stable APIs have now been made const.

- [The `new` method for all `NonZero` integers.][73858]
- [The `checked_add`,`checked_sub`,`checked_mul`,`checked_neg`, `checked_shl`,
  `checked_shr`, `saturating_add`, `saturating_sub`, and `saturating_mul`
  methods for all integers.][73858]
- [The `checked_abs`, `saturating_abs`, `saturating_neg`, and `signum`  for all
  signed integers.][73858]
- [The `is_ascii_alphabetic`, `is_ascii_uppercase`, `is_ascii_lowercase`,
  `is_ascii_alphanumeric`, `is_ascii_digit`, `is_ascii_hexdigit`,
  `is_ascii_punctuation`, `is_ascii_graphic`, `is_ascii_whitespace`, and
  `is_ascii_control` methods for `char` and `u8`.][73858]

Cargo
-----
- [`build-dependencies` are now built with opt-level 0 by default.][cargo/8500]
  You can override this by setting the following in your `Cargo.toml`.
  ```toml
  [profile.release.build-override]
  opt-level = 3
  ```
- [`cargo-help` will now display man pages for commands rather just the
  `--help` text.][cargo/8456]
- [`cargo-metadata` now emits a `test` field indicating if a target has
  tests enabled.][cargo/8478]
- [`workspace.default-members` now respects `workspace.exclude`.][cargo/8485]
- [`cargo-publish` will now use an alternative registry by default if it's the
  only registry specified in `package.publish`.][cargo/8571]

Misc
----
- [Added a help button beside Rustdoc's searchbar that explains rustdoc's
  type based search.][75366]
- [Added the Ayu theme to rustdoc.][71237]

Compatibility Notes
-------------------
- [Bumped the minimum supported Emscripten version to 1.39.20.][75716]
- [Fixed a regression parsing `{} && false` in tail expressions.][74650]
- [Added changes to how proc-macros are expanded in `macro_rules!` that should
  help to preserve more span information.][73084] These changes may cause
  compiliation errors if your macro was unhygenic or didn't correctly handle
  `Delimiter::None`.
- [Moved support for the CloudABI target to tier 3.][75568]
- [`linux-gnu` targets now require minimum kernel 2.6.32 and glibc 2.11.][74163]

Internal Only
--------
- [Improved default settings for bootstrapping in `x.py`.][73964]
  You can read details about this change in the ["Changes to `x.py`
  defaults"](https://blog.rust-lang.org/inside-rust/2020/08/30/changes-to-x-py-defaults.html)
  post on the Inside Rust blog.

- [Added the `rustc-docs` component.][75560] This allows you to install
  and read the documentation for the compiler internal APIs. (Currently only
  available for `x86_64-unknown-linux-gnu`.)

[1.47.0-cfg]: https://docs.microsoft.com/en-us/windows/win32/secbp/control-flow-guard
[76980]: rust-lang/rust#76980
[75048]: rust-lang/rust#75048
[74163]: rust-lang/rust#74163
[71237]: rust-lang/rust#71237
[74869]: rust-lang/rust#74869
[73858]: rust-lang/rust#73858
[75716]: rust-lang/rust#75716
[75908]: rust-lang/rust#75908
[75516]: rust-lang/rust#75516
[75560]: rust-lang/rust#75560
[75568]: rust-lang/rust#75568
[75366]: rust-lang/rust#75366
[75204]: rust-lang/rust#75204
[74650]: rust-lang/rust#74650
[74419]: rust-lang/rust#74419
[73964]: rust-lang/rust#73964
[74021]: rust-lang/rust#74021
[74060]: rust-lang/rust#74060
[73893]: rust-lang/rust#73893
[73526]: rust-lang/rust#73526
[73583]: rust-lang/rust#73583
[73084]: rust-lang/rust#73084
[73197]: rust-lang/rust#73197
[72488]: rust-lang/rust#72488
[cargo/8456]: rust-lang/cargo#8456
[cargo/8478]: rust-lang/cargo#8478
[cargo/8485]: rust-lang/cargo#8485
[cargo/8500]: rust-lang/cargo#8500
[cargo/8571]: rust-lang/cargo#8571
[`Ident::new_raw`]:  https://doc.rust-lang.org/nightly/proc_macro/struct.Ident.html#method.new_raw
[`Range::is_empty`]: https://doc.rust-lang.org/nightly/std/ops/struct.Range.html#method.is_empty
[`RangeInclusive::is_empty`]: https://doc.rust-lang.org/nightly/std/ops/struct.RangeInclusive.html#method.is_empty
[`Result::as_deref_mut`]: https://doc.rust-lang.org/nightly/std/result/enum.Result.html#method.as_deref_mut
[`Result::as_deref`]: https://doc.rust-lang.org/nightly/std/result/enum.Result.html#method.as_deref
[`TypeId::of`]: https://doc.rust-lang.org/nightly/std/any/struct.TypeId.html#method.of
[`Vec::leak`]: https://doc.rust-lang.org/nightly/std/vec/struct.Vec.html#method.leak
[`f32::TAU`]: https://doc.rust-lang.org/nightly/std/f32/consts/constant.TAU.html
[`f64::TAU`]: https://doc.rust-lang.org/nightly/std/f64/consts/constant.TAU.html
[`pointer::offset_from`]: https://doc.rust-lang.org/nightly/std/primitive.pointer.html#method.offset_from
jonathanpallant added a commit to ferrocene/rust that referenced this pull request Dec 11, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
relnotes Marks issues that should be documented in the release notes of the next release. S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion.
Projects
None yet
Development

Successfully merging this pull request may close these issues.