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.
- checksums.yaml +4 -4
- data/CHANGELOG.md +24 -0
- data/README.md +85 -0
- data/TROUBLESHOOTING.md +57 -0
- data/app/controllers/docit/ui_controller.rb +1 -35
- data/config/routes.rb +0 -1
- data/docs/images/scalar_image.png +0 -0
- data/docs/images/swagger_image.png +0 -0
- data/lib/docit/ai/autodoc_runner.rb +9 -4
- data/lib/docit/ai/doc_writer.rb +3 -3
- data/lib/docit/ai/groq_client.rb +4 -8
- data/lib/docit/ai/scaffold_generator.rb +3 -1
- data/lib/docit/ai/tag_injector.rb +1 -1
- data/lib/docit/ai.rb +0 -1
- data/lib/docit/builders/response_builder.rb +12 -2
- data/lib/docit/configuration.rb +13 -3
- data/lib/docit/schema_generator.rb +62 -32
- data/lib/docit/system_graph/rails_analyzer.rb +31 -4
- data/lib/docit/system_graph/source_scanner.rb +2 -3
- data/lib/docit/ui/assets/system.css +554 -0
- data/lib/docit/ui/assets/system.js +1393 -0
- data/lib/docit/ui/base_renderer.rb +12 -17
- data/lib/docit/ui/system_renderer.rb +3 -2
- data/lib/docit/ui/system_script.rb +21 -1480
- data/lib/docit/ui/system_styles.rb +5 -571
- data/lib/docit/version.rb +1 -1
- metadata +6 -2
- data/lib/docit/ai/system_insight_generator.rb +0 -127
|
@@ -3,12 +3,11 @@
|
|
|
3
3
|
module Docit
|
|
4
4
|
module UI
|
|
5
5
|
class BaseRenderer
|
|
6
|
-
attr_reader :spec_url, :system_url, :
|
|
6
|
+
attr_reader :spec_url, :system_url, :title, :nav_paths
|
|
7
7
|
|
|
8
|
-
def initialize(spec_url:, system_url: nil,
|
|
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 #{
|
|
58
|
-
<a href="#{ERB::Util.html_escape(nav_paths[:scalar])}" class="docit-nav-link #{
|
|
59
|
-
<a href="#{ERB::Util.html_escape(nav_paths[:system])}" class="docit-nav-link #{
|
|
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
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
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
|
|
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.
|
|
106
|
+
<script>#{SystemScript.config_script(graph_url: system_url)}</script>
|
|
107
|
+
<script>#{SystemScript.javascript}</script>
|
|
107
108
|
</body>
|
|
108
109
|
</html>
|
|
109
110
|
HTML
|