markdowndocs 0.6.0 → 0.6.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 834e28ea5348dcb63b8e7c5f952baa34d72166958da926627e16e8c3d1c300e8
|
|
4
|
+
data.tar.gz: 7cae90fb66f75bf05e14ef61189ab5663e655459a55dc914c9187341af715046
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 43e73ace730900362729bc27b4d086cfac1ba6416d1270df6c52ed1ae40bceccd04cde503c0ae29cc1edd4bb890472ec5c9a8877cbf3bd2307d17d66413eb463
|
|
7
|
+
data.tar.gz: 9d787524af79383f2a77c9c7c1a0bce5c18070a1ab9c46c7ae94fe32c2aa728d15f4f8f7741f14c751edc4ae3c84c9e20a3478d1d668eebc8beb3c12784592e5
|
data/CHANGELOG.md
CHANGED
|
@@ -5,6 +5,33 @@ All notable changes to this project will be documented in this file.
|
|
|
5
5
|
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
|
|
6
6
|
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
|
|
7
7
|
|
|
8
|
+
## [0.6.1] - 2026-05-13
|
|
9
|
+
|
|
10
|
+
### Fixed
|
|
11
|
+
|
|
12
|
+
- **Duplicate `id="docs-mode-switcher"` in the DOM** (issue #20). The
|
|
13
|
+
show layout renders `_navigation` (and therefore the mode switcher)
|
|
14
|
+
twice — once for the mobile sidebar, once for the desktop sidebar.
|
|
15
|
+
The hardcoded id on `_mode_switcher.html.erb` produced two elements
|
|
16
|
+
with the same id on every doc show page, a WCAG 4.1.1 violation.
|
|
17
|
+
|
|
18
|
+
Dropped the `id=` from the partial entirely. Stimulus already scopes
|
|
19
|
+
the controller via `data-controller="docs-mode"`, which can appear
|
|
20
|
+
N times in a document without colliding.
|
|
21
|
+
|
|
22
|
+
Host apps / tests / custom CSS selecting via `#docs-mode-switcher`
|
|
23
|
+
should switch to `[data-controller="docs-mode"]`. Note: any host app
|
|
24
|
+
relying on that id was already in a broken state (duplicate ids in
|
|
25
|
+
the DOM); this fix surfaces the issue rather than creating it.
|
|
26
|
+
|
|
27
|
+
### Migration notes
|
|
28
|
+
|
|
29
|
+
- If you have a CSS rule like `#docs-mode-switcher { ... }`, change it
|
|
30
|
+
to `[data-controller="docs-mode"] { ... }`.
|
|
31
|
+
- If you have a Capybara test using `within "#docs-mode-switcher"`,
|
|
32
|
+
change it to `within first("[data-controller='docs-mode']")` (or
|
|
33
|
+
similar — the partial may render twice depending on your layout).
|
|
34
|
+
|
|
8
35
|
## [0.6.0] - 2026-05-13
|
|
9
36
|
|
|
10
37
|
### Added
|
|
@@ -104,10 +104,10 @@ module Markdowndocs
|
|
|
104
104
|
parsed = parse_frontmatter
|
|
105
105
|
raw = parsed[:frontmatter]["audience"]
|
|
106
106
|
case raw
|
|
107
|
-
when Array
|
|
108
|
-
when String then [
|
|
109
|
-
when nil
|
|
110
|
-
else
|
|
107
|
+
when Array then raw.map(&:to_s)
|
|
108
|
+
when String then [raw]
|
|
109
|
+
when nil then Markdowndocs.config.modes.dup
|
|
110
|
+
else Markdowndocs.config.modes.dup
|
|
111
111
|
end
|
|
112
112
|
end
|
|
113
113
|
end
|
|
@@ -1,6 +1,11 @@
|
|
|
1
1
|
<%# locals: (current_mode:, available_modes:) %>
|
|
2
|
+
<%# No `id=` on the root: show.html.erb renders _navigation twice (mobile +
|
|
3
|
+
desktop sidebars), which embeds this partial twice — a hardcoded id
|
|
4
|
+
would produce duplicate ids in the DOM (WCAG 4.1.1 violation, see
|
|
5
|
+
issue #20). Stimulus already scopes itself via data-controller, which
|
|
6
|
+
can appear N times without colliding. Tests / selectors should target
|
|
7
|
+
[data-controller="docs-mode"] rather than #docs-mode-switcher. %>
|
|
2
8
|
<div
|
|
3
|
-
id="docs-mode-switcher"
|
|
4
9
|
class="
|
|
5
10
|
bg-white
|
|
6
11
|
dark:bg-slate-800
|
data/lib/markdowndocs/version.rb
CHANGED