diff --git a/frappe/commands.py b/frappe/commands.py index a685107cc3..d5bd38575e 100644 --- a/frappe/commands.py +++ b/frappe/commands.py @@ -404,19 +404,43 @@ def write_docs(context, app, target, local=False): @click.argument('docs_version') @click.argument('target') @click.option('--local', default=False, is_flag=True, help='Run app locally') -def build_docs(context, app, docs_version, target, local=False): +@click.option('--watch', default=False, is_flag=True, help='Watch for changes and rewrite') +def build_docs(context, app, docs_version, target, local=False, watch=False): "Setup docs in target folder of target app" - from frappe.utils.setup_docs import setup_docs + from frappe.utils import watch for site in context.sites: - try: - frappe.init(site=site) - frappe.connect() - make = setup_docs(app) + _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", "..", "..") + watch(apps_path, handler=trigger_make) + +def _build_docs_once(site, app, docs_version, target, local, only_content_updated=False): + from frappe.utils.setup_docs import setup_docs + + try: + + frappe.init(site=site) + frappe.connect() + make = setup_docs(app) + + if not only_content_updated: make.build(docs_version) make.sync_docs() - make.make_docs(target, local) - finally: - frappe.destroy() + + make.make_docs(target, local) + + finally: + frappe.destroy() @click.command('reset-perms') diff --git a/frappe/config/docs.py b/frappe/config/docs.py index 33c30bdb75..b673702251 100644 --- a/frappe/config/docs.py +++ b/frappe/config/docs.py @@ -21,5 +21,12 @@ Frappe Framework was designed to build [ERPNext](https://erpnext.com), open sour ERP for managing small and medium sized businesses. """ +style = """ +.splash .jumbotron h1 { + font-weight: 200; + font-size: 48px; +} +""" + def get_context(context): pass diff --git a/frappe/docs/current/api/config/frappe.config.desk.html b/frappe/docs/current/api/config/frappe.config.desk.html index fe15d9887c..047f70e11f 100644 --- a/frappe/docs/current/api/config/frappe.config.desk.html +++ b/frappe/docs/current/api/config/frappe.config.desk.html @@ -1,7 +1,7 @@
Inherits from frappe.exceptions.ValidationError - -
Inherits from frappe.exceptions.ValidationError - -
Inherits from frappe.exceptions.ValidationError - -
Wrapper for POP server to pull emails.
+ + + connect_imap + (self) +
+Connect to IMAP
++ + + connect_pop + (self) +
+No docs
++ + + get_new_mails + (self) +
+Return list of new mails
+@@ -344,7 +341,7 @@ retrieve_message - (self, pop_meta, msg_num) + (self, message_meta, msg_num=None)
No docs
- + - validate_pop - (self, pop_meta) + validate_message_limits + (self, message_meta) +
+No docs
+Inherits from frappe.exceptions.ValidationError + +
Inherits from frappe.exceptions.ValidationError + +
Inherits from frappe.exceptions.ValidationError + +
Inherits from frappe.email.receive.TimerMixin, imaplib.IMAP4 + +
+ + + __init__ + (self) +
+No docs
++ + + _getline + (self) +
+No docs
++ + + quit + (self) +
+No docs
+Inherits from frappe.email.receive.TimerMixin, imaplib.IMAP4_SSL + +
+ + + __init__ + (self) +
+No docs
++ + + _getline + (self) +
+No docs
++ + + quit + (self)
No docs
Raises frappe.PermissionError if not permitted.
No docs
+diff --git a/frappe/docs/current/api/frappe.database.html b/frappe/docs/current/api/frappe.database.html index eee152e6be..91f9d7741c 100644 --- a/frappe/docs/current/api/frappe.database.html +++ b/frappe/docs/current/api/frappe.database.html @@ -1,7 +1,7 @@
get email id of user formatted as: John Doe johndoe@example.com
+get email id of user formatted as: John Doe johndoe@example.com
+ + + frappe.utils.watch + (path, handler=None, debug=True) +
+No docs
+Public API
- /api/method/frappe.core.doctype.communication.communication.get_convert_to
-
- -