Skip to content

Commit bd352e3

Browse files
authored
Merge pull request #229 from machow/watch-quarto.yml
Add config file (`_quarto.yml`) to `quartodoc build --watch`
2 parents 7c76a48 + f179214 commit bd352e3

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

quartodoc/__main__.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -141,6 +141,11 @@ def build(config, filter, dry_run, watch, verbose):
141141
"""
142142
Generate API docs based on the given configuration file (`./_quarto.yml` by default).
143143
"""
144+
cfg_path = f"{os.getcwd()}/{config}"
145+
if not Path(cfg_path).exists():
146+
raise FileNotFoundError(
147+
f"Configuration file {cfg_path} not found. Please create one."
148+
)
144149
if verbose:
145150
_enable_logs()
146151

@@ -158,6 +163,7 @@ def build(config, filter, dry_run, watch, verbose):
158163
observer._event_queue.maxsize = 1 # the default is 0 which is infinite, and there isn't a way to set this in the constructor
159164
event_handler = QuartoDocFileChangeHandler(callback=doc_build)
160165
observer.schedule(event_handler, pkg_path, recursive=True)
166+
observer.schedule(event_handler, cfg_path, recursive=True)
161167
observer.start()
162168
try:
163169
while True:

0 commit comments

Comments
 (0)