added doc comments to all formatters

This commit is contained in:
truePhilipp committed 2024-05-07 17:36:54 +02:00
1 parent 5fc200a75b
commit cf55e8952b
12 files changed
+197 -4

No files matched your search

@@ -1,3 +1,16 @@
"""
include_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-include". The value of "dj-include" is expected to be a
string representing a Django template include command. For each found element, it replaces the element's content with
the Django template include command, using the value of "dj-include" as the command.
Then it removes the "dj-include" attribute from the element.
Example:
If an element is <div dj-include="template_name.html"></div>,
after processing, it becomes {% include "template_name.html" %}.
"""
from bs4 import BeautifulSoup