docit 0.5.0 → 0.7.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.
@@ -3,12 +3,11 @@
3
3
  module Docit
4
4
  module UI
5
5
  class BaseRenderer
6
- attr_reader :spec_url, :system_url, :system_insights_url, :title, :nav_paths
6
+ attr_reader :spec_url, :system_url, :title, :nav_paths
7
7
 
8
- def initialize(spec_url:, system_url: nil, system_insights_url: nil, nav_paths: {})
8
+ def initialize(spec_url:, system_url: nil, nav_paths: {})
9
9
  @spec_url = spec_url
10
10
  @system_url = system_url
11
- @system_insights_url = system_insights_url
12
11
  @nav_paths = nav_paths
13
12
  @title = ERB::Util.html_escape(Docit.configuration.title)
14
13
  end
@@ -54,9 +53,9 @@ module Docit
54
53
  </style>
55
54
  <nav class="docit-nav">
56
55
  <span style="font-weight: 600; margin-right: auto;">#{title}</span>
57
- <a href="#{ERB::Util.html_escape(nav_paths[:swagger])}" class="docit-nav-link #{'active' if swagger_active}">Swagger</a>
58
- <a href="#{ERB::Util.html_escape(nav_paths[:scalar])}" class="docit-nav-link #{'active' if scalar_active}">Scalar</a>
59
- <a href="#{ERB::Util.html_escape(nav_paths[:system])}" class="docit-nav-link #{'active' if system_active}">System</a>
56
+ <a href="#{ERB::Util.html_escape(nav_paths[:swagger])}" class="docit-nav-link #{"active" if swagger_active}">Swagger</a>
57
+ <a href="#{ERB::Util.html_escape(nav_paths[:scalar])}" class="docit-nav-link #{"active" if scalar_active}">Scalar</a>
58
+ <a href="#{ERB::Util.html_escape(nav_paths[:system])}" class="docit-nav-link #{"active" if system_active}">System</a>
60
59
  </nav>
61
60
  HTML
62
61
  end
@@ -69,19 +68,15 @@ module Docit
69
68
  json_escape(JSON.generate(system_url))
70
69
  end
71
70
 
72
- def system_insights_url_json
73
- json_escape(JSON.generate(system_insights_url))
74
- end
75
-
76
71
  def json_escape(json_string)
77
72
  json_string.to_s.gsub(/[&<>'\u2028\u2029]/, {
78
- '&' => '\u0026',
79
- '<' => '\u003c',
80
- '>' => '\u003e',
81
- "'" => '\u0027',
82
- "\u2028" => '\u2028',
83
- "\u2029" => '\u2029'
84
- })
73
+ "&" => '\u0026',
74
+ "<" => '\u003c',
75
+ ">" => '\u003e',
76
+ "'" => '\u0027',
77
+ "\u2028" => '\u2028',
78
+ "\u2029" => '\u2029'
79
+ })
85
80
  end
86
81
  end
87
82
  end
@@ -94,7 +94,7 @@ module Docit
94
94
  <div class="stripe-detail-empty-icon" aria-hidden="true">
95
95
  <svg width="26" height="26" viewBox="0 0 16 16" fill="none" stroke="currentColor" stroke-width="1.2" stroke-linecap="round" stroke-linejoin="round"><path d="M3 1.5h6L13 5v9.5H3z"/><path d="M9 1.5V5h4"/><path d="M5.5 8.5h5M5.5 11h3"/></svg>
96
96
  </div>
97
- <p>Select an endpoint to see how to call it, or use <strong>Explain section</strong> for an AI overview.</p>
97
+ <p>Select an endpoint to see how to call it.</p>
98
98
  </div>
99
99
  </div>
100
100
  </aside>
@@ -103,7 +103,8 @@ module Docit
103
103
  </div>
104
104
  </div>
105
105
  <div id="toast" class="toast" role="status"></div>
106
- <script>#{SystemScript.javascript(graph_url: system_url, insights_url: system_insights_url)}</script>
106
+ <script>#{SystemScript.config_script(graph_url: system_url)}</script>
107
+ <script>#{SystemScript.javascript}</script>
107
108
  </body>
108
109
  </html>
109
110
  HTML