added doc comments to all formatters
This commit is contained in:
1 parent
5fc200a75b
commit
cf55e8952b
12 files changed
+197
-4
No files matched your search
@@ -1,3 +1,16 @@
|
||||
"""
|
||||
for_formatter.py
|
||||
|
||||
This module contains a function `format` that modifies a BeautifulSoup object in place.
|
||||
The function searches for all elements with the attribute "dj-for". The value of "dj-for" is expected to be a
|
||||
string representing a Django template for loop. For each found element, it inserts a Django template for loop
|
||||
before the element and an endfor tag after the element, using the value of "dj-for" as the loop. Then it removes
|
||||
the element's original tag, leaving only the Django template for loop.
|
||||
|
||||
Example:
|
||||
If an element is <div dj-for="item in list"></div>,
|
||||
after processing, it becomes {% for item in list %}{% endfor %}.
|
||||
"""
|
||||
from bs4 import BeautifulSoup
|
||||
|
||||
|
||||
|
||||
Reference in new issue
Block a user