def build_docs(context, app, docs_version="current", target=None, local=False, watch=False): "Setup docs in target folder of target app" from frappe.utils import watch as start_watch if not target: target = os.path.abspath(os.path.join("..", "docs", app)) for site in context.sites: _build_docs_once(site, app, docs_version, target, local) if watch: def trigger_make(source_path, event_type): if "/templates/autodoc/" in source_path: _build_docs_once(site, app, docs_version, target, local) elif ("/docs.css" in source_path or "/docs/" in source_path or "docs.py" in source_path): _build_docs_once(site, app, docs_version, target, local, only_content_updated=True) apps_path = frappe.get_app_path("frappe", "..", "..") start_watch(apps_path, handler=trigger_make)
def build_docs(context, app, docs_version, target, local=False, watch=False): "Setup docs in target folder of target app" from frappe.utils import watch as start_watch for site in context.sites: _build_docs_once(site, app, docs_version, target, local) if watch: def trigger_make(source_path, event_type): if "/templates/autodoc/" in source_path: _build_docs_once(site, app, docs_version, target, local) elif ("/docs.css" in source_path or "/docs/" in source_path or "docs.py" in source_path): _build_docs_once(site, app, docs_version, target, local, only_content_updated=True) apps_path = frappe.get_app_path("frappe", "..", "..") start_watch(apps_path, handler=trigger_make)
def build_docs(context, app, docs_version="current", target=None, local=False, watch=False): "Setup docs in target folder of target app" from frappe.utils import watch as start_watch from frappe.utils.setup_docs import add_breadcrumbs_tag for site in context.sites: _build_docs_once(site, app, docs_version, target, local) if watch: def trigger_make(source_path, event_type): if "/docs/user/" in source_path: # user file target_path = frappe.get_app_path(target, 'www', 'docs', 'user', os.path.relpath(source_path, start=frappe.get_app_path(app, 'docs', 'user'))) shutil.copy(source_path, target_path) add_breadcrumbs_tag(target_path) if source_path.endswith('/docs/index.md'): target_path = frappe.get_app_path(target, 'www', 'docs', 'index.md') shutil.copy(source_path, target_path) apps_path = frappe.get_app_path(app) start_watch(apps_path, handler=trigger_make)