Skip to content

Commit c4409f0

Browse files
committed
fix: Fix handler's name (C# -> CSharp) where needed
1 parent 4ce4443 commit c4409f0

File tree

3 files changed

+12
-12
lines changed

3 files changed

+12
-12
lines changed

src/mkdocstrings_handlers/csharp/handler.py

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -17,13 +17,13 @@
1717
logger = get_logger(__name__)
1818

1919

20-
class C#Handler(BaseHandler):
20+
class CSharpHandler(BaseHandler):
2121
"""The C# handler class."""
2222

23-
name: str = "c#"
23+
name: str = "csharp"
2424
"""The handler's name."""
2525

26-
domain: str = "c#"
26+
domain: str = "csharp"
2727
"""The cross-documentation domain/language for this handler."""
2828

2929
enable_inventory: bool = False
@@ -105,8 +105,8 @@ def get_handler(
105105
custom_templates: str | None = None,
106106
config_file_path: str | None = None, # noqa: ARG001
107107
**config: Any, # noqa: ARG001
108-
) -> C#Handler:
109-
"""Simply return an instance of `C#Handler`.
108+
) -> CSharpHandler:
109+
"""Simply return an instance of `CSharpHandler`.
110110
111111
Parameters:
112112
theme: The theme to use when rendering contents.
@@ -117,8 +117,8 @@ def get_handler(
117117
Returns:
118118
An instance of the handler.
119119
"""
120-
return C#Handler(
121-
handler="c#",
120+
return CSharpHandler(
121+
handler="csharp",
122122
theme=theme,
123123
custom_templates=custom_templates,
124124
# To pass the following argument,

tests/conftest.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616

1717
from mkdocstrings.plugin import MkdocstringsPlugin
1818

19-
from mkdocstrings_handlers.csharp.handler import C#Handler
19+
from mkdocstrings_handlers.csharp.handler import CSharpHandler
2020

2121

2222
@pytest.fixture(name="mkdocs_conf")
@@ -39,7 +39,7 @@ def fixture_mkdocs_conf(request: pytest.FixtureRequest, tmp_path: Path) -> Itera
3939
"site_name": "foo",
4040
"site_url": "https://example.org/",
4141
"site_dir": str(tmp_path),
42-
"plugins": [{"mkdocstrings": {"default_handler": "c#"}}],
42+
"plugins": [{"mkdocstrings": {"default_handler": "csharp"}}],
4343
**getattr(request, "param", {}),
4444
}
4545
# Re-create it manually as a workaround for https://github.com/mkdocs/mkdocs/issues/2289
@@ -84,7 +84,7 @@ def fixture_ext_markdown(mkdocs_conf: config.Config) -> Markdown:
8484

8585

8686
@pytest.fixture(name="handler")
87-
def fixture_handler(plugin: MkdocstringsPlugin, ext_markdown: Markdown) -> C#Handler:
87+
def fixture_handler(plugin: MkdocstringsPlugin, ext_markdown: Markdown) -> CSharpHandler:
8888
"""Return a handler instance.
8989
9090
Parameters:
@@ -93,6 +93,6 @@ def fixture_handler(plugin: MkdocstringsPlugin, ext_markdown: Markdown) -> C#Han
9393
Returns:
9494
A handler instance.
9595
"""
96-
handler = plugin.handlers.get_handler("c#")
96+
handler = plugin.handlers.get_handler("csharp")
9797
handler._update_env(ext_markdown, plugin.handlers._config)
9898
return handler # type: ignore[return-value]

tests/test_themes.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ def test_render_themes_templates_python(identifier: str, plugin: MkdocstringsPlu
3434
plugin: Pytest fixture (see conftest.py).
3535
ext_markdown: Pytest fixture (see conftest.py).
3636
"""
37-
handler = plugin.handlers.get_handler("c#")
37+
handler = plugin.handlers.get_handler("csharp")
3838
handler._update_env(ext_markdown, plugin.handlers._config)
3939
data = handler.collect(identifier, {})
4040
handler.render(data, {})

0 commit comments

Comments
 (0)