Skip to content

Commit ac2a1bb

Browse files
committed
Revert "Add numpydoc Renderer"
This reverts commit 59ceb47.
1 parent dd2aa1f commit ac2a1bb

File tree

3 files changed

+2
-446
lines changed

3 files changed

+2
-446
lines changed

quartodoc/renderers/__init__.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,4 +2,3 @@
22

33
from .base import Renderer
44
from .md_renderer import MdRenderer
5-
from .numpydoc_renderer import NumpyDocRenderer

quartodoc/renderers/base.py

Lines changed: 2 additions & 64 deletions
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,7 @@
11
import re
2-
from dataclasses import dataclass
3-
from typing import Optional
42

53
from plum import dispatch
64

7-
from quartodoc.pandoc.inlines import Link
8-
9-
@dataclass
10-
class InterLink(Link):
11-
"""
12-
Link with target enclosed in colons
13-
14-
These targets of these links are interlink references
15-
that are finally resolved by the interlinks filter.
16-
"""
17-
def __post_init__(self):
18-
self.target = f":{self.target}:"
195

206
# utils -----------------------------------------------------------------------
217

@@ -44,52 +30,6 @@ def convert_rst_link_to_md(rst):
4430
return re.sub(expr, r"[](\1)", rst, flags=re.MULTILINE)
4531

4632

47-
def interlink_ref_to_link(interlink_ref: tuple[str|None, str]) -> InterLink:
48-
"""
49-
Convert an rst reference to a quoted link
50-
51-
The interlink has been parsed into a tuple form.
52-
53-
e.g.
54-
55-
1. Written as - ":meth:`class.some_method`:"
56-
Parsed value - ("class.some_method", "meth")
57-
Return value is a link with target - "`:meth:class.some_method`"
58-
59-
2. Written as - "class.some_method"
60-
Parsed value - ("class.some_method", None)
61-
Return value is a link with target - "`class.some_method`"
62-
63-
This method creates a link that can be represented in
64-
markdown and that is later processed by the lua interlinks
65-
filter into its final form.
66-
"""
67-
name, role = interlink_ref
68-
target = f":{role}:{name}:" if role else f"{name}"
69-
return InterLink(content=name, target=target)
70-
71-
72-
def build_parameter(name: str, annotation: Optional[str], default: Optional[str]) -> str:
73-
"""
74-
Create code snippet that defines a parameter
75-
"""
76-
if not name and annotation:
77-
# e.g. Return values may not have a name
78-
return f"{annotation}"
79-
80-
if default is None:
81-
if annotation:
82-
param = f"{name}: {annotation}"
83-
else:
84-
param = f"{name}"
85-
else:
86-
if annotation:
87-
param = f"{name}: {annotation} = {default}"
88-
else:
89-
param = f"{name}={default}"
90-
91-
return param
92-
9333
# render -----------------------------------------------------------------------
9434

9535

@@ -100,10 +40,8 @@ class Renderer:
10040
def __init_subclass__(cls, **kwargs):
10141
super().__init_subclass__(**kwargs)
10242

103-
# NOTE: Commented out temporarily to make it easit to reload
104-
# modules during dev
105-
# if cls.style in cls._registry:
106-
# raise KeyError(f"A builder for style {cls.style} already exists")
43+
if cls.style in cls._registry:
44+
raise KeyError(f"A builder for style {cls.style} already exists")
10745

10846
cls._registry[cls.style] = cls
10947

0 commit comments

Comments
 (0)