Unified · Split
| @@ -123,6 +123,14 @@ pre, %pre { · 122 unmodified lines | |||
| 123 | @extend %box; | 123 | @extend %box; |
| 124 | } | 124 | } |
| 125 | 125 | ||
| 126 | details:has(> pre) { | ||
| 127 | margin: 1.5em 0; | ||
| 128 | |||
| 129 | > pre { | ||
| 130 | margin: 0; | ||
| 131 | } | ||
| 132 | } | ||
| 133 | |||
| 126 | a > code { color: inherit; } | 134 | a > code { color: inherit; } |
| 127 | 135 | ||
| 128 | table { | 136 | table { |
| @@ -8,15 +8,17 @@ module Docs · 7 unmodified lines | |||
| 8 | next unless (node.css('code').to_a.length > 1) | 8 | next unless (node.css('code').to_a.length > 1) |
| 9 | 9 | ||
| 10 | node.css('code').each do |subnode| | 10 | node.css('code').each do |subnode| |
| 11 | node.before(subnode) | ||
| 11 | 12 | ||
| 12 | if subnode.classes.include?('mjs') | 13 | if subnode.classes.include?('mjs') |
| 13 | node.before('<p class=module-type>MJS modules</p>') | 14 | subnode.wrap('<details open>') |
| 15 | subnode.wrap('<pre>') | ||
| 16 | subnode.ancestors('details').first.prepend_child('<summary>JavaScript modules</summary>') | ||
| 14 | elsif subnode.classes.include?('cjs') | 17 | elsif subnode.classes.include?('cjs') |
| 15 | node.before('<p class=module-type>CJS modules</p>') | 18 | subnode.wrap('<details>') |
| 19 | subnode.wrap('<pre>') | ||
| 20 | subnode.ancestors('details').first.prepend_child('<summary>CommonJS</summary>') | ||
| 16 | end | 21 | end |
| 17 | |||
| 18 | node.before(subnode) | ||
| 19 | subnode.wrap('<pre>') | ||
| 20 | end | 22 | end |
| 21 | 23 | ||
| 22 | node.remove | 24 | node.remove |