django-cotton-gallery 1.0.0
“Drop-in playground for Django Cotton component libraries — annotated, copy-and-pasteable, themable.”
Highlight.js public API markerCode editor preview fetch workflow
SHA-2566bb4813a1c3cb6db054886a1e26c6ab35bb1c9bcc897fbdb9e10f0f4ddcdf125
MaleculeK(Am)
Evidence
⋯4 lines
18from __future__ import annotations
19
20import os
21import sys
22import warnings
23
24from django.apps import AppConfig
25
26
27def _build_dev_only_warning() -> str:
28 use_color = sys.stderr.isatty() and "NO_COLOR" not in os.environ
29 if use_color:
30 bold = "\033[1m"
31 red = "\033[91m"
32 yellow = "\033[93m"
33 …
66:30… MAIN=true`; the parent does not.
67 is_runserver_parent = "runserver" in sys.argv and os.environ.get("RUN_MAIN") != "true"
68 if is_runserver_parent:
69 return
70
71 # Only warn when the gallery URLs are actuall …
73:2… # raises NoReverseMatch and we stay silent.
74 from django.urls import NoReverseMatch, reverse
75
76 try:
77 reverse("django_cotton_gallery:index")
78 except NoReverseMatch:
1"""Django Cotton Gallery — component gallery and @prop annotation system for django-cotton."""
2
3from importlib.metadata import PackageNotFoundError, version
4
5try:
6 # pyproject.toml is the single source of truth — a literal here drifts.
7 __version__ = version("django-cotton-gallery")
8except PackageNotFoundError: # running from a source tree, not installed
9 __version__ = "0.0.0.dev0"
46:74…
47export const initPreviewBgSwitcher = () => {
48 const buttons = document.querySelectorAll('.cg-bg-btn[data-cg-bg]');
49 if (!buttons.length) return;
50
51 // Edit controls live on the detail page only; the compare view reuses the
52 // sam …
No evidence locations were recorded for this file. Raw result