added more doc comments; extracted convert_path function from command entries
This commit is contained in:
1 parent
cf55e8952b
commit
d4f53e49d9
16 files changed
+105
-47
No files matched your search
@@ -1,6 +1,4 @@
|
||||
"""
|
||||
formatters
|
||||
|
||||
This package contains modules that define various formatters for modifying a BeautifulSoup object in place.
|
||||
|
||||
Each formatter module contains a `format` function that performs a specific modification on the BeautifulSoup object.
|
||||
|
||||
@@ -1,6 +1,4 @@
|
||||
"""
|
||||
attr_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-attr".
|
||||
The value of "dj-attr" is expected to be a string with pairs of attributes and values separated by semicolons (;),
|
||||
|
||||
@@ -1,6 +1,4 @@
|
||||
"""
|
||||
block_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-block". The value of "dj-block" is expected to be a
|
||||
string representing the name of a Django block. For each found element, it inserts Django block tags before and after
|
||||
|
||||
@@ -1,6 +1,4 @@
|
||||
"""
|
||||
command_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-command". The value of "dj-command" is expected to be a
|
||||
string representing a Django template command. For each found element, it replaces the element's content with the Django
|
||||
|
||||
@@ -1,6 +1,4 @@
|
||||
"""
|
||||
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
|
||||
|
||||
@@ -1,6 +1,4 @@
|
||||
"""
|
||||
for_wrap_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-wrap". The value of "dj-for-wrap" is expected to be a
|
||||
string representing a Django template for loop. For each found element, it inserts a Django template for loop
|
||||
|
||||
@@ -1,6 +1,4 @@
|
||||
"""
|
||||
if_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-if". The value of "dj-if" is expected to be a
|
||||
string representing a Django template if condition. For each found element, it inserts a Django template if tag
|
||||
|
||||
@@ -1,6 +1,4 @@
|
||||
"""
|
||||
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
|
||||
|
||||
@@ -1,6 +1,4 @@
|
||||
"""
|
||||
remove_default_formatter.py
|
||||
|
||||
This module contains a function `format` that modifies a BeautifulSoup object in place.
|
||||
The function searches for the "html" element with the attribute "dj-remove-default". If such an element is found,
|
||||
the function removes the Doctype, "head" element, and "script" element within the "body" element from the BeautifulSoup
|
||||
|
||||
@@ -1,6 +1,4 @@
|
||||
"""
|
||||
static_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-static". The value of "dj-static" is expected to be a
|
||||
string representing a tag and a static file path separated by a semicolon. For each found element, it replaces the value
|
||||
|
||||
@@ -1,6 +1,4 @@
|
||||
"""
|
||||
style_formatter.py
|
||||
|
||||
This module contains a function `format` that modifies a BeautifulSoup object in place. It also contains two helper
|
||||
functions, `parse_style` and `style_to_string`.
|
||||
|
||||
|
||||
@@ -1,6 +1,4 @@
|
||||
"""
|
||||
style_raw_formatter.py
|
||||
|
||||
This module contains a function `format` that modifies a BeautifulSoup object in place.
|
||||
|
||||
The `format` function searches for all elements with the attribute "dj-style-raw". For each found element, it parses the
|
||||
|
||||
@@ -1,6 +1,4 @@
|
||||
"""
|
||||
unwrap_formatter.py
|
||||
|
||||
This module contains a function `format` that modifies a BeautifulSoup object in place.
|
||||
|
||||
The `format` function searches for all elements with the attribute "dj-unwrap". For each found element, it removes the
|
||||
|
||||
@@ -1,6 +1,4 @@
|
||||
"""
|
||||
var_formatter.py
|
||||
|
||||
This module contains a function `format` that modifies a BeautifulSoup object in place.
|
||||
|
||||
The `format` function searches for all elements with the attribute "dj-var". For each found element, it replaces the
|
||||
|
||||
Reference in new issue
Block a user