Skip to content

Commit

Permalink
doc: detect the theme CSS paths used in docs.rs
Browse files Browse the repository at this point in the history
E.g., <https://docs.rs/ayu-20220314-1.61.0-nightly-285fa7ecd.css>

Fixes the theme detection and adaption on docs.rs.
  • Loading branch information
yvt committed Mar 19, 2022
1 parent e76da48 commit 7584094
Show file tree
Hide file tree
Showing 11 changed files with 26 additions and 1 deletion.
1 change: 1 addition & 0 deletions src/r3/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.
### Fixed

- Upgrade `svgbobdoc` to `^0.3.0` to fix build failures in documentation build
- Improve rustdoc theme detection on docs.rs

## [0.2.0] - 2022-03-15

Expand Down
2 changes: 1 addition & 1 deletion src/r3/src/common.md
Original file line number Diff line number Diff line change
Expand Up @@ -152,7 +152,7 @@ function initThemeMonitor() {
document.body.classList.add(currentClassName);
}

var match = themeStyle.href.match(/([a-z]+)\.css$/);
var match = themeStyle.href.match(/\/([a-z]+)(-[-a-zA-Z0-9.]*)?\.css$/);
var currentStyle = (match && match[1]) || "light";
onApplyTheme(currentStyle);

Expand Down
1 change: 1 addition & 0 deletions src/r3_core/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.
### Fixed

- Upgrade `svgbobdoc` to `^0.3.0` to fix build failures in documentation build
- Improve rustdoc theme detection on docs.rs

## 0.1.0 - 2022-03-15

Expand Down
1 change: 1 addition & 0 deletions src/r3_kernel/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.
### Fixed

- Upgrade `svgbobdoc` to `^0.3.0` to fix build failures in documentation build
- Improve rustdoc theme detection on docs.rs

## 0.1.0 - 2022-03-15

Expand Down
4 changes: 4 additions & 0 deletions src/r3_port_arm/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,10 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.

## [Unreleased]

### Fixed

- Improve rustdoc theme detection on docs.rs

## [0.2.0] - 2022-03-15

### Changed
Expand Down
4 changes: 4 additions & 0 deletions src/r3_port_arm_m/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,10 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.

## [Unreleased]

### Fixed

- Improve rustdoc theme detection on docs.rs

## [0.3.0] - 2022-03-15

### Changed
Expand Down
1 change: 1 addition & 0 deletions src/r3_port_riscv/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.
### Fixed

- Upgrade `svgbobdoc` to `^0.3.0` to fix build failures in documentation build
- Improve rustdoc theme detection on docs.rs

## [0.2.0] - 2022-03-15

Expand Down
4 changes: 4 additions & 0 deletions src/r3_port_std/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,10 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.

## [Unreleased]

### Fixed

- Improve rustdoc theme detection on docs.rs

## [0.2.0] - 2022-03-15

### Changed
Expand Down
1 change: 1 addition & 0 deletions src/r3_portkit/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.
### Fixed

- Upgrade `svgbobdoc` to `^0.3.0` to fix build failures in documentation build
- Improve rustdoc theme detection on docs.rs

## [0.2.0] - 2022-03-15

Expand Down
4 changes: 4 additions & 0 deletions src/r3_support_rp2040/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,10 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.

## [Unreleased]

### Fixed

- Improve rustdoc theme detection on docs.rs

## [0.2.0] - 2022-03-15

### Changed
Expand Down
4 changes: 4 additions & 0 deletions src/r3_support_rza1/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,10 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.

## [Unreleased]

### Fixed

- Improve rustdoc theme detection on docs.rs

## [0.2.0] - 2022-03-15

### Changed
Expand Down

0 comments on commit 7584094

Please sign in to comment.