From eef7756e5be6e7e1d260d9c3382a4540cd26ace9 Mon Sep 17 00:00:00 2001 From: truePhilipp Date: Sat, 11 May 2024 00:23:07 +0200 Subject: [PATCH] added more attribute explanations to Attributes.md --- docs/Attributes.md | 53 +++++++++++++++++++++++++++++++++++++++++++++- 1 file changed, 52 insertions(+), 1 deletion(-) diff --git a/docs/Attributes.md b/docs/Attributes.md index 3b2b3e7..ac221d6 100644 --- a/docs/Attributes.md +++ b/docs/Attributes.md @@ -28,4 +28,55 @@ |----------------|-------------------------------------------------------------| | Syntax | `Content` | | Example Input | `
Content
` | -| Example Output | `{% for item in list %}
Content
{% endfor %}` | \ No newline at end of file +| Example Output | `{% for item in list %}
Content
{% endfor %}` | + +| dj-if, dj-elif, dj-else | Replace the elements with a Django template if-elif-else structure. | +|-------------------------|----------------------------------------------------------------------------------------------------------------------------------------------------------| +| Syntax | `Content`
`Content`
`Content` | +| Note | The `dj-elif` and `dj-else` attributes are optional. Multiple `dj-elif` attributes are allowed. | +| Example Input | `
Test
Test2
Test3
` | +| Example Output | `{% if condition1 %}Test{% elif condition2 %}Test2{% else %}Test3{% endif %}` | + +| dj-include | Replace the content of the element with a Django template include command. | +|----------------|----------------------------------------------------------------------------| +| Syntax | `` | +| Example Input | `
` | +| Example Output | `{% include "template_name.html" %}` | + +| dj-remove-default | Removing the Doctype, "head" element, and "script" element within the "body" element. It also unwraps the "body" and "html" elements, leaving only the remaining content of the "body" element. | +|-------------------|-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------| +| Syntax | `...` | +| Note | This is meant to remove all the default html wrapper code most static html generators produce. | +| Example Input | `...Content` | +| Example Output | `Content` | + +| dj-static | Replace the value of the specified tag with a Django template static command, using the specified static file path. | +|----------------|---------------------------------------------------------------------------------------------------------------------| +| Syntax | `` | +| Example Input | `` | +| Example Output | `` | + +| dj-style | Modify the style attribute of a element with django variables. | +|----------------|--------------------------------------------------------------------------------------------| +| Syntax | `` | +| Note | The `value_type` is optional. If not included still add the `;` after the value. | +| Example Input | `
` | +| Example Output | `
` | + +| dj-style-raw | Modify the style attribute of a element. The value will be inserted as is. | +|----------------|----------------------------------------------------------------------------------| +| Syntax | `` | +| Example Input | `
` | +| Example Output | `
` | + +| dj-unwrap | Remove the element's tags but keeps its content. | +|----------------|--------------------------------------------------| +| Syntax | `Content` | +| Example Input | `

Hello, world!

` | +| Example Output | `

Hello, world!

` | + +| dj-var | Replace the element's content with a Django template variable. | +|----------------|----------------------------------------------------------------| +| Syntax | `Content` | +| Example Input | `

Hello, world!

` | +| Example Output | `

{{ greeting }}

` | \ No newline at end of file