Skip to content

Commit f3b96e4

Browse files
authored
doc: Fixup references (#286)
1 parent c3eb4ac commit f3b96e4

28 files changed

Lines changed: 1357 additions & 1385 deletions

docs/guides/scheduling.md

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -424,6 +424,8 @@ However, there are more explicit methods.
424424

425425
```python exec="true" source="material-block" html="True" hl_lines="20"
426426
import time
427+
from asyncio import Future
428+
427429
from amltk.scheduling import Scheduler
428430

429431
scheduler = Scheduler.with_processes(1)
@@ -437,7 +439,7 @@ However, there are more explicit methods.
437439
def submit_calculations() -> None:
438440
scheduler.submit(expensive_function)
439441

440-
# The will endlessly loop the scheduler
442+
# This will endlessly loop the scheduler
441443
@scheduler.on_future_done
442444
def submit_again(future: Future) -> None:
443445
if scheduler.running():
@@ -468,6 +470,7 @@ the default, but it also takes three other possibilities:
468470
One example is to just `stop()` the scheduler when some exception occurs.
469471

470472
```python exec="true" source="material-block" html="True" hl_lines="12-15"
473+
from asyncio import Future
471474
from amltk.scheduling import Scheduler
472475

473476
scheduler = Scheduler.with_processes(1)

docs/hooks/cleanup_log_output.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
import mkdocs.plugins
1414
import mkdocs.structure.pages
1515

16-
from amltk.exceptions import AutomaticParameterWarning, TaskTypeWarning
16+
from amltk.exceptions import AutomaticParameterWarning
1717

1818
log = logging.getLogger("mkdocs")
1919

docs/hooks/debug_which_page_is_being_rendered.py

Lines changed: 1 addition & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -8,21 +8,12 @@
88
import mkdocs
99
import mkdocs.plugins
1010
import mkdocs.structure.pages
11-
import os
1211

1312
log = logging.getLogger("mkdocs")
1413

15-
RENDER_EXAMPLES_ENV_VAR = "AMLTK_DOC_RENDER_EXAMPLES"
16-
EXEC_DOCS_ENV_VAR = "AMLTK_EXEC_DOCS"
17-
18-
truthy_values = {"yes", "on", "true", "1", "all"}
19-
2014
def on_pre_page(
2115
page: mkdocs.structure.pages.Page,
2216
config: Any,
2317
files: Any,
2418
) -> mkdocs.structure.pages.Page | None:
25-
render_examples = os.environ.get(RENDER_EXAMPLES_ENV_VAR, "true")
26-
render_code = os.environ.get(EXEC_DOCS_ENV_VAR, "true")
27-
if render_examples.lower() in truthy_values or render_code.lower() in truthy_values:
28-
log.info(f"{page.file.src_path}")
19+
log.info(f"{page.file.src_path}")

docs/hooks/disable_markdown_exec.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@
2222
logger = logging.getLogger("mkdocs")
2323

2424

25-
def _print_msg(compiled_code: Any, exec_globals: dict) -> None:
25+
def _print_msg(compiled_code: Any, code_block_id: int, exec_globals: dict) -> None:
2626
_print = exec_globals["print"]
2727
_print(
2828
f"Env variable {RUN_CODE_BLOCKS_ENV_VAR}=0 - No code to display."
@@ -42,5 +42,5 @@ def on_startup(**kwargs: Any):
4242
)
4343
from markdown_exec.formatters import python
4444

45-
setattr(python, "exec", _print_msg)
45+
setattr(python, "exec_python", _print_msg)
4646

0 commit comments

Comments
 (0)