Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion docs/components_page/__init__.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import os
from pathlib import Path

import dash
Expand All @@ -9,6 +10,8 @@
from .components.tabs.simple import tab1_content, tab2_content
from .markdown_parser import parse

SERVE_LOCALLY = os.getenv("DBC_DOCS_MODE", "production") == "dev"

HERE = Path(__file__).parent
COMPONENTS = HERE / "components"
TEMPLATES = HERE.parent / "templates"
Expand Down Expand Up @@ -130,7 +133,7 @@ def register_apps():
external_stylesheets=["/static/loading.css"],
requests_pathname_prefix=f"/docs/components/{slug}/",
suppress_callback_exceptions=True,
serve_locally=False,
serve_locally=SERVE_LOCALLY,
index_string=template.render(
sidenav_items=sidenav_items,
sidenav_active="components",
Expand Down
4 changes: 3 additions & 1 deletion docs/examples/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,8 @@
from .vendor.graphs_in_tabs import app as git_app
from .vendor.iris import app as iris_app

SERVE_LOCALLY = os.getenv("DBC_DOCS_MODE", "production") == "dev"

HREF_PATTERN = re.compile(r'href="')

HERE = Path(__file__).parent
Expand Down Expand Up @@ -73,7 +75,7 @@ def build_app_from_example(app, name, code, code_link, show_warning=False):
new_app = dash.Dash(
external_stylesheets=["/static/loading.css", dbc.themes.BOOTSTRAP],
requests_pathname_prefix=f"/examples/{name}/",
serve_locally=False,
serve_locally=SERVE_LOCALLY,
index_string=template.replace("<CODE>", code),
update_title=None,
)
Expand Down
3 changes: 3 additions & 0 deletions docs/run.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,9 @@
)

if __name__ == "__main__":
import os

from werkzeug.serving import run_simple

os.environ["DBC_DOCS_MODE"] = "dev"
run_simple("localhost", 8888, application, use_reloader=True)