Skip to content

Commit da6b206

Browse files
committed
feat: Add multiple template support for BaseDataDefiner
1 parent 5f27fd4 commit da6b206

6 files changed

Lines changed: 398 additions & 203 deletions

File tree

src/sphinxnotes/data/__init__.py

Lines changed: 21 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -13,12 +13,13 @@
1313

1414
from . import meta
1515
from .data import (
16-
Registry,
16+
Registry as DataRegistry,
17+
REGISTRY as DATA_REGISTRY,
1718
PlainValue,
1819
Value,
1920
ValueWrapper,
2021
RawData,
21-
Data,
22+
ParsedData,
2223
Field,
2324
Schema,
2425
)
@@ -33,6 +34,8 @@
3334
BaseDataDefineRole,
3435
BaseDataDefineDirective,
3536
StrictDataDefineDirective,
37+
ExtraContextRegistry,
38+
EXTRACTX_REGISTRY,
3639
)
3740
from .config import Config
3841

@@ -48,7 +51,7 @@
4851
'Value',
4952
'ValueWrapper',
5053
'RawData',
51-
'Data',
54+
'ParsedData',
5255
'Field',
5356
'Schema',
5457
'Phase',
@@ -68,6 +71,21 @@
6871
logger = logging.getLogger(__name__)
6972

7073

74+
class Registry:
75+
"""The global, all-in-one registry for user."""
76+
77+
@property
78+
def data(self) -> DataRegistry:
79+
return DATA_REGISTRY
80+
81+
@property
82+
def extractx(cls) -> ExtraContextRegistry:
83+
return EXTRACTX_REGISTRY
84+
85+
86+
REGISTRY = Registry()
87+
88+
7189
def setup(app: Sphinx):
7290
meta.pre_setup(app)
7391

0 commit comments

Comments
 (0)