Skip to content

Commit

Permalink
chore: cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
phil65 committed Nov 12, 2023
1 parent 8827ba7 commit a842a03
Show file tree
Hide file tree
Showing 6 changed files with 23 additions and 99 deletions.
2 changes: 1 addition & 1 deletion docs/classpage_custom.jinja
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
{% block content %}

{% if cls | hasattr("REQUIRED_EXTENSIONS") and cls.REQUIRED_EXTENSIONS %}
#### Required Extensions:
{{ "Required Extensions:" | MkHeader(level=4) }}

{% for i in cls.REQUIRED_EXTENSIONS %}

Expand Down
17 changes: 17 additions & 0 deletions mknodes/basenodes/mkannotations/metadata.toml
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,23 @@ icon = "mdi:alert-box"

[requirements.extension."pymdownx.superfences"]

[examples.python]
python = """
import mknodes as mk
page += mk.MkCode.for_object(mk.MkCode.for_object, extract_body=True)
node = MkAnnotations()
page += node
text = mk.MkText("The MkAnnotations node aggregates annotations(1).")
page += text
info = r"Annotations are numbered and can be set via \\__setitem__."
node[1] = info # (1)
admonition = mk.MkAdmonition("They can also contain other Markdown.")
node[2] = admonition # (2)
text.annotations[1] = "Every MkNode can annotate via the 'annotations' attribute"
page += mk.MkCode(str(node), language="markdown", header="Markdown")
"""

[fragments.annotation]
template = """
{{ node.num }}.{{ 3 - self.num | string | length }}{{ node.items | join("\n\n") | indent }}
Expand Down
8 changes: 4 additions & 4 deletions mknodes/pages/mkclasspage/classpage.md
Original file line number Diff line number Diff line change
@@ -1,18 +1,18 @@
{% block content %}

{% if subclasses %}
### Sub classes
{{ "Sub classes" | MkHeader(level=3) }}
{{ subclasses | MkClassTable }}
{% endif %}

{% if cls.mro() | length > 2 %}
### Base classes
{{ "Base classes" | MkHeader(level=3) }}
{{ cls.__bases__ | MkClassTable }}
### ⋔ Inheritance diagram
{{ "⋔ Inheritance diagram" | MkHeader(level=3) }}
{{ cls | MkClassDiagram(mode="baseclasses") }}
{% endif %}

### 🛈 DocStrings
{{ "🛈 DocStrings" | MkHeader(level=3) }}

{{ cls | MkDocStrings }}

Expand Down
8 changes: 0 additions & 8 deletions mknodes/templatenodes/mkbadge/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -123,20 +123,12 @@ def data(self) -> str:
use_gitlab_style=self.use_gitlab_style,
)

@data.setter
def data(self, value):
pass

@property
def path(self) -> str:
hashed = helpers.get_hash(repr(self))
unique = f"{self.label}_{self.value}_{hashed}.svg"
return helpers.slugify(unique)

@path.setter
def path(self, value):
pass

@classmethod
def create_example_page(cls, page):
import mknodes as mk
Expand Down
3 changes: 1 addition & 2 deletions mknodes/treelib/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@

from .node import Node
from .filetreenode import FileTreeNode
from .modulenode import ModuleNode
from .noderesolver import NodeResolver

__all__ = ["Node", "FileTreeNode", "ModuleNode", "NodeResolver"]
__all__ = ["Node", "FileTreeNode", "NodeResolver"]
84 changes: 0 additions & 84 deletions mknodes/treelib/modulenode.py

This file was deleted.

0 comments on commit a842a03

Please sign in to comment.