rdoc 7.0.0 → 7.0.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: '09f66eb1c281e4323e70183c119a58a9c97c8fef86ba4f1ae42691d614a484be'
4
- data.tar.gz: eb7605a8633beab318d2bc9ee4fb66c420397a3ab48bdd5ef8c9d4c533c12ffc
3
+ metadata.gz: 4f5632459a5400e7f62d6f4875c8600a78649d0f3e2d79437eecbae45b0b5041
4
+ data.tar.gz: 8e81da45966c3ca65f53b0b43b38b933e532dc20d0788ae0b170bd8faf2edfe1
5
5
  SHA512:
6
- metadata.gz: 722cd4f102ad66df12a9db58c4807545a1d489090f7e82b9d3b84422a82975c7e20dc32c263fd6ae1c5c5421e9d65a599e1dce70431dc963991292bf328f0990
7
- data.tar.gz: 328b307c3ae2fd5057e40afa1f0e72da247f455aab4427698f15d51606aa469097f4816a607a518087f8284270822d8de9b30af86720c87011e1cc78b25121b0
6
+ metadata.gz: b0f95f6fdafee7c024137947be2297a5db3c9ee14cbf7b5c4d5bc26157dbe5adb58ba8f8877ea3b5bf951e3276fd9a45c85b6b169b1c76cbcfd7c61b9a7697cf
7
+ data.tar.gz: f010caf60fc595404dd240e23bdfeddcc5cd0a626725a608d1c5107adb63bb4cda834d6b89f1c27772003dbec4fcfc3202ebd4103b4e180262c99faa499be9fb
@@ -1,5 +1,7 @@
1
1
  # frozen_string_literal: true
2
2
 
3
+ require 'uri'
4
+
3
5
  ##
4
6
  # Aliki theme for RDoc documentation
5
7
  #
@@ -115,6 +117,21 @@ class RDoc::Generator::Aliki < RDoc::Generator::Darkfish
115
117
  File.write search_index_path, "var search_data = #{JSON.generate(data)};"
116
118
  end
117
119
 
120
+ ##
121
+ # Resolves a URL for use in templates. Absolute URLs are returned unchanged.
122
+ # Relative URLs are prefixed with rel_prefix to ensure they resolve correctly from any page.
123
+
124
+ def resolve_url(rel_prefix, url)
125
+ uri = URI.parse(url)
126
+ if uri.absolute?
127
+ url
128
+ else
129
+ "#{rel_prefix}/#{url}"
130
+ end
131
+ rescue URI::InvalidURIError
132
+ "#{rel_prefix}/#{url}"
133
+ end
134
+
118
135
  private
119
136
 
120
137
  def build_class_module_entry(klass)
@@ -6,7 +6,7 @@
6
6
  <h3><%= h column_title %></h3>
7
7
  <ul>
8
8
  <% links.each do |text, url| %>
9
- <li><a href="<%= h url %>"><%= h text %></a></li>
9
+ <li><a href="<%= h resolve_url(rel_prefix, url) %>"><%= h text %></a></li>
10
10
  <% end %>
11
11
  </ul>
12
12
  </div>
@@ -7,13 +7,13 @@
7
7
  <div class="navbar-search navbar-search-desktop" role="search">
8
8
  <form action="#" method="get" accept-charset="utf-8">
9
9
  <input id="search-field" role="combobox" aria-label="Search"
10
- aria-autocomplete="list" aria-controls="search-results"
10
+ aria-autocomplete="list" aria-controls="search-results-desktop"
11
11
  type="text" name="search" placeholder="Search (/) for a class, method..."
12
12
  spellcheck="false" autocomplete="off"
13
13
  title="Type to search, Up and Down to navigate, Enter to load">
14
- <ul id="search-results" aria-label="Search Results"
14
+ <ul id="search-results-desktop" aria-label="Search Results"
15
15
  aria-busy="false" aria-expanded="false"
16
- aria-atomic="false" class="initially-hidden"></ul>
16
+ aria-atomic="false" class="initially-hidden search-results"></ul>
17
17
  </form>
18
18
  </div>
19
19
 
@@ -47,7 +47,7 @@
47
47
  <div class="search-modal-body">
48
48
  <ul id="search-results-mobile" aria-label="Search Results"
49
49
  aria-busy="false" aria-expanded="false"
50
- aria-atomic="false" class="search-modal-results initially-hidden"></ul>
50
+ aria-atomic="false" class="search-results search-modal-results initially-hidden"></ul>
51
51
  <div class="search-modal-empty">
52
52
  <p>No recent searches</p>
53
53
  </div>
@@ -2,14 +2,14 @@
2
2
  <form action="#" method="get" accept-charset="utf-8">
3
3
  <div id="search-field-wrapper">
4
4
  <input id="search-field" role="combobox" aria-label="Search"
5
- aria-autocomplete="list" aria-controls="search-results"
5
+ aria-autocomplete="list" aria-controls="search-results-desktop"
6
6
  type="text" name="search" placeholder="Search (/) for a class, method, ..." spellcheck="false"
7
7
  autocomplete="off"
8
8
  title="Type to search, Up and Down to navigate, Enter to load">
9
9
  </div>
10
10
 
11
- <ul id="search-results" aria-label="Search Results"
11
+ <ul id="search-results-desktop" aria-label="Search Results"
12
12
  aria-busy="false" aria-expanded="false"
13
- aria-atomic="false" class="initially-hidden"></ul>
13
+ aria-atomic="false" class="initially-hidden search-results"></ul>
14
14
  </form>
15
15
  </div>
@@ -1811,50 +1811,50 @@ footer.site-footer .footer-bottom:first-child {
1811
1811
  }
1812
1812
 
1813
1813
  /* Search Results */
1814
- #search-results {
1814
+ .search-results {
1815
1815
  font-family: var(--font-primary);
1816
1816
  font-weight: 300;
1817
1817
  }
1818
1818
 
1819
- #search-results a {
1819
+ .search-results a {
1820
1820
  color: var(--color-text-primary);
1821
1821
  }
1822
1822
 
1823
- #search-results a:hover {
1823
+ .search-results a:hover {
1824
1824
  color: var(--color-accent-primary);
1825
1825
  }
1826
1826
 
1827
- #search-results .search-match {
1827
+ .search-results .search-match {
1828
1828
  font-family: var(--font-heading);
1829
1829
  font-weight: normal;
1830
1830
  }
1831
1831
 
1832
- #search-results .search-selected {
1832
+ .search-results .search-selected {
1833
1833
  background: var(--color-code-bg);
1834
1834
  border-bottom: 1px solid transparent;
1835
1835
  }
1836
1836
 
1837
- #search-results li {
1837
+ .search-results li {
1838
1838
  list-style: none;
1839
1839
  border-bottom: 1px solid var(--color-border-default);
1840
1840
  margin-bottom: 0.5em;
1841
1841
  }
1842
1842
 
1843
- #search-results li:last-child {
1843
+ .search-results li:last-child {
1844
1844
  border-bottom: none;
1845
1845
  margin-bottom: 0;
1846
1846
  }
1847
1847
 
1848
- #search-results li p {
1848
+ .search-results li p {
1849
1849
  padding: 0;
1850
1850
  margin: 0.5em;
1851
1851
  }
1852
1852
 
1853
- #search-results .search-namespace {
1853
+ .search-results .search-namespace {
1854
1854
  font-weight: bold;
1855
1855
  }
1856
1856
 
1857
- #search-results .search-type {
1857
+ .search-results .search-type {
1858
1858
  display: inline-block;
1859
1859
  margin-left: var(--space-2);
1860
1860
  padding: 0 var(--space-2);
@@ -1866,33 +1866,33 @@ footer.site-footer .footer-bottom:first-child {
1866
1866
  color: var(--color-text-secondary);
1867
1867
  }
1868
1868
 
1869
- #search-results .search-type-class {
1869
+ .search-results .search-type-class {
1870
1870
  background: var(--color-search-type-class-bg);
1871
1871
  color: var(--color-search-type-class-text);
1872
1872
  }
1873
1873
 
1874
- #search-results .search-type-module {
1874
+ .search-results .search-type-module {
1875
1875
  background: var(--color-search-type-module-bg);
1876
1876
  color: var(--color-search-type-module-text);
1877
1877
  }
1878
1878
 
1879
- #search-results .search-type-constant {
1879
+ .search-results .search-type-constant {
1880
1880
  background: var(--color-search-type-constant-bg);
1881
1881
  color: var(--color-search-type-constant-text);
1882
1882
  }
1883
1883
 
1884
- #search-results .search-type-instance-method,
1885
- #search-results .search-type-class-method {
1884
+ .search-results .search-type-instance-method,
1885
+ .search-results .search-type-class-method {
1886
1886
  background: var(--color-search-type-method-bg);
1887
1887
  color: var(--color-search-type-method-text);
1888
1888
  }
1889
1889
 
1890
- #search-results li em {
1890
+ .search-results li em {
1891
1891
  background-color: var(--color-search-highlight-bg);
1892
1892
  font-style: normal;
1893
1893
  }
1894
1894
 
1895
- #search-results pre {
1895
+ .search-results pre {
1896
1896
  margin: 0.5em;
1897
1897
  font-family: var(--font-code);
1898
1898
  }
@@ -1919,7 +1919,7 @@ header.top-navbar #search-field::placeholder {
1919
1919
  }
1920
1920
 
1921
1921
  /* Search results dropdown in navbar */
1922
- header.top-navbar #search-results {
1922
+ header.top-navbar #search-results-desktop {
1923
1923
  position: absolute;
1924
1924
  top: calc(100% + var(--space-2));
1925
1925
  left: 0;
@@ -1935,10 +1935,10 @@ header.top-navbar #search-results {
1935
1935
  padding: 0;
1936
1936
  }
1937
1937
 
1938
- header.top-navbar #search-results.initially-hidden {
1938
+ header.top-navbar #search-results-desktop.initially-hidden {
1939
1939
  display: none;
1940
1940
  }
1941
1941
 
1942
- header.top-navbar #search-results[aria-expanded="false"] {
1942
+ header.top-navbar #search-results-desktop[aria-expanded="false"] {
1943
1943
  display: none;
1944
1944
  }
@@ -85,7 +85,7 @@ function createSearchInstance(input, result) {
85
85
 
86
86
  function hookSearch() {
87
87
  const input = document.querySelector('#search-field');
88
- const result = document.querySelector('#search-results');
88
+ const result = document.querySelector('#search-results-desktop');
89
89
 
90
90
  if (!input || !result) return; // Exit if search elements not found
91
91
 
data/lib/rdoc/version.rb CHANGED
@@ -5,6 +5,6 @@ module RDoc
5
5
  ##
6
6
  # RDoc version you are using
7
7
 
8
- VERSION = '7.0.0'
8
+ VERSION = '7.0.1'
9
9
 
10
10
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: rdoc
3
3
  version: !ruby/object:Gem::Version
4
- version: 7.0.0
4
+ version: 7.0.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Eric Hodel