Skip to content
Merged
Show file tree
Hide file tree
Changes from 5 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions docs/source/examples.rst
Original file line number Diff line number Diff line change
Expand Up @@ -216,7 +216,7 @@ Animations

.. manim:: MovingAngle
:ref_classes: Angle
:ref_functions: Mobject.rotate
:ref_methods: Mobject.rotate

class MovingAngle(Scene):
def construct(self):
Expand Down Expand Up @@ -296,7 +296,7 @@ Animations
self.wait()

.. manim:: RotationUpdater
:ref_functions: Mobject.add_updater Mobject.remove_updater
:ref_methods: Mobject.add_updater Mobject.remove_updater

class RotationUpdater(Scene):
def construct(self):
Expand All @@ -317,7 +317,7 @@ Animations

.. manim:: PointWithTrace
:ref_classes: Rotating
:ref_functions: VMobject.set_points_as_corners Mobject.add_updater
:ref_methods: VMobject.set_points_as_corners Mobject.add_updater

class PointWithTrace(Scene):
def construct(self):
Expand Down
8 changes: 7 additions & 1 deletion docs/source/manim_directive.py
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,11 @@ def construct(self):
rendered in a reference block after the source code.

ref_functions
A list of functions and methods, separated by spaces,
A list of functions, separated by spaces,
that is rendered in a reference block after the source code.

ref_methods
A list of methods, separated by spaces,
that is rendered in a reference block after the source code.

"""
Expand Down Expand Up @@ -133,6 +137,7 @@ class ManimDirective(Directive):
"ref_modules": lambda arg: process_name_list(arg, "mod"),
"ref_classes": lambda arg: process_name_list(arg, "class"),
"ref_functions": lambda arg: process_name_list(arg, "func"),
"ref_methods": lambda arg: process_name_list(arg, "meth"),
}
final_argument_whitespace = True

Expand Down Expand Up @@ -163,6 +168,7 @@ def run(self):
self.options.get("ref_modules", [])
+ self.options.get("ref_classes", [])
+ self.options.get("ref_functions", [])
+ self.options.get("ref_methods", [])
)
if ref_content:
ref_block = f"""
Expand Down