Skip to content
This repository has been archived by the owner on Oct 15, 2022. It is now read-only.

Commit

Permalink
Added direct support for GENERATING_DOCS
Browse files Browse the repository at this point in the history
  • Loading branch information
SireInsectus committed Oct 10, 2022
1 parent bc082b1 commit d189724
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion src/dbacademy_courseware/dbpublish/publisher_class.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,8 @@ class Publisher:

VERSION_INFO_NOTEBOOK = "Version Info"

GENERATING_DOCS = "generating_docs"

KEEPERS = [".gitignore", "README.md", "LICENSE", "docs"]

def __init__(self, build_config: BuildConfig):
Expand Down Expand Up @@ -305,6 +307,11 @@ def to_test_suite(self, test_type: str = None, keep_success: bool = False):
test_type=test_type,
keep_success=keep_success)

@staticmethod
def generating_docs() -> bool:
value = dbgems.get_parameter(Publisher.GENERATING_DOCS, False)
return str(value).lower() == "true"

def _generate_html(self, notebook):
import time
from dbacademy_gems import dbgems
Expand All @@ -317,7 +324,7 @@ def _generate_html(self, notebook):
path = f"../Source/{notebook.path}"
dbgems.dbutils.notebook.run(path, timeout_seconds=60 * 5, arguments={
"version": self.build_config.version,
"generating_docs": True
Publisher.GENERATING_DOCS: "true"
})

print(f"Generated docs for \"{notebook.path}\"...({int(time.time()) - start} seconds)")
Expand Down

0 comments on commit d189724

Please sign in to comment.