Skip to content

Commit d53b1e0

Browse files
committed
Simplify config
1 parent e24af7d commit d53b1e0

2 files changed

Lines changed: 10 additions & 13 deletions

File tree

mkdocstrings/handlers/crystal/collector.py

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -25,11 +25,6 @@
2525

2626

2727
class CrystalCollector(BaseCollector):
28-
default_config: dict = {
29-
"nested_types": False,
30-
"file_filters": True,
31-
}
32-
3328
def __init__(self, crystal_docs_flags: Sequence[str] = ()):
3429
"""Create a "collector", reading docs from `crystal doc` in the current directory.
3530
@@ -75,7 +70,11 @@ def collect(self, identifier: str, config: Mapping[str, Any]) -> "DocView":
7570
Raises:
7671
CollectionError: When an item by that identifier couldn't be found.
7772
"""
78-
config = collections.ChainMap(config, self.default_config)
73+
config = {
74+
"nested_types": False,
75+
"file_filters": True,
76+
**config,
77+
}
7978

8079
item = self.root
8180
if identifier != "::":

mkdocstrings/handlers/crystal/renderer.py

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
import collections
21
import contextlib
32
import xml.etree.ElementTree as etree
43
from typing import Optional, TypeVar, Union
@@ -20,13 +19,12 @@
2019
class CrystalRenderer(base.BaseRenderer):
2120
fallback_theme = "material"
2221

23-
default_config: dict = {
24-
"show_source_links": True,
25-
"heading_level": 2,
26-
}
27-
2822
def render(self, data: DocItem, config: dict) -> str:
29-
subconfig = collections.ChainMap(config, self.default_config)
23+
subconfig = {
24+
"show_source_links": True,
25+
"heading_level": 2,
26+
**config,
27+
}
3028
template = self.env.get_template(data._TEMPLATE)
3129

3230
with self._monkeypatch_highlight_function(default_lang="crystal"):

0 commit comments

Comments
 (0)