rdoc 6.16.1 → 7.0.0

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.
Files changed (38) hide show
  1. checksums.yaml +4 -4
  2. data/CONTRIBUTING.md +187 -0
  3. data/LEGAL.rdoc +6 -0
  4. data/README.md +20 -3
  5. data/lib/rdoc/code_object/any_method.rb +15 -7
  6. data/lib/rdoc/code_object/class_module.rb +13 -0
  7. data/lib/rdoc/code_object/constant.rb +9 -0
  8. data/lib/rdoc/code_object/method_attr.rb +13 -1
  9. data/lib/rdoc/code_object/top_level.rb +13 -1
  10. data/lib/rdoc/generator/aliki.rb +124 -0
  11. data/lib/rdoc/generator/darkfish.rb +5 -1
  12. data/lib/rdoc/generator/template/aliki/_head.rhtml +4 -4
  13. data/lib/rdoc/generator/template/aliki/_icons.rhtml +208 -0
  14. data/lib/rdoc/generator/template/aliki/_sidebar_ancestors.rhtml +12 -2
  15. data/lib/rdoc/generator/template/aliki/_sidebar_classes.rhtml +12 -2
  16. data/lib/rdoc/generator/template/aliki/_sidebar_extends.rhtml +20 -10
  17. data/lib/rdoc/generator/template/aliki/_sidebar_includes.rhtml +20 -10
  18. data/lib/rdoc/generator/template/aliki/_sidebar_methods.rhtml +32 -12
  19. data/lib/rdoc/generator/template/aliki/_sidebar_pages.rhtml +58 -28
  20. data/lib/rdoc/generator/template/aliki/_sidebar_sections.rhtml +16 -6
  21. data/lib/rdoc/generator/template/aliki/class.rhtml +4 -5
  22. data/lib/rdoc/generator/template/aliki/css/rdoc.css +368 -36
  23. data/lib/rdoc/generator/template/aliki/index.rhtml +1 -0
  24. data/lib/rdoc/generator/template/aliki/js/aliki.js +18 -3
  25. data/lib/rdoc/generator/template/aliki/js/{search.js → search_controller.js} +6 -6
  26. data/lib/rdoc/generator/template/aliki/js/search_navigation.js +105 -0
  27. data/lib/rdoc/generator/template/aliki/js/search_ranker.js +239 -0
  28. data/lib/rdoc/generator/template/aliki/page.rhtml +1 -0
  29. data/lib/rdoc/generator/template/darkfish/class.rhtml +3 -5
  30. data/lib/rdoc/markup/to_ansi.rb +4 -0
  31. data/lib/rdoc/markup/to_bs.rb +4 -0
  32. data/lib/rdoc/markup/to_rdoc.rb +11 -3
  33. data/lib/rdoc/options.rb +1 -1
  34. data/lib/rdoc/rubygems_hook.rb +3 -3
  35. data/lib/rdoc/version.rb +1 -1
  36. data/rdoc.gemspec +1 -1
  37. metadata +9 -6
  38. data/CONTRIBUTING.rdoc +0 -219
@@ -85,6 +85,16 @@
85
85
  --color-th-background: var(--color-neutral-100);
86
86
  --color-td-background: var(--color-neutral-50);
87
87
 
88
+ /* Search Type Badge Colors */
89
+ --color-search-type-class-bg: #e6f0ff;
90
+ --color-search-type-class-text: #0050a0;
91
+ --color-search-type-module-bg: #e6ffe6;
92
+ --color-search-type-module-text: #060;
93
+ --color-search-type-constant-bg: #fff0e6;
94
+ --color-search-type-constant-text: #995200;
95
+ --color-search-type-method-bg: #f0e6ff;
96
+ --color-search-type-method-text: #5200a0;
97
+
88
98
  /* RGBA Colors (theme-agnostic) */
89
99
  --color-overlay: rgb(0 0 0 / 50%);
90
100
  --color-emphasis-bg: rgb(255 111 97 / 10%);
@@ -142,12 +152,13 @@
142
152
 
143
153
  /* Shadows */
144
154
  --shadow-sm: 0 1px 3px 0 rgb(0 0 0 / 10%), 0 1px 2px -1px rgb(0 0 0 / 10%);
155
+ --shadow-md: 0 2px 8px rgb(0 0 0 / 10%);
145
156
  --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 10%), 0 4px 6px -4px rgb(0 0 0 / 10%);
146
157
  --shadow-xl: 0 20px 25px -5px rgb(0 0 0 / 10%), 0 8px 10px -6px rgb(0 0 0 / 10%);
147
158
 
148
159
  /* Layout Dimensions */
149
- --layout-sidebar-width: 280px;
150
- --layout-sidebar-width-min: 240px;
160
+ --layout-sidebar-width: 300px;
161
+ --layout-sidebar-width-min: 300px;
151
162
  --layout-sidebar-width-max: 15%;
152
163
  --layout-toc-width-min: 240px;
153
164
  --layout-toc-width-max: 18%;
@@ -158,6 +169,13 @@
158
169
  /* Transitions */
159
170
  --transition-fast: 150ms ease-in-out;
160
171
  --transition-base: 200ms ease-in-out;
172
+ --transition-slow: 350ms ease-in-out;
173
+ --ease-out-smooth: cubic-bezier(0.4, 0, 0.2, 1);
174
+
175
+ /* Animation Durations */
176
+ --duration-fast: 250ms;
177
+ --duration-base: 300ms;
178
+ --duration-medium: 350ms;
161
179
 
162
180
  /* Z-Index Scale */
163
181
  --z-fixed: 300;
@@ -202,6 +220,7 @@
202
220
  --color-accent-primary: var(--color-primary-500);
203
221
  --color-accent-hover: var(--color-primary-400);
204
222
  --color-accent-subtle: rgb(235 84 79 / 10%);
223
+ --color-accent-subtle-hover: rgb(235 84 79 / 20%);
205
224
  --color-code-bg: var(--color-neutral-800);
206
225
  --color-code-border: var(--color-neutral-700);
207
226
  --color-nav-bg: var(--color-neutral-900);
@@ -209,8 +228,19 @@
209
228
  --color-th-background: var(--color-background-tertiary);
210
229
  --color-td-background: var(--color-background-secondary);
211
230
 
231
+ /* Search Type Badge Colors - Dark Theme */
232
+ --color-search-type-class-bg: #1e3a5f;
233
+ --color-search-type-class-text: #93c5fd;
234
+ --color-search-type-module-bg: #14532d;
235
+ --color-search-type-module-text: #86efac;
236
+ --color-search-type-constant-bg: #451a03;
237
+ --color-search-type-constant-text: #fcd34d;
238
+ --color-search-type-method-bg: #3b0764;
239
+ --color-search-type-method-text: #d8b4fe;
240
+
212
241
  /* Dark theme shadows (slightly more subtle) */
213
242
  --shadow-sm: 0 1px 3px 0 rgb(0 0 0 / 40%), 0 1px 2px -1px rgb(0 0 0 / 40%);
243
+ --shadow-md: 0 2px 8px rgb(0 0 0 / 40%);
214
244
  --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 40%), 0 4px 6px -4px rgb(0 0 0 / 40%);
215
245
  --shadow-xl: 0 20px 25px -5px rgb(0 0 0 / 40%), 0 8px 10px -6px rgb(0 0 0 / 40%);
216
246
 
@@ -228,13 +258,13 @@ body {
228
258
 
229
259
  /* Grid layout with header, sidebar, main, and footer */
230
260
  display: grid;
231
- grid-template: "header header" var(--layout-header-height) "nav main" 1fr "nav footer" auto / minmax(var(--layout-sidebar-width-min), var(--layout-sidebar-width-max)) 1fr;
261
+ grid-template: "header header" var(--layout-header-height) "nav main" 1fr "nav footer" auto / var(--layout-sidebar-width) 1fr;
232
262
  min-height: 100vh;
233
263
  }
234
264
 
235
265
  /* Three-column layout when TOC is present */
236
266
  body.has-toc {
237
- grid-template: "header header header" var(--layout-header-height) "nav main toc" 1fr "nav footer toc" auto / minmax(var(--layout-sidebar-width-min), var(--layout-sidebar-width-max)) 1fr minmax(var(--layout-toc-width-min), var(--layout-toc-width-max));
267
+ grid-template: "header header header" var(--layout-header-height) "nav main toc" 1fr "nav footer toc" auto / var(--layout-sidebar-width) 1fr minmax(var(--layout-toc-width-min), var(--layout-toc-width-max));
238
268
  min-height: 100vh;
239
269
  }
240
270
 
@@ -291,7 +321,12 @@ pre {
291
321
  border-radius: var(--radius-sm);
292
322
  cursor: pointer;
293
323
  opacity: 0.6;
294
- transition: opacity var(--transition-fast), background var(--transition-fast), border-color var(--transition-fast), transform var(--transition-fast);
324
+ transition:
325
+ opacity var(--transition-fast),
326
+ background var(--transition-fast),
327
+ border-color var(--transition-fast),
328
+ transform var(--transition-fast),
329
+ box-shadow var(--transition-fast);
295
330
  display: flex;
296
331
  align-items: center;
297
332
  justify-content: center;
@@ -305,10 +340,18 @@ pre {
305
340
  opacity: 1;
306
341
  background: var(--color-background-tertiary);
307
342
  border-color: var(--color-border-emphasis);
343
+ transform: translateY(-1px);
344
+ box-shadow: var(--shadow-md);
345
+ }
346
+
347
+ .copy-code-button:focus {
348
+ outline: none;
349
+ box-shadow: 0 0 0 3px var(--color-accent-subtle);
308
350
  }
309
351
 
310
352
  .copy-code-button:active {
311
- transform: scale(0.95);
353
+ transform: scale(0.92);
354
+ box-shadow: none;
312
355
  }
313
356
 
314
357
  .copy-code-button svg {
@@ -320,7 +363,7 @@ pre {
320
363
  stroke-linecap: round;
321
364
  stroke-linejoin: round;
322
365
  color: var(--color-text-secondary);
323
- transition: color var(--transition-fast);
366
+ transition: color var(--transition-fast), transform var(--transition-base);
324
367
  }
325
368
 
326
369
  .copy-code-button:hover svg {
@@ -457,7 +500,11 @@ header.top-navbar .navbar-search form {
457
500
  border-radius: var(--radius-md);
458
501
  color: var(--color-text-primary);
459
502
  cursor: pointer;
460
- transition: background var(--transition-fast), border-color var(--transition-fast), color var(--transition-fast);
503
+ transition:
504
+ background var(--transition-fast),
505
+ border-color var(--transition-fast),
506
+ color var(--transition-fast),
507
+ transform var(--transition-fast);
461
508
  font-size: var(--font-size-lg);
462
509
  line-height: 1;
463
510
  width: 2.5rem;
@@ -468,6 +515,7 @@ header.top-navbar .navbar-search form {
468
515
  background: var(--color-background-secondary);
469
516
  border-color: var(--color-accent-primary);
470
517
  color: var(--color-accent-primary);
518
+ transform: scale(1.05);
471
519
  }
472
520
 
473
521
  .theme-toggle:focus {
@@ -476,13 +524,17 @@ header.top-navbar .navbar-search form {
476
524
  box-shadow: 0 0 0 3px var(--color-accent-subtle);
477
525
  }
478
526
 
527
+ .theme-toggle:active {
528
+ transform: scale(0.95);
529
+ }
530
+
479
531
  .theme-toggle-icon {
480
532
  display: inline-block;
481
- transition: transform var(--transition-base);
533
+ transition: transform var(--duration-base) var(--ease-out-smooth);
482
534
  }
483
535
 
484
536
  .theme-toggle:hover .theme-toggle-icon {
485
- transform: rotate(20deg);
537
+ transform: rotate(15deg) scale(1.1);
486
538
  }
487
539
 
488
540
  /* Mobile navbar */
@@ -537,12 +589,33 @@ nav {
537
589
  background: var(--color-nav-bg);
538
590
  color: var(--color-nav-text);
539
591
  overflow: hidden auto;
592
+ overscroll-behavior: contain;
540
593
  display: flex;
541
594
  flex-direction: column;
542
595
  position: sticky;
543
596
  top: var(--layout-header-height);
544
597
  height: calc(100vh - var(--layout-header-height));
545
- align-self: start;
598
+ scrollbar-width: thin;
599
+ scrollbar-color: var(--color-border-default) transparent;
600
+ }
601
+
602
+ /* Custom scrollbar for WebKit browsers */
603
+ nav::-webkit-scrollbar {
604
+ width: 6px;
605
+ }
606
+
607
+ nav::-webkit-scrollbar-track {
608
+ background: transparent;
609
+ }
610
+
611
+ nav::-webkit-scrollbar-thumb {
612
+ background: var(--color-border-default);
613
+ border-radius: var(--radius-sm);
614
+ transition: background var(--transition-fast);
615
+ }
616
+
617
+ nav::-webkit-scrollbar-thumb:hover {
618
+ background: var(--color-border-emphasis);
546
619
  }
547
620
 
548
621
  /* Mobile navigation */
@@ -616,6 +689,18 @@ nav ul li {
616
689
  line-height: var(--line-height-relaxed);
617
690
  }
618
691
 
692
+ nav ul li a {
693
+ padding: var(--space-1) 0;
694
+ transition:
695
+ color var(--transition-fast),
696
+ transform var(--transition-fast),
697
+ padding var(--transition-fast);
698
+ }
699
+
700
+ nav ul li a:hover {
701
+ padding-left: var(--space-1);
702
+ }
703
+
619
704
  nav ul ul {
620
705
  padding-left: var(--space-5);
621
706
  margin-top: var(--space-2);
@@ -633,6 +718,17 @@ nav a {
633
718
  text-decoration: none;
634
719
  }
635
720
 
721
+ /* Truncation for direct nav links (not links inside code tags) */
722
+ nav .nav-list > li > a,
723
+ nav .nav-section > ul > li > a,
724
+ nav .nav-section > dl > dd > a {
725
+ display: block;
726
+ max-width: 100%;
727
+ overflow: hidden;
728
+ text-overflow: ellipsis;
729
+ white-space: nowrap;
730
+ }
731
+
636
732
  nav footer {
637
733
  padding: var(--space-4);
638
734
  border-top: 1px solid var(--color-border-default);
@@ -664,6 +760,8 @@ nav footer a {
664
760
  cursor: pointer;
665
761
  transition: color var(--transition-fast);
666
762
  line-height: 1;
763
+ user-select: none;
764
+ -webkit-user-select: none;
667
765
  }
668
766
 
669
767
  #navigation-toggle:hover {
@@ -671,31 +769,153 @@ nav footer a {
671
769
  }
672
770
  }
673
771
 
674
- nav ul li details > summary {
675
- list-style: none; /* Remove the default marker */
676
- position: relative; /* So that the open/close triangle can position itself absolutely inside */
772
+ /*
773
+ * Shared Collapsible Animation using ::details-content pseudo-element.
774
+ * This is the modern CSS approach for animating <details> elements.
775
+ * Uses block-size animation with interpolate-size for smooth height transitions.
776
+ * Both nav-section-collapsible and nested link-list details share this pattern.
777
+ */
778
+ nav details {
779
+ interpolate-size: allow-keywords;
780
+ }
781
+
782
+ nav details::details-content {
783
+ overflow: hidden;
784
+ block-size: 0;
785
+ transition: block-size 200ms ease, content-visibility 200ms ease allow-discrete;
677
786
  }
678
787
 
679
- nav ul li details > summary::-webkit-details-marker {
680
- display: none; /* Removes the default marker, in Safari 18. */
788
+ nav details[open]::details-content {
789
+ block-size: auto;
681
790
  }
682
791
 
683
- nav ul li details > summary::after {
684
- content: '▶'; /* Unicode right-pointing triangle */
685
- position: absolute;
686
- font-size: 0.8em;
687
- bottom: 0.1em;
688
- margin-left: 0.3em;
792
+ /* Collapsible Navigation Section Headers */
793
+
794
+ nav .nav-section-header {
795
+ display: flex;
796
+ align-items: center;
797
+ gap: var(--space-3);
798
+ padding: var(--space-3) 0;
799
+ cursor: pointer;
800
+ list-style: none;
801
+ user-select: none;
802
+ -webkit-user-select: none;
803
+ border-bottom: 1px solid var(--color-border-default);
804
+ margin-bottom: var(--space-3);
805
+ transition: color var(--transition-fast);
806
+ }
807
+
808
+ nav .nav-section-header::-webkit-details-marker {
809
+ display: none;
810
+ }
811
+
812
+ nav .nav-section-header:hover {
813
+ color: var(--color-accent-primary);
814
+ }
815
+
816
+ nav .nav-section-icon {
817
+ display: flex;
818
+ align-items: center;
819
+ justify-content: center;
820
+ width: 1.25rem;
821
+ height: 1.25rem;
822
+ flex-shrink: 0;
823
+ color: var(--color-accent-primary);
824
+ }
825
+
826
+ nav .nav-section-icon svg {
827
+ width: 100%;
828
+ height: 100%;
829
+ }
830
+
831
+ nav .nav-section-title {
832
+ font-size: var(--font-size-base);
833
+ font-weight: var(--font-weight-semibold);
834
+ color: inherit;
835
+ flex: 1;
836
+ min-width: 0;
837
+ overflow: hidden;
838
+ text-overflow: ellipsis;
839
+ white-space: nowrap;
840
+ }
841
+
842
+ nav .nav-section-chevron {
843
+ display: flex;
844
+ align-items: center;
845
+ justify-content: center;
846
+ width: 1rem;
847
+ height: 1rem;
848
+ flex-shrink: 0;
849
+ color: var(--color-text-tertiary);
689
850
  transition: transform var(--transition-base);
690
851
  }
691
852
 
692
- nav ul li details[open] > summary::after {
693
- transform: rotate(90deg); /* Rotate the triangle when open */
853
+ nav .nav-section-chevron svg {
854
+ width: 100%;
855
+ height: 100%;
694
856
  }
695
857
 
696
- /* Global link hover state is defined after navigation to keep specificity ordering */
697
- a:hover {
698
- color: var(--color-link-hover);
858
+ /* Rotate chevron when open */
859
+ nav .nav-section-collapsible[open] > .nav-section-header .nav-section-chevron {
860
+ transform: rotate(90deg);
861
+ }
862
+
863
+ nav .nav-section-collapsible > ul,
864
+ nav .nav-section-collapsible > dl,
865
+ nav .nav-section-collapsible > p {
866
+ margin-top: 0;
867
+ }
868
+
869
+ nav .nav-section-collapsible > .nav-list {
870
+ padding-left: var(--space-5);
871
+ border-left: 1px solid var(--color-border-subtle);
872
+ margin-left: 9px; /* Align with the section icon center */
873
+ }
874
+
875
+ nav .nav-section-collapsible .nav-list .link-list {
876
+ border-left: none;
877
+ margin-left: 0;
878
+ padding-left: var(--space-5);
879
+ }
880
+
881
+ /*
882
+ Improve chevron styling for details under link-list, using SVG chevron that matches nav-section-chevron
883
+ We need to avoid adding the element in class content generation so it doesn't break darkfish styles
884
+ */
885
+ nav li details:has(.link-list) > summary {
886
+ display: inline-flex;
887
+ align-items: center;
888
+ gap: var(--space-2);
889
+ cursor: pointer;
890
+ }
891
+
892
+ nav li details:has(.link-list) > summary::after {
893
+ content: '';
894
+ position: static;
895
+ display: inline-block;
896
+ width: 1rem;
897
+ height: 1rem;
898
+ flex-shrink: 0;
899
+ margin-left: 0;
900
+ background-color: var(--color-text-secondary);
901
+ mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='currentColor' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='9 18 15 12 9 6'%3E%3C/polyline%3E%3C/svg%3E");
902
+ mask-size: contain;
903
+ mask-repeat: no-repeat;
904
+ mask-position: center;
905
+ -webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='currentColor' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='9 18 15 12 9 6'%3E%3C/polyline%3E%3C/svg%3E");
906
+ -webkit-mask-size: contain;
907
+ -webkit-mask-repeat: no-repeat;
908
+ -webkit-mask-position: center;
909
+ transition: transform var(--transition-base), background-color var(--transition-fast);
910
+ }
911
+
912
+ nav li details:has(.link-list) > summary:hover::after {
913
+ background-color: var(--color-accent-primary);
914
+ }
915
+
916
+ nav li details:has(.link-list)[open] > summary::after {
917
+ transform: rotate(90deg);
918
+ background-color: var(--color-accent-primary);
699
919
  }
700
920
 
701
921
  /* 8. Main Content (Center Column) */
@@ -995,17 +1215,54 @@ main .anchor-link:target {
995
1215
  main .method-source-code {
996
1216
  visibility: hidden;
997
1217
  max-height: 0;
998
- overflow: auto;
999
- transition: max-height var(--transition-base), visibility var(--transition-base);
1218
+ overflow: hidden;
1219
+ opacity: 0;
1220
+ transform: translateY(-8px);
1221
+ transition:
1222
+ max-height var(--duration-medium) var(--ease-out-smooth),
1223
+ visibility var(--duration-medium),
1224
+ opacity var(--duration-fast) ease-out,
1225
+ transform var(--duration-fast) ease-out;
1000
1226
  }
1001
1227
 
1002
1228
  main .method-source-code pre {
1003
1229
  border-color: var(--color-accent-hover);
1230
+ border-left: 3px solid var(--color-accent-primary);
1231
+ width: 100%;
1232
+ box-sizing: border-box;
1233
+ transition: border-color var(--transition-fast);
1234
+ scrollbar-width: thin;
1235
+ scrollbar-color: var(--color-border-default) transparent;
1236
+ }
1237
+
1238
+ main .method-source-code pre::-webkit-scrollbar {
1239
+ width: 6px;
1240
+ height: 6px;
1241
+ }
1242
+
1243
+ main .method-source-code pre::-webkit-scrollbar-track {
1244
+ background: transparent;
1245
+ }
1246
+
1247
+ main .method-source-code pre::-webkit-scrollbar-thumb {
1248
+ background: var(--color-border-default);
1249
+ border-radius: var(--radius-sm);
1250
+ }
1251
+
1252
+ main .method-source-code pre::-webkit-scrollbar-thumb:hover {
1253
+ background: var(--color-border-emphasis);
1254
+ }
1255
+
1256
+ main .method-source-code pre::-webkit-scrollbar-corner {
1257
+ background: transparent;
1004
1258
  }
1005
1259
 
1006
1260
  main .method-source-code.active-menu {
1007
1261
  visibility: visible;
1008
1262
  max-height: 100vh;
1263
+ overflow: auto;
1264
+ opacity: 1;
1265
+ transform: translateY(0);
1009
1266
  }
1010
1267
 
1011
1268
  main .method-description .method-calls-super {
@@ -1025,6 +1282,7 @@ main .method-detail:target {
1025
1282
 
1026
1283
  main .method-header {
1027
1284
  display: inline-block;
1285
+ max-width: calc(100% - 6em); /* 6em is the width of the source code toggle */
1028
1286
  }
1029
1287
 
1030
1288
  main .method-heading {
@@ -1044,10 +1302,47 @@ main .method-heading .method-args {
1044
1302
  }
1045
1303
 
1046
1304
  main .method-controls {
1047
- line-height: 20px;
1048
1305
  float: right;
1049
- color: var(--color-accent-hover);
1306
+ }
1307
+
1308
+ main .method-controls summary {
1309
+ display: inline-block;
1310
+ line-height: 20px;
1311
+ color: var(--color-accent-primary);
1050
1312
  cursor: pointer;
1313
+ padding: var(--space-1) var(--space-3);
1314
+ border-radius: var(--radius-sm);
1315
+ font-size: var(--font-size-sm);
1316
+ font-weight: var(--font-weight-medium);
1317
+ background: var(--color-accent-subtle);
1318
+ border: 1px solid transparent;
1319
+ transition:
1320
+ color var(--transition-fast),
1321
+ background var(--transition-fast),
1322
+ border-color var(--transition-fast),
1323
+ transform var(--transition-fast);
1324
+ user-select: none;
1325
+ -webkit-user-select: none;
1326
+ list-style: none;
1327
+ }
1328
+
1329
+ main .method-controls summary::-webkit-details-marker {
1330
+ display: none;
1331
+ }
1332
+
1333
+ main .method-controls summary:hover {
1334
+ background: var(--color-primary-100);
1335
+ border-color: var(--color-primary-300);
1336
+ transform: translateY(-1px);
1337
+ }
1338
+
1339
+ main .method-controls summary:active {
1340
+ transform: scale(0.96);
1341
+ }
1342
+
1343
+ [data-theme="dark"] main .method-controls summary:hover {
1344
+ background: var(--color-accent-subtle-hover);
1345
+ border-color: var(--color-primary-500);
1051
1346
  }
1052
1347
 
1053
1348
  main .method-description,
@@ -1316,6 +1611,14 @@ aside.table-of-contents .toc-sticky nav {
1316
1611
  height: auto;
1317
1612
  }
1318
1613
 
1614
+ aside.table-of-contents .toc-list > .toc-h2 {
1615
+ margin-left: var(--space-4);
1616
+ }
1617
+
1618
+ aside.table-of-contents .toc-list > .toc-h3 {
1619
+ margin-left: var(--space-8);
1620
+ }
1621
+
1319
1622
  /* Hide TOC on mobile/tablet */
1320
1623
  @media (width <= 1279px) {
1321
1624
  aside.table-of-contents {
@@ -1323,7 +1626,7 @@ aside.table-of-contents .toc-sticky nav {
1323
1626
  }
1324
1627
 
1325
1628
  body.has-toc {
1326
- grid-template-columns: minmax(var(--layout-sidebar-width-min), var(--layout-sidebar-width-max)) 1fr;
1629
+ grid-template-columns: var(--layout-sidebar-width) 1fr;
1327
1630
  grid-template-areas:
1328
1631
  "header header"
1329
1632
  "nav main"
@@ -1333,10 +1636,6 @@ aside.table-of-contents .toc-sticky nav {
1333
1636
 
1334
1637
  /* Tablet adjustments (between mobile and desktop) */
1335
1638
  @media (width >= 768px) and (width <= 1023px) {
1336
- nav {
1337
- width: 240px;
1338
- }
1339
-
1340
1639
  header.top-navbar {
1341
1640
  padding: 0 var(--space-6);
1342
1641
  }
@@ -1555,6 +1854,39 @@ footer.site-footer .footer-bottom:first-child {
1555
1854
  font-weight: bold;
1556
1855
  }
1557
1856
 
1857
+ #search-results .search-type {
1858
+ display: inline-block;
1859
+ margin-left: var(--space-2);
1860
+ padding: 0 var(--space-2);
1861
+ font-size: var(--font-size-xs);
1862
+ font-weight: 500;
1863
+ border-radius: var(--radius-sm);
1864
+ vertical-align: middle;
1865
+ background: var(--color-background-tertiary);
1866
+ color: var(--color-text-secondary);
1867
+ }
1868
+
1869
+ #search-results .search-type-class {
1870
+ background: var(--color-search-type-class-bg);
1871
+ color: var(--color-search-type-class-text);
1872
+ }
1873
+
1874
+ #search-results .search-type-module {
1875
+ background: var(--color-search-type-module-bg);
1876
+ color: var(--color-search-type-module-text);
1877
+ }
1878
+
1879
+ #search-results .search-type-constant {
1880
+ background: var(--color-search-type-constant-bg);
1881
+ color: var(--color-search-type-constant-text);
1882
+ }
1883
+
1884
+ #search-results .search-type-instance-method,
1885
+ #search-results .search-type-class-method {
1886
+ background: var(--color-search-type-method-bg);
1887
+ color: var(--color-search-type-method-text);
1888
+ }
1889
+
1558
1890
  #search-results li em {
1559
1891
  background-color: var(--color-search-highlight-bg);
1560
1892
  font-style: normal;
@@ -1,4 +1,5 @@
1
1
  <body role="document" class="file has-toc">
2
+ <%= render '_icons.rhtml' %>
2
3
  <%= render '_header.rhtml' %>
3
4
  <%= render '_sidebar_toggle.rhtml' %>
4
5
 
@@ -28,7 +28,7 @@ function createSearchInstance(input, result) {
28
28
 
29
29
  result.classList.remove("initially-hidden");
30
30
 
31
- const search = new Search(search_data, input, result);
31
+ const search = new SearchController(search_data, input, result);
32
32
 
33
33
  search.renderItem = function(result) {
34
34
  const li = document.createElement('li');
@@ -40,8 +40,12 @@ function createSearchInstance(input, result) {
40
40
  html += `<span class="params">${result.params}</span>`;
41
41
  html += '</a>';
42
42
 
43
- if (result.namespace)
44
- html += `<p class="search-namespace">${this.hlt(result.namespace)}`;
43
+ // Add type indicator
44
+ if (result.type) {
45
+ const typeLabel = this.formatType(result.type);
46
+ const typeClass = result.type.replace(/_/g, '-');
47
+ html += `<span class="search-type search-type-${this.escapeHTML(typeClass)}">${typeLabel}</span>`;
48
+ }
45
49
 
46
50
  if (result.snippet)
47
51
  html += `<div class="search-snippet">${result.snippet}</div>`;
@@ -51,6 +55,17 @@ function createSearchInstance(input, result) {
51
55
  return li;
52
56
  }
53
57
 
58
+ search.formatType = function(type) {
59
+ const typeLabels = {
60
+ 'class': 'class',
61
+ 'module': 'module',
62
+ 'constant': 'const',
63
+ 'instance_method': 'method',
64
+ 'class_method': 'method'
65
+ };
66
+ return typeLabels[type] || type;
67
+ }
68
+
54
69
  search.select = function(result) {
55
70
  let href = result.firstChild.firstChild.href;
56
71
  const query = this.input.value;
@@ -1,15 +1,15 @@
1
- Search = function(data, input, result) {
1
+ SearchController = function(data, input, result) {
2
2
  this.data = data;
3
3
  this.input = input;
4
4
  this.result = result;
5
5
 
6
6
  this.current = null;
7
7
  this.view = this.result.parentNode;
8
- this.searcher = new Searcher(data.index);
8
+ this.ranker = new SearchRanker(data.index);
9
9
  this.init();
10
10
  }
11
11
 
12
- Search.prototype = Object.assign({}, Navigation, new function() {
12
+ SearchController.prototype = Object.assign({}, SearchNavigation, new function() {
13
13
  var suid = 1;
14
14
 
15
15
  this.init = function() {
@@ -25,7 +25,7 @@ Search.prototype = Object.assign({}, Navigation, new function() {
25
25
  this.input.addEventListener('keyup', observer);
26
26
  this.input.addEventListener('click', observer); // mac's clear field
27
27
 
28
- this.searcher.ready(function(results, isLast) {
28
+ this.ranker.ready(function(results, isLast) {
29
29
  _this.addResults(results, isLast);
30
30
  })
31
31
 
@@ -36,7 +36,7 @@ Search.prototype = Object.assign({}, Navigation, new function() {
36
36
  this.search = function(value, selectFirstMatch) {
37
37
  this.selectFirstMatch = selectFirstMatch;
38
38
 
39
- value = value.trim().toLowerCase();
39
+ value = value.trim();
40
40
  if (value) {
41
41
  this.setNavigationActive(true);
42
42
  } else {
@@ -53,7 +53,7 @@ Search.prototype = Object.assign({}, Navigation, new function() {
53
53
  this.result.setAttribute('aria-busy', 'true');
54
54
  this.result.setAttribute('aria-expanded', 'true');
55
55
  this.firstRun = true;
56
- this.searcher.find(value);
56
+ this.ranker.find(value);
57
57
  }
58
58
  }
59
59