Skip to content

Commit

Permalink
Kind of doing what I am expecting
Browse files Browse the repository at this point in the history
  • Loading branch information
daquintero committed Aug 13, 2024
1 parent 9d24543 commit 5d044ac
Show file tree
Hide file tree
Showing 4 changed files with 19 additions and 21 deletions.
4 changes: 0 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -44,10 +44,6 @@ Basic Example:
.. autoflex:: somepackage.MyClass # CURRENTLY NOT WORKING
```





## Links

- Source: <https://github.com/sphinx-contrib/sphinxcontrib-autoflex />
Expand Down
31 changes: 17 additions & 14 deletions autoflex/directives.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
from typing import Any


class AutoFlexDirective(pydantic.BaseModel, rst.Directive):
class AutoFlexDirective(rst.Directive):
"""
Extension of the ``.. automodule::`` directive.
Expand All @@ -17,20 +17,23 @@ class AutoFlexDirective(pydantic.BaseModel, rst.Directive):
"""

# Directive information
name: str = "autoflex"
arguments: Any = None
options: Any = None
content: Any = None
lineno: Any = None
content_offset: Any = None
block_text: Any = None
state: Any = None
state_machine: Any = None
reporter: Any = None

required_arguments: int = 0
optional_arguments: int = 0
has_content: bool = True

# name: str = "autoflex"
# arguments: Any = None
# options: Any = None
# content: Any = None
# lineno: Any = None
# content_offset: Any = None
# block_text: Any = None
# state: Any = None
# state_machine: Any = None
# reporter: Any = None
#
# required_arguments: int = 1
# optional_arguments: int = 0

def run(self):
print("AutoFlex directive running.")
print(self.name)
return []
2 changes: 0 additions & 2 deletions docs/examples/demo.rst
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
Example

.. autoflex::

Hi
3 changes: 2 additions & 1 deletion docs/examples/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -3,5 +3,6 @@
poetry run python -m sphinx docs/ _docs/
.. include:: demo.rst

.. autoflex::

0 comments on commit 5d044ac

Please sign in to comment.