Skip to content

Commit 6f2f671

Browse files
committed
docs: docs for remix tree pretty formatter
1 parent b031b04 commit 6f2f671

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

scratchattach/site/project.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -871,6 +871,12 @@ def remix_tree(self):
871871
return mapping[root_id]
872872

873873
def remix_tree_pretty(self, indent: int = 0, *, formatter: Callable[[Project, int], str] = None):
874+
"""
875+
Prettily formats and indents the remix tree attached to this project. (does NOT start at root)
876+
:param indent: default indent - recommend keeping this as 0
877+
:param formatter: function that formats a single project with an indent. Return a string. Recommend starting with '\t' * indent
878+
:return: Large string containing the formatted remix tree. For large trees, it is recommended to save it to a file.
879+
"""
874880
if not formatter:
875881
formatter = lambda p, ind: f"{'\t' * ind}-P {p.title} ({p.id}) #{p.remix_depth}\n"
876882

0 commit comments

Comments
 (0)