File tree 2 files changed +34
-6
lines changed
2 files changed +34
-6
lines changed Original file line number Diff line number Diff line change @@ -589,8 +589,31 @@ impl RustwideBuilder {
589
589
rustdoc_flags. extend ( vec ! [
590
590
"--resource-suffix" . to_string( ) ,
591
591
format!( "-{}" , parse_rustc_version( & self . rustc_version) ?) ,
592
+ "--html-before-content" . to_string( ) ,
593
+ "docrs-version.html" . to_string( ) ,
594
+ "--html-in-header" . to_string( ) ,
595
+ "docsrs-in-header.html" . to_string( ) ,
592
596
] ) ;
593
597
598
+ let f = build. host_source_dir ( ) . join ( "docrs-version.html" ) ;
599
+ std:: fs:: write ( f, "<div id=\" docs-rustdoc-v1\" ></div>" ) . expect ( "failed" ) ;
600
+ let f = build. host_source_dir ( ) . join ( "docsrs-in-header.html" ) ;
601
+ std:: fs:: write ( f, "<style>\
602
+ #rustdoc_body_wrapper {
603
+ padding: 0;
604
+ }
605
+ div.container-rustdoc > .docs-rs-footer {
606
+ bottom: 0;
607
+ right: 0;
608
+ }
609
+ div.container-rustdoc:not(.source) > .docs-rs-footer {
610
+ left: 200px;
611
+ }
612
+ div.rustdoc #sidebar-toggle {
613
+ top: 0;
614
+ }\
615
+ </style>") . expect ( "failed" ) ;
616
+
594
617
let mut storage = LogStorage :: new ( LevelFilter :: Info ) ;
595
618
storage. set_max_size ( limits. max_log_size ( ) ) ;
596
619
Original file line number Diff line number Diff line change 4
4
// This rule is needed to be sure that the footer will always be at the bottom of the page.
5
5
#rustdoc_body_wrapper {
6
6
min-height : calc (100vh - #{$top-navbar-height + $footer-height + 2 } );
7
- padding : 0 ;
7
+ }
8
8
9
- .sidebar {
9
+ #rustdoc_body_wrapper {
10
+ #docs-rustdoc-v1 ~ .sidebar {
10
11
margin-top : 0 ;
11
12
top : $top-navbar-height ;
12
13
15
16
}
16
17
}
17
18
18
- main {
19
+ #docs-rustdoc-v1 ~ main {
19
20
padding-bottom : 50px ;
20
21
}
21
22
}
@@ -33,8 +34,8 @@ div.container-rustdoc {
33
34
text-align : left ;
34
35
35
36
> .docs-rs-footer {
36
- bottom : 0 ;
37
- right : 0 ;
37
+ bottom : -32 px ;
38
+ right : -15 px ;
38
39
width : unset ;
39
40
}
40
41
}
@@ -45,7 +46,7 @@ div.container-rustdoc {
45
46
46
47
div .container-rustdoc :not (.source ) {
47
48
> .docs-rs-footer {
48
- left : 200 px ; // This is the left sidebar
49
+ left : 185 px ; // This is the left sidebar
49
50
}
50
51
51
52
// This is when the rustdoc sidebar "disappears" (for mobile mode).
@@ -125,6 +126,10 @@ div.rustdoc {
125
126
top : $top-navbar-height ;
126
127
}
127
128
129
+ #sidebar-toggle {
130
+ top : 62px ;
131
+ }
132
+
128
133
& :focus {
129
134
outline : unset ;
130
135
}
You can’t perform that action at this time.
0 commit comments