drf-to-mkdoc 0.1.5__py3-none-any.whl → 1.0.7__py3-none-any.whl

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.

Potentially problematic release.


This version of drf-to-mkdoc might be problematic. Click here for more details.

Files changed (34) hide show
  1. drf_to_mkdoc/__init__.py +1 -1
  2. drf_to_mkdoc/apps.py +6 -2
  3. drf_to_mkdoc/conf/defaults.py +0 -1
  4. drf_to_mkdoc/conf/settings.py +8 -5
  5. drf_to_mkdoc/management/commands/build_docs.py +61 -20
  6. drf_to_mkdoc/management/commands/generate_docs.py +1 -2
  7. drf_to_mkdoc/management/commands/generate_model_docs.py +37 -7
  8. drf_to_mkdoc/static/drf-to-mkdoc/javascripts/endpoints-filter.js +189 -0
  9. drf_to_mkdoc/static/drf-to-mkdoc/stylesheets/endpoints/accessibility.css +21 -0
  10. drf_to_mkdoc/static/drf-to-mkdoc/stylesheets/endpoints/animations.css +11 -0
  11. drf_to_mkdoc/static/drf-to-mkdoc/stylesheets/endpoints/badges.css +54 -0
  12. drf_to_mkdoc/static/drf-to-mkdoc/stylesheets/endpoints/base.css +15 -0
  13. drf_to_mkdoc/static/drf-to-mkdoc/stylesheets/endpoints/endpoint-content.css +48 -0
  14. drf_to_mkdoc/static/drf-to-mkdoc/stylesheets/endpoints/endpoints-grid.css +75 -0
  15. drf_to_mkdoc/static/drf-to-mkdoc/stylesheets/endpoints/filter-section.css +209 -0
  16. drf_to_mkdoc/static/drf-to-mkdoc/stylesheets/endpoints/fixes.css +44 -0
  17. drf_to_mkdoc/static/drf-to-mkdoc/stylesheets/endpoints/layout.css +31 -0
  18. drf_to_mkdoc/static/drf-to-mkdoc/stylesheets/endpoints/loading.css +35 -0
  19. drf_to_mkdoc/static/drf-to-mkdoc/stylesheets/endpoints/responsive.css +89 -0
  20. drf_to_mkdoc/static/drf-to-mkdoc/stylesheets/endpoints/sections.css +35 -0
  21. drf_to_mkdoc/static/drf-to-mkdoc/stylesheets/endpoints/stats.css +34 -0
  22. drf_to_mkdoc/static/drf-to-mkdoc/stylesheets/endpoints/tags.css +92 -0
  23. drf_to_mkdoc/static/drf-to-mkdoc/stylesheets/endpoints/theme-toggle.css +30 -0
  24. drf_to_mkdoc/static/drf-to-mkdoc/stylesheets/endpoints/variables.css +30 -0
  25. drf_to_mkdoc/static/drf-to-mkdoc/stylesheets/extra.css +358 -0
  26. drf_to_mkdoc/utils/common.py +31 -26
  27. drf_to_mkdoc/utils/endpoint_generator.py +130 -131
  28. drf_to_mkdoc/utils/extractors/query_parameter_extractors.py +7 -7
  29. {drf_to_mkdoc-0.1.5.dist-info → drf_to_mkdoc-1.0.7.dist-info}/METADATA +1 -1
  30. drf_to_mkdoc-1.0.7.dist-info/RECORD +43 -0
  31. drf_to_mkdoc-0.1.5.dist-info/RECORD +0 -25
  32. {drf_to_mkdoc-0.1.5.dist-info → drf_to_mkdoc-1.0.7.dist-info}/WHEEL +0 -0
  33. {drf_to_mkdoc-0.1.5.dist-info → drf_to_mkdoc-1.0.7.dist-info}/licenses/LICENSE +0 -0
  34. {drf_to_mkdoc-0.1.5.dist-info → drf_to_mkdoc-1.0.7.dist-info}/top_level.txt +0 -0
drf_to_mkdoc/__init__.py CHANGED
@@ -4,4 +4,4 @@ DRF to MkDocs - Generate Markdown API docs from Django/DRF OpenAPI schema for Mk
4
4
 
5
5
  __version__ = "0.1.0"
6
6
  __author__ = "ShayestehHs"
7
- __email__ = "shayestehhs1@gmail.com"
7
+ __email__ = "shayestehhs1@gmail.com"
drf_to_mkdoc/apps.py CHANGED
@@ -1,15 +1,19 @@
1
+ import logging
2
+
1
3
  from django.apps import AppConfig
2
4
 
5
+ logger = logging.getLogger()
6
+
3
7
 
4
8
  class DrfToMkdocConfig(AppConfig):
5
9
  default_auto_field = "django.db.models.BigAutoField"
6
10
  name = "drf_to_mkdoc"
7
11
  verbose_name = "DRF to MkDocs Documentation Generator"
8
-
12
+
9
13
  def ready(self):
10
14
  """Initialize the app when Django starts."""
11
15
  # Import management commands to register them
12
16
  try:
13
17
  import drf_to_mkdoc.management.commands # noqa
14
18
  except ImportError:
15
- pass
19
+ logger.exception("Failed to import drf_to_mkdoc commands")
@@ -5,7 +5,6 @@ DEFAULTS = {
5
5
  "MODEL_DOCS_FILE": "docs/model-docs.json", # Path to model documentation JSON file
6
6
  "DOC_CONFIG_FILE": "docs/configs/doc_config.json", # Path to documentation configuration file
7
7
  "CUSTOM_SCHEMA_FILE": "docs/configs/custom_schema.json", # Path to custom schema file
8
-
9
8
  # Django apps - required, no default
10
9
  "DJANGO_APPS": None, # List of Django app names to process
11
10
  }
@@ -1,6 +1,8 @@
1
1
  from django.conf import settings
2
+
2
3
  from drf_to_mkdoc.conf.defaults import DEFAULTS
3
4
 
5
+
4
6
  class DRFToMkDocSettings:
5
7
  required_settings = ["DJANGO_APPS"]
6
8
 
@@ -12,15 +14,15 @@ class DRFToMkDocSettings:
12
14
  def get(self, key):
13
15
  if key not in self.defaults:
14
16
  raise AttributeError(f"Invalid DRF_TO_MKDOC setting: '{key}'")
15
-
17
+
16
18
  value = self._user_settings.get(key, self.defaults[key])
17
-
19
+
18
20
  if value is None and key in self.required_settings:
19
21
  raise ValueError(
20
22
  f"DRF_TO_MKDOC setting '{key}' is required but not configured. "
21
23
  f"Please add it to your Django settings under {self.user_settings_key}."
22
24
  )
23
-
25
+
24
26
  return value
25
27
 
26
28
  def __getattr__(self, key):
@@ -28,17 +30,18 @@ class DRFToMkDocSettings:
28
30
 
29
31
  def validate_required_settings(self):
30
32
  missing_settings = []
31
-
33
+
32
34
  for setting in self.required_settings:
33
35
  try:
34
36
  self.get(setting)
35
37
  except ValueError:
36
38
  missing_settings.append(setting)
37
-
39
+
38
40
  if missing_settings:
39
41
  raise ValueError(
40
42
  f"Missing required settings: {', '.join(missing_settings)}. "
41
43
  f"Please configure these in your Django settings under {self.user_settings_key}."
42
44
  )
43
45
 
46
+
44
47
  drf_to_mkdoc_settings = DRFToMkDocSettings(defaults=DEFAULTS)
@@ -1,11 +1,12 @@
1
+ import shutil
1
2
  import subprocess
2
3
  from pathlib import Path
3
4
 
4
- from django.conf import settings
5
- from django.core.management.base import BaseCommand, CommandError
6
5
  from django.apps import apps
7
- from drf_to_mkdoc.conf.settings import drf_to_mkdoc_settings
6
+ from django.conf import settings
8
7
  from django.core.management import call_command
8
+ from django.core.management.base import BaseCommand, CommandError
9
+ from your_app import drf_to_mkdoc_settings # Replace with your actual import
9
10
 
10
11
 
11
12
  class Command(BaseCommand):
@@ -18,13 +19,13 @@ class Command(BaseCommand):
18
19
  try:
19
20
  apps.check_apps_ready()
20
21
  except Exception as e:
21
- raise CommandError(f"Django apps not properly configured: {e}")
22
+ raise CommandError(f"Django apps not properly configured: {e}") from e
22
23
 
23
24
  base_dir = Path(settings.BASE_DIR)
24
25
  site_dir = base_dir / "site"
25
26
  mkdocs_config = base_dir / "mkdocs.yml"
26
27
  mkdocs_config_alt = base_dir / "mkdocs.yaml"
27
-
28
+
28
29
  if not mkdocs_config.exists() and not mkdocs_config_alt.exists():
29
30
  raise CommandError(
30
31
  "MkDocs configuration file not found. Please create either 'mkdocs.yml' or 'mkdocs.yaml' "
@@ -34,10 +35,7 @@ class Command(BaseCommand):
34
35
  try:
35
36
  # Generate the model documentation JSON first
36
37
  self.stdout.write("Generating model documentation...")
37
-
38
- call_command(
39
- "generate_model_docs", "--pretty"
40
- )
38
+ call_command("generate_model_docs", "--pretty")
41
39
  self.stdout.write(self.style.SUCCESS("Model documentation generated."))
42
40
 
43
41
  # Generate the documentation content
@@ -47,17 +45,7 @@ class Command(BaseCommand):
47
45
 
48
46
  # Build the MkDocs site
49
47
  self.stdout.write("Building MkDocs site...")
50
- result = subprocess.run(
51
- ["mkdocs", "build", "--clean"],
52
- check=False,
53
- cwd=base_dir,
54
- capture_output=True,
55
- text=True,
56
- )
57
-
58
- if result.returncode != 0:
59
- raise CommandError(f"MkDocs build failed: {result.stderr}")
60
-
48
+ self._build_mkdocs_site(base_dir, site_dir)
61
49
  self.stdout.write(self.style.SUCCESS("Documentation built successfully!"))
62
50
  self.stdout.write(f"Site built in: {site_dir}")
63
51
 
@@ -65,3 +53,56 @@ class Command(BaseCommand):
65
53
  raise CommandError(
66
54
  "MkDocs not found. Please install it with: pip install mkdocs mkdocs-material"
67
55
  ) from e
56
+
57
+ def _build_mkdocs_site(self, base_dir: Path, site_dir: Path) -> None:
58
+ """
59
+ Build the MkDocs site with proper security checks.
60
+
61
+ Args:
62
+ base_dir: The base directory of the Django project
63
+ site_dir: The directory where the site will be built
64
+
65
+ Raises:
66
+ FileNotFoundError: If mkdocs executable is not found
67
+ CommandError: If the build process fails
68
+ """
69
+ mkdocs_path = shutil.which("mkdocs")
70
+ if not mkdocs_path:
71
+ raise FileNotFoundError("mkdocs executable not found in PATH")
72
+
73
+ mkdocs_path_obj = Path(mkdocs_path)
74
+ if not mkdocs_path_obj.exists() or not mkdocs_path_obj.is_file():
75
+ raise CommandError(f"Invalid mkdocs executable path: {mkdocs_path}")
76
+
77
+ if not base_dir.is_absolute():
78
+ base_dir = base_dir.resolve()
79
+
80
+ if not base_dir.exists():
81
+ raise CommandError(f"Base directory does not exist: {base_dir}")
82
+
83
+ cmd = [
84
+ str(mkdocs_path_obj), # Convert to string for subprocess
85
+ "build",
86
+ "--clean",
87
+ ]
88
+
89
+ try:
90
+ result = subprocess.run( # noqa S603
91
+ cmd,
92
+ check=True,
93
+ cwd=str(base_dir),
94
+ capture_output=True,
95
+ text=True,
96
+ timeout=300,
97
+ )
98
+
99
+ if result.stdout:
100
+ self.stdout.write(f"MkDocs output: {result.stdout}")
101
+
102
+ except subprocess.TimeoutExpired as e:
103
+ raise CommandError("MkDocs build timed out after 5 minutes") from e
104
+ except subprocess.CalledProcessError as e:
105
+ error_msg = f"MkDocs build failed (exit code {e.returncode})"
106
+ if e.stderr:
107
+ error_msg += f": {e.stderr}"
108
+ raise CommandError(error_msg) from e
@@ -4,6 +4,7 @@ from pathlib import Path
4
4
 
5
5
  from django.core.management.base import BaseCommand
6
6
 
7
+ from drf_to_mkdoc.conf.settings import drf_to_mkdoc_settings
7
8
  from drf_to_mkdoc.utils.common import get_schema, load_model_json_data
8
9
  from drf_to_mkdoc.utils.endpoint_generator import (
9
10
  create_endpoints_index,
@@ -11,8 +12,6 @@ from drf_to_mkdoc.utils.endpoint_generator import (
11
12
  parse_endpoints_from_schema,
12
13
  )
13
14
  from drf_to_mkdoc.utils.model_generator import create_models_index, generate_model_docs
14
- from drf_to_mkdoc.conf.settings import drf_to_mkdoc_settings
15
-
16
15
 
17
16
 
18
17
  class Command(BaseCommand):
@@ -9,6 +9,7 @@ from django.db import models
9
9
 
10
10
  from drf_to_mkdoc.conf.settings import drf_to_mkdoc_settings
11
11
 
12
+
12
13
  class Command(BaseCommand):
13
14
  help = "Generate model documentation JSON from Django model introspection"
14
15
 
@@ -139,21 +140,50 @@ class Command(BaseCommand):
139
140
 
140
141
  def introspect_relationship(self, field):
141
142
  """Introspect relationship fields"""
142
- return {
143
+ # Safely resolve related model label; can be None for generic relations
144
+ related_model_label = None
145
+ try:
146
+ if getattr(field, "related_model", None) is not None:
147
+ related_model_label = (
148
+ f"{field.related_model._meta.app_label}.{field.related_model.__name__}"
149
+ )
150
+ except Exception:
151
+ related_model_label = None
152
+
153
+ relationship_data = {
143
154
  "name": field.name,
144
155
  "type": field.__class__.__name__,
145
- "related_model": f"{field.related_model._meta.app_label}."
146
- f"{field.related_model.__name__}",
156
+ "related_model": related_model_label,
147
157
  "related_name": getattr(field, "related_name", None),
148
158
  "on_delete": self.get_on_delete_name(field),
149
159
  "null": getattr(field, "null", False),
150
160
  "blank": getattr(field, "blank", False),
151
- "many_to_many": field.many_to_many,
152
- "one_to_many": field.one_to_many,
153
- "many_to_one": field.many_to_one,
154
- "one_to_one": field.one_to_one,
161
+ "many_to_many": getattr(field, "many_to_many", False),
162
+ "one_to_many": getattr(field, "one_to_many", False),
163
+ "many_to_one": getattr(field, "many_to_one", False),
164
+ "one_to_one": getattr(field, "one_to_one", False),
155
165
  }
156
166
 
167
+ # Handle Django generic relations where related_model can be None
168
+ field_class_name = field.__class__.__name__
169
+ if field_class_name in ("GenericForeignKey", "GenericRelation"):
170
+ relationship_data["is_generic"] = True
171
+ # Capture common generic relation details when available
172
+ for attr_name in (
173
+ "ct_field",
174
+ "fk_field",
175
+ "object_id_field",
176
+ "content_type_field",
177
+ "for_concrete_model",
178
+ "related_query_name",
179
+ ):
180
+ if hasattr(field, attr_name):
181
+ relationship_data[attr_name] = getattr(field, attr_name)
182
+ else:
183
+ relationship_data["is_generic"] = False
184
+
185
+ return relationship_data
186
+
157
187
  def get_on_delete_name(self, field):
158
188
  """Get readable name for on_delete option"""
159
189
  if not hasattr(field, "on_delete") or field.on_delete is None:
@@ -0,0 +1,189 @@
1
+ let currentFilters = {
2
+ method: '',
3
+ path: '',
4
+ models: '',
5
+ auth: '',
6
+ roles: '',
7
+ contentType: '',
8
+ params: '',
9
+ schema: '',
10
+ pagination: '',
11
+ tags: '',
12
+ app: '',
13
+ ordering: '',
14
+ search: ''
15
+ };
16
+
17
+ function applyFilters() {
18
+ // Read all filters
19
+ currentFilters = {
20
+ method: getValue('filter-method'),
21
+ path: getValue('filter-path'),
22
+ models: getValue('filter-models'),
23
+ auth: getValue('filter-auth'),
24
+ roles: getValue('filter-roles'),
25
+ contentType: getValue('filter-content-type'),
26
+ params: getValue('filter-params'),
27
+ schema: getValue('filter-schema'),
28
+ pagination: getValue('filter-pagination'),
29
+ tags: getValue('filter-tags'),
30
+ app: getValue('filter-app'),
31
+ ordering: getValue('filter-ordering'),
32
+ search: getValue('filter-search'),
33
+ };
34
+
35
+ updateURLParams(currentFilters);
36
+
37
+ const cards = document.querySelectorAll('.endpoint-card');
38
+ let visibleCount = 0;
39
+
40
+ cards.forEach(card => {
41
+ const visible = matchesFilters(card);
42
+ card.classList.toggle('hidden', !visible);
43
+ if (visible) visibleCount++;
44
+ });
45
+
46
+ // Collapse viewset sections with no visible cards
47
+ document.querySelectorAll('.viewset-section').forEach(section => {
48
+ const visibleCards = section.querySelectorAll('.endpoint-card:not(.hidden)');
49
+ section.style.display = visibleCards.length === 0 ? 'none' : '';
50
+ });
51
+
52
+ // Collapse app sections with no visible viewsets
53
+ document.querySelectorAll('.app-section').forEach(app => {
54
+ const visibleViewsets = app.querySelectorAll('.viewset-section:not([style*="display: none"])');
55
+ app.style.display = visibleViewsets.length === 0 ? 'none' : '';
56
+ });
57
+
58
+ // Update filter result stats
59
+ document.querySelector('.filter-results').textContent =
60
+ `Showing ${visibleCount} of ${cards.length} endpoints`;
61
+ }
62
+
63
+ function getValue(id) {
64
+ const el = document.getElementById(id);
65
+ return el ? el.value.trim().toLowerCase() : '';
66
+ }
67
+
68
+ function populateAppFilterOptions() {
69
+ const select = document.getElementById('filter-app');
70
+ const apps = new Set();
71
+
72
+ document.querySelectorAll('.endpoint-card').forEach(card => {
73
+ const app = card.dataset.app;
74
+ if (app) apps.add(app);
75
+ });
76
+
77
+ // Convert to sorted array and add as options
78
+ Array.from(apps).sort().forEach(app => {
79
+ const opt = document.createElement('option');
80
+ opt.value = app;
81
+ opt.textContent = app;
82
+ select.appendChild(opt);
83
+ });
84
+ }
85
+
86
+ function matchesFilters(card) {
87
+ const d = card.dataset;
88
+ const f = currentFilters;
89
+
90
+ if (f.method && d.method !== f.method) return false;
91
+ if (f.path && !d.path.includes(f.path)) return false;
92
+ if (f.app && d.app !== f.app) return false;
93
+ if (f.auth && d.auth !== f.auth) return false;
94
+ if (f.pagination && d.pagination !== f.pagination) return false;
95
+ if (f.search && d.search !== f.search) return false;
96
+ if (f.ordering && d.ordering !== f.ordering) return false;
97
+ if (f.models && !d.models.includes(f.models)) return false;
98
+ if (f.roles && !d.roles.includes(f.roles)) return false;
99
+ if (f.tags && !d.tags.includes(f.tags)) return false;
100
+ if (f.contentType && d.contentType !== f.contentType) return false;
101
+
102
+ if (f.params && !d.params.includes(f.params)) return false;
103
+
104
+ return true;
105
+ }
106
+
107
+ function clearFilters() {
108
+ document.querySelectorAll('.filter-input, .filter-select').forEach(el => el.value = '');
109
+ currentFilters = {
110
+ method: '', path: '', models: '', auth: '', roles: '', contentType: '',
111
+ params: '', schema: '', pagination: '', tags: '', app: '', ordering: '', search: ''
112
+ };
113
+ applyFilters();
114
+ updateURLParams(currentFilters);
115
+ }
116
+
117
+
118
+ function updateURLParams(filters) {
119
+ const params = new URLSearchParams();
120
+ Object.entries(filters).forEach(([k, v]) => {
121
+ if (v) params.set(k, v);
122
+ });
123
+ history.replaceState(null, '', '?' + params.toString());
124
+ }
125
+
126
+ function loadURLParams() {
127
+ const params = new URLSearchParams(location.search);
128
+ params.forEach((v, k) => {
129
+ const input = document.getElementById(`filter-${k}`);
130
+ if (input) input.value = v;
131
+ });
132
+ }
133
+
134
+ document.addEventListener('DOMContentLoaded', () => {
135
+ populateAppFilterOptions();
136
+ loadURLParams();
137
+ document.querySelectorAll('.filter-input, .filter-select').forEach(input => {
138
+ input.addEventListener('input', debounce(applyFilters, 250));
139
+ });
140
+ applyFilters();
141
+ });
142
+
143
+ function debounce(func, delay) {
144
+ let timeout;
145
+ return function () {
146
+ clearTimeout(timeout);
147
+ timeout = setTimeout(func, delay);
148
+ };
149
+ }
150
+
151
+
152
+
153
+ document.addEventListener('DOMContentLoaded', function() {
154
+ // Example filter implementation
155
+ const container = document.getElementById('fullscreen-container');
156
+
157
+ // Add filter controls
158
+ const filterControls = document.createElement('div');
159
+ filterControls.className = 'filter-controls';
160
+ filterControls.innerHTML = `
161
+ <select id="filter-select">
162
+ <option value="none">No Filter</option>
163
+ <option value="grayscale">Grayscale</option>
164
+ <option value="sepia">Sepia</option>
165
+ <option value="blur">Blur</option>
166
+ </select>
167
+ `;
168
+ container.prepend(filterControls);
169
+
170
+ // Apply filter based on selection
171
+ document.getElementById('filter-select').addEventListener('change', function(e) {
172
+ container.style.filter = e.target.value === 'none' ? '' : e.target.value + '(100%)';
173
+ });
174
+
175
+ // Your custom filter logic here
176
+ // Example: Apply initial filter if needed
177
+ // container.style.filter = 'grayscale(50%)';
178
+ });
179
+
180
+ document.addEventListener('DOMContentLoaded', () => {
181
+ const filterPanel = document.getElementById('filterSidebar');
182
+ const leftSidebar = document.querySelector('.md-sidebar--primary');
183
+
184
+ if (filterPanel && leftSidebar) {
185
+ leftSidebar.innerHTML = ''; // Remove nav if not needed
186
+ leftSidebar.appendChild(filterPanel);
187
+ filterPanel.classList.remove('collapsed'); // Make sure it's visible
188
+ }
189
+ });
@@ -0,0 +1,21 @@
1
+ /* ===== ACCESSIBILITY ===== */
2
+ @media (prefers-contrast: high) {
3
+ :root {
4
+ --border-color: #000000;
5
+ --text-secondary: #000000;
6
+ }
7
+
8
+ [data-theme="dark"],
9
+ [data-md-color-scheme="slate"] {
10
+ --border-color: #ffffff;
11
+ --text-secondary: #ffffff;
12
+ }
13
+ }
14
+
15
+ @media (prefers-reduced-motion: reduce) {
16
+ * {
17
+ animation-duration: 0.01ms !important;
18
+ animation-iteration-count: 1 !important;
19
+ transition-duration: 0.01ms !important;
20
+ }
21
+ }
@@ -0,0 +1,11 @@
1
+ /* ===== ANIMATIONS ===== */
2
+ .filter-highlight {
3
+ background: linear-gradient(135deg, rgba(59, 130, 246, 0.1), rgba(147, 51, 234, 0.1));
4
+ border-color: var(--accent-primary) !important;
5
+ animation: highlight-pulse 2s ease-in-out;
6
+ }
7
+
8
+ @keyframes highlight-pulse {
9
+ 0%, 100% { box-shadow: 0 0 0 0 rgba(59, 130, 246, 0.4); }
10
+ 50% { box-shadow: 0 0 0 10px rgba(59, 130, 246, 0); }
11
+ }
@@ -0,0 +1,54 @@
1
+ /* ===== METHOD BADGES ===== */
2
+ .method-badge {
3
+ position: relative;
4
+ padding: 6px 12px;
5
+ font-size: 12px;
6
+ font-weight: bold;
7
+ border-radius: 20px;
8
+ color: white;
9
+ text-transform: uppercase;
10
+ overflow: hidden;
11
+ min-width: 60px;
12
+ text-align: center;
13
+ flex-shrink: 0;
14
+ }
15
+
16
+ .method-badge::before {
17
+ content: '';
18
+ position: absolute;
19
+ top: 0;
20
+ left: -100%;
21
+ width: 100%;
22
+ height: 100%;
23
+ background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.3), transparent);
24
+ transition: left 0.5s ease;
25
+ }
26
+
27
+ .method-badge:hover::before {
28
+ left: 100%;
29
+ }
30
+
31
+ .method-get {
32
+ background: linear-gradient(135deg, #10b981, #059669);
33
+ box-shadow: 0 4px 15px rgba(16, 185, 129, 0.3);
34
+ }
35
+
36
+ .method-post {
37
+ background: linear-gradient(135deg, #f59e0b, #d97706);
38
+ box-shadow: 0 4px 15px rgba(245, 158, 11, 0.3);
39
+ }
40
+
41
+ .method-put {
42
+ background: linear-gradient(135deg, #8b5cf6, #7c3aed);
43
+ box-shadow: 0 4px 15px rgba(139, 92, 246, 0.3);
44
+ }
45
+
46
+ .method-patch {
47
+ background: linear-gradient(135deg, #06b6d4, #0891b2);
48
+ box-shadow: 0 4px 15px rgba(6, 182, 212, 0.3);
49
+ }
50
+
51
+ .method-delete {
52
+ background: linear-gradient(135deg, #ef4444, #dc2626);
53
+ box-shadow: 0 4px 15px rgba(239, 68, 68, 0.3);
54
+ }
@@ -0,0 +1,15 @@
1
+ /* ===== BASE STYLES ===== */
2
+ * {
3
+ box-sizing: border-box;
4
+ }
5
+
6
+ body {
7
+ font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
8
+ background: var(--bg-primary);
9
+ color: var(--text-primary);
10
+ line-height: 1.6;
11
+ transition: background-color 0.3s ease, color 0.3s ease;
12
+ margin: 0;
13
+ padding: 0;
14
+ min-height: 100vh;
15
+ }
@@ -0,0 +1,48 @@
1
+ /* ===== ENDPOINT CONTENT ===== */
2
+ .endpoint-path {
3
+ font-family: 'Monaco', 'Menlo', 'SF Mono', monospace;
4
+ font-weight: 600;
5
+ color: var(--text-primary);
6
+ font-size: 15px;
7
+ margin-bottom: 8px;
8
+ word-break: break-all;
9
+ background: var(--bg-primary);
10
+ padding: 12px;
11
+ border-radius: 8px;
12
+ border: 1px solid var(--border-color);
13
+ flex: 1;
14
+ min-width: 0;
15
+ }
16
+
17
+ .endpoint-description {
18
+ color: var(--text-secondary);
19
+ font-size: 14px;
20
+ margin-bottom: 12px;
21
+ line-height: 1.5;
22
+ }
23
+
24
+ .related-models {
25
+ margin-bottom: 12px;
26
+ }
27
+
28
+ .related-models-label {
29
+ font-size: 12px;
30
+ color: var(--text-secondary);
31
+ margin-bottom: 4px;
32
+ }
33
+
34
+ .models-list {
35
+ display: flex;
36
+ flex-wrap: wrap;
37
+ gap: 4px;
38
+ }
39
+
40
+ .model-badge {
41
+ background: var(--bg-primary);
42
+ color: var(--text-primary);
43
+ padding: 2px 6px;
44
+ border-radius: 4px;
45
+ font-size: 11px;
46
+ font-family: monospace;
47
+ border: 1px solid var(--border-color);
48
+ }