Skip to content

Commit 3747a95

Browse files
committed
add autosummary
1 parent 481236f commit 3747a95

File tree

1 file changed

+13
-1
lines changed

1 file changed

+13
-1
lines changed

quartodoc/autosummary.py

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
import logging
44
import warnings
55
import yaml
6+
import sys
67

78
from fnmatch import fnmatchcase
89
from griffe.loader import GriffeLoader
@@ -14,10 +15,12 @@
1415
from plum import dispatch # noqa
1516
from pathlib import Path
1617
from types import ModuleType
18+
from pydantic import ValidationError
1719

1820
from .inventory import create_inventory, convert_inventory
1921
from . import layout
2022
from .renderers import Renderer
23+
from .validation import fmt
2124

2225
from typing import Any
2326

@@ -446,7 +449,16 @@ def load_layout(self, sections: dict, package: str):
446449
# TODO: currently returning the list of sections, to make work with
447450
# previous code. We should make Layout a first-class citizen of the
448451
# process.
449-
return layout.Layout(sections=sections, package=package)
452+
# import ipdb; ipdb.set_trace()
453+
# sys.tracebacklimit = 0
454+
try:
455+
return layout.Layout(sections=sections, package=package)
456+
except ValidationError as e:
457+
raise e
458+
msg = 'Configuration error(s) for YAML:\n - '
459+
msg += '\n - '.join(fmt(err) for err in e.errors())
460+
raise ValueError(msg) from None
461+
450462

451463
# building ----------------------------------------------------------------
452464

0 commit comments

Comments
 (0)