diff --git a/.metadock/content_schematics/example_project.yml b/.metadock/content_schematics/example_project.yml
index fa166fa..ccffa7c 100644
--- a/.metadock/content_schematics/example_project.yml
+++ b/.metadock/content_schematics/example_project.yml
@@ -90,19 +90,19 @@ example_project:
import: jira/projects.yml
key: IGDP
- # "flow" syntax for importing a sub-key, "David_Sillman" inside "eng_identity"
- code_owners:
- - { import: jira/identities.yml, key: eng_identity.David_Sillman }
-
- # "flow" syntax for importing a sub-key using a merge key ("<<"),
- <<: { import: team_contexts/data.yml, key: resources.alerting_channels }
-
- # "block" syntax for importing multiple subkeys from multiple files using a merge key,
- <<:
- - import: team_contexts/data_contacts.yml
- key: contacts.email
- - import: team_contexts/data_push_api.yml
- key: push_api.contracts
+ # "flow" syntax for importing a sub-key, "David_Sillman" inside "eng_identity"
+ code_owners:
+ - { import: jira/identities.yml, key: eng_identity.David_Sillman }
+
+ # "flow" syntax for importing a sub-key using a merge key ("<<"),
+ <<: { import: team_contexts/data.yml, key: resources.alerting_channels }
+
+ # "block" syntax for importing multiple subkeys from multiple files using a merge key,
+ <<:
+ - import: team_contexts/data_contacts.yml
+ key: contacts.email
+ - import: team_contexts/data_push_api.yml
+ key: push_api.contracts
import_key_examples_2.yml: |
content_schematics:
diff --git a/.metadock/content_schematics/jinja_helpers/html.yml b/.metadock/content_schematics/jinja_helpers/html.yml
index b35e2aa..9bb6ecd 100644
--- a/.metadock/content_schematics/jinja_helpers/html.yml
+++ b/.metadock/content_schematics/jinja_helpers/html.yml
@@ -10,7 +10,7 @@ html:
>>> from metadock.env import MetadockEnv
>>> env = MetadockEnv().jinja_environment()
>>> env.from_string("{{ html.bold('This is bold text.') }}").render()
- 'This is bold text.'
+ '<b>This is bold text.</b>'
source_file: metadock/env.py
method_name: metadock.env.MetadockHtmlNamespace.bold
signature: "(self, content: str) -> str"
@@ -26,7 +26,7 @@ html:
>>> from metadock.env import MetadockEnv
>>> env = MetadockEnv().jinja_environment()
>>> env.from_string("{{ html.code('This is code text.') }}").render()
- 'This is code text.
'
+ '<code>This is code text.</code>'
source_file: metadock/env.py
method_name: metadock.env.MetadockHtmlNamespace.code
signature: "(self, content: str) -> str"
@@ -43,7 +43,7 @@ html:
>>> from metadock.env import MetadockEnv
>>> env = MetadockEnv().jinja_environment()
>>> env.from_string("{{ html.details('This is details text.') }}").render()
- '
This is code text.' + '<pre> This is code text.</pre>' source_file: metadock/env.py method_name: metadock.env.MetadockHtmlNamespace.pre signature: "(self, content: str, indent: int = 0) -> str" @@ -92,7 +92,7 @@ html: >>> from metadock.env import MetadockEnv >>> env = MetadockEnv().jinja_environment() >>> env.from_string("{{ html.summary('This is summary text.') }}").render() - '
This is a paragraph.
' | html.escape }}").render() - '<p>This is a paragraph.</p>' + >>> env.from_string("{{ '<p>This is a paragraph.</p>' | html.escape }}").render() + '\<p\>This is a paragraph.\</p\>' source_file: metadock/env.py method_name: metadock.env.MetadockHtmlNamespace.escape_filter signature: "(self, content: str) -> str" @@ -141,7 +141,7 @@ html: >>> from metadock.env import MetadockEnv >>> env = MetadockEnv().jinja_environment() >>> env.from_string("{{ 'This is a multi-line string.\nThis is the second line.\nAnd the third.' | html.inline }}").render() - 'This is a multi-line string.Note that all paths for the import
field are relative to the content_schematics
folder for the project.
If you'd like to import the entire content of a file as context, you may omit the key
field, e.g.:
Jinja namespace for the global Metadock environment, including all global macros, filters, and namespaces.
+The following macros are available in the global namespace:
>>> from metadock.env import MetadockEnv
>>> env = MetadockEnv().jinja_environment()
>>> env.from_string("No changes!{{ debug('This is a debug message.') }}").render()
This is a debug message.
'No changes!'
The following filters are available in the global namespace:
>>> from metadock.env import MetadockEnv
>>> env = MetadockEnv().jinja_environment()
>>> env.from_string("{{ ['a', 'b', 'c'] | zip([1, 2, 3]) | list }}").render()
"[('a', 1), ('b', 2), ('c', 3)]"
md
namespaceJinja Namespace for Markdown-related functions and filters.
-Macros:
-blockquote
-code
-codeblock
-list
-tablehead
-tablerow
-
-Filters:
-convert
-list
-
+The following macros are available in the md namespace:
>>> from metadock.env import MetadockEnv
>>> env = MetadockEnv().jinja_environment()
>>> env.from_string(
... "{{ md.tablehead('Column 1', 'Column 2', 'Column 3') }}\n"
... "{{ md.tablerow('Value 1', 'Value 2', 'Value 3') }}"
... ).render()
'| Column 1 | Column 2 | Column 3 |\n| --- | --- | --- |\n| Value 1 | Value 2 | Value 3 |'
The following filters are available in the md namespace:
>>> from metadock.env import MetadockEnv
>>> env = MetadockEnv().jinja_environment()
>>> env.from_string(
... "{{ ['This is a list.', 'This is a second element'] | md.list }}\n"
... ).render()
'- This is a list.\n- This is a second element\n'
html
namespaceJinja namespace which owns HTML-related functions and filters.
+The following macros are available in the html namespace:
html.bold
metadock.env.MetadockHtmlNamespace.bold: (self, content: str) -> str
>>> from metadock.env import MetadockEnv
>>> env = MetadockEnv().jinja_environment()
>>> env.from_string("{{ html.bold('This is bold text.') }}").render()
'This is bold text.'
>>> from metadock.env import MetadockEnv
>>> env = MetadockEnv().jinja_environment()
>>> env.from_string("{{ html.bold('This is bold text.') }}").render()
'<b>This is bold text.</b>'
html.code
metadock.env.MetadockHtmlNamespace.code: (self, content: str) -> str
>>> from metadock.env import MetadockEnv
>>> env = MetadockEnv().jinja_environment()
>>> env.from_string("{{ html.code('This is code text.') }}").render()
'This is code text.
'
>>> from metadock.env import MetadockEnv
>>> env = MetadockEnv().jinja_environment()
>>> env.from_string("{{ html.code('This is code text.') }}").render()
'<code>This is code text.</code>'
html.details
metadock.env.MetadockHtmlNamespace.details: (self, *contents: str) -> str
>>> from metadock.env import MetadockEnv
>>> env = MetadockEnv().jinja_environment()
>>> env.from_string("{{ html.details('This is details text.') }}").render()
'\nThis is details text.\n'
>>> from metadock.env import MetadockEnv
>>> env = MetadockEnv().jinja_environment()
>>> env.from_string("{{ html.details('This is details text.') }}").render()
'<details>\nThis is details text.\n</details>'
html.italic
metadock.env.MetadockHtmlNamespace.italic: (self, content: str) -> str
>>> from metadock.env import MetadockEnv
>>> env = MetadockEnv().jinja_environment()
>>> env.from_string("{{ html.italic('This is italic text.') }}").render()
'This is italic text.'
>>> from metadock.env import MetadockEnv
>>> env = MetadockEnv().jinja_environment()
>>> env.from_string("{{ html.italic('This is italic text.') }}").render()
'<i>This is italic text.</i>'
html.pre
metadock.env.MetadockHtmlNamespace.pre: (self, content: str, indent: int = 0) -> str
>>> from metadock.env import MetadockEnv
>>> env = MetadockEnv().jinja_environment()
>>> env.from_string("{{ html.pre('This is code text.', indent = 4) }}").render()
'This is code text.'
>>> from metadock.env import MetadockEnv
>>> env = MetadockEnv().jinja_environment()
>>> env.from_string("{{ html.pre('This is code text.', indent = 4) }}").render()
'<pre> This is code text.</pre>'
html.summary
metadock.env.MetadockHtmlNamespace.summary: (self, content: str) -> str
>>> from metadock.env import MetadockEnv
>>> env = MetadockEnv().jinja_environment()
>>> env.from_string("{{ html.summary('This is summary text.') }}").render()
'\nThis is summary text.\n '
>>> from metadock.env import MetadockEnv
>>> env = MetadockEnv().jinja_environment()
>>> env.from_string("{{ html.summary('This is summary text.') }}").render()
'<summary>\nThis is summary text.\n</summary>'
html.underline
metadock.env.MetadockHtmlNamespace.underline: (self, content: str) -> str
>>> from metadock.env import MetadockEnv
>>> env = MetadockEnv().jinja_environment()
>>> env.from_string("{{ html.underline('This is underlined text.') }}").render()
'This is underlined text.'
>>> from metadock.env import MetadockEnv
>>> env = MetadockEnv().jinja_environment()
>>> env.from_string("{{ html.underline('This is underlined text.') }}").render()
'<u>This is underlined text.</u>'
The following filters are available in the html namespace:
html.escape
metadock.env.MetadockHtmlNamespace.escape_filter: (self, content: str) -> str
>>> from metadock.env import MetadockEnv
>>> env = MetadockEnv().jinja_environment()
>>> env.from_string("{{ 'This is a paragraph.
' | html.escape }}").render()
'<p>This is a paragraph.</p>'
>>> from metadock.env import MetadockEnv
>>> env = MetadockEnv().jinja_environment()
>>> env.from_string("{{ '<p>This is a paragraph.</p>' | html.escape }}").render()
'<p>This is a paragraph.</p>'
html.inline
metadock.env.MetadockHtmlNamespace.inline_filter: (self, content: str) -> str
>>> from metadock.env import MetadockEnv
>>> env = MetadockEnv().jinja_environment()
>>> env.from_string("{{ 'This is a multi-line string.\nThis is the second line.\nAnd the third.' | html.inline }}").render()
'This is a multi-line string.
This is the second line.
And the third.'
>>> from metadock.env import MetadockEnv
>>> env = MetadockEnv().jinja_environment()
>>> env.from_string("{{ 'This is a multi-line string.\nThis is the second line.\nAnd the third.' | html.inline }}").render()
'This is a multi-line string.<br>This is the second line.<br>And the third.'
Author:
content_schematics:
- name: alerting_project_proposal
template: airflow_project_proposal_template.md
@@ -291,25 +290,26 @@ content_schematics:
jira:
- # "block" syntax for importing a root-level key "IGDP"
+ # "block" syntax for importing a root-level key "IGDP"
project:
import: jira/projects.yml
key: IGDP
- # "flow" syntax for importing a sub-key, "David_Sillman" inside "eng_identity"
- code_owners:
- - { import: jira/identities.yml, key: eng_identity.David_Sillman }
+ # "flow" syntax for importing a sub-key, "David_Sillman" inside "eng_identity"
+ code_owners:
+ - { import: jira/identities.yml, key: eng_identity.David_Sillman }
- # "flow" syntax for importing a sub-key using a merge key ("<<"),
- <<: { import: team_contexts/data.yml, key: resources.alerting_channels }
+ # "flow" syntax for importing a sub-key using a merge key ("<<"),
+ <<: { import: team_contexts/data.yml, key: resources.alerting_channels }
+
+ # "block" syntax for importing multiple subkeys from multiple files using a merge key,
+ <<:
+ - import: team_contexts/data_contacts.yml
+ key: contacts.email
+ - import: team_contexts/data_push_api.yml
+ key: push_api.contracts
+
- # "block" syntax for importing multiple subkeys from multiple files using a merge key,
- <<:
- - import: team_contexts/data_contacts.yml
- key: contacts.email
- - import: team_contexts/data_push_api.yml
- key: push_api.contracts
-```
Note that all paths for the `import` field are relative to the `content_schematics` folder for the project.
If you'd like to import the entire content of a file as context, you may omit the `key` field, e.g.:
@@ -347,6 +347,8 @@ Jinja namespace for the global Metadock environment, including all global macros
+html.bold|
metadock.env.MetadockHtmlNamespace.bold: (self, content: str) -> str| Wraps a string in HTML bold tags (<b></b>).
>>> from metadock.env import MetadockEnv| -|
>>> env = MetadockEnv().jinja_environment()
>>> env.from_string("{{ html.bold('This is bold text.') }}").render()
'This is bold text.'
html.code|
metadock.env.MetadockHtmlNamespace.code: (self, content: str) -> str| Wraps a string in HTML code tags (<code></code>).
>>> from metadock.env import MetadockEnv| -|
>>> env = MetadockEnv().jinja_environment()
>>> env.from_string("{{ html.code('This is code text.') }}").render()
'This is code text.
'
html.details|
metadock.env.MetadockHtmlNamespace.details: (self, *contents: str) -> str| Wraps a string in line-broken HTML details tags (<details></details>). Multiple arguments get separated by two line breaks.
>>> from metadock.env import MetadockEnv| -|
>>> env = MetadockEnv().jinja_environment()
>>> env.from_string("{{ html.details('This is details text.') }}").render()
'\nThis is details text.\n'
html.italic|
metadock.env.MetadockHtmlNamespace.italic: (self, content: str) -> str| Wraps a string in HTML italic tags (<i></i>).
>>> from metadock.env import MetadockEnv| -|
>>> env = MetadockEnv().jinja_environment()
>>> env.from_string("{{ html.italic('This is italic text.') }}").render()
'This is italic text.'
html.pre|
metadock.env.MetadockHtmlNamespace.pre: (self, content: str, indent: int = 0) -> str| Wraps a string in preformatted HTML pre tags (<pre></pre>), and indents the content by the given amount.
>>> from metadock.env import MetadockEnv| -|
>>> env = MetadockEnv().jinja_environment()
>>> env.from_string("{{ html.pre('This is code text.', indent = 4) }}").render()
'This is code text.'
html.summary|
metadock.env.MetadockHtmlNamespace.summary: (self, content: str) -> str| Wraps a string in line-broken HTML summary tags (<summary>\n\n</summary>).
>>> from metadock.env import MetadockEnv| -|
>>> env = MetadockEnv().jinja_environment()
>>> env.from_string("{{ html.summary('This is summary text.') }}").render()
'\nThis is summary text.\n '
html.underline|
metadock.env.MetadockHtmlNamespace.underline: (self, content: str) -> str| Wraps a string in HTML underline tags (<u></u>).
>>> from metadock.env import MetadockEnv| +|
>>> env = MetadockEnv().jinja_environment()
>>> env.from_string("{{ html.underline('This is underlined text.') }}").render()
'This is underlined text.'
html.bold|
metadock.env.MetadockHtmlNamespace.bold: (self, content: str) -> str| Wraps a string in HTML bold tags (<b></b>).
>>> from metadock.env import MetadockEnv| +|
>>> env = MetadockEnv().jinja_environment()
>>> env.from_string("{{ html.bold('This is bold text.') }}").render()
'<b>This is bold text.</b>'
html.code|
metadock.env.MetadockHtmlNamespace.code: (self, content: str) -> str| Wraps a string in HTML code tags (<code></code>).
>>> from metadock.env import MetadockEnv| +|
>>> env = MetadockEnv().jinja_environment()
>>> env.from_string("{{ html.code('This is code text.') }}").render()
'<code>This is code text.</code>'
html.details|
metadock.env.MetadockHtmlNamespace.details: (self, *contents: str) -> str| Wraps a string in line-broken HTML details tags (<details></details>). Multiple arguments get separated by two line breaks.
>>> from metadock.env import MetadockEnv| +|
>>> env = MetadockEnv().jinja_environment()
>>> env.from_string("{{ html.details('This is details text.') }}").render()
'<details>\nThis is details text.\n</details>'
html.italic|
metadock.env.MetadockHtmlNamespace.italic: (self, content: str) -> str| Wraps a string in HTML italic tags (<i></i>).
>>> from metadock.env import MetadockEnv| +|
>>> env = MetadockEnv().jinja_environment()
>>> env.from_string("{{ html.italic('This is italic text.') }}").render()
'<i>This is italic text.</i>'
html.pre|
metadock.env.MetadockHtmlNamespace.pre: (self, content: str, indent: int = 0) -> str| Wraps a string in preformatted HTML pre tags (<pre></pre>), and indents the content by the given amount.
>>> from metadock.env import MetadockEnv| +|
>>> env = MetadockEnv().jinja_environment()
>>> env.from_string("{{ html.pre('This is code text.', indent = 4) }}").render()
'<pre> This is code text.</pre>'
html.summary|
metadock.env.MetadockHtmlNamespace.summary: (self, content: str) -> str| Wraps a string in line-broken HTML summary tags (<summary>\n\n</summary>).
>>> from metadock.env import MetadockEnv| +|
>>> env = MetadockEnv().jinja_environment()
>>> env.from_string("{{ html.summary('This is summary text.') }}").render()
'<summary>\nThis is summary text.\n</summary>'
html.underline|
metadock.env.MetadockHtmlNamespace.underline: (self, content: str) -> str| Wraps a string in HTML underline tags (<u></u>).
>>> from metadock.env import MetadockEnv| +
>>> env = MetadockEnv().jinja_environment()
>>> env.from_string("{{ html.underline('This is underlined text.') }}").render()
'<u>This is underlined text.</u>'
html.escape|
metadock.env.MetadockHtmlNamespace.escape_filter: (self, content: str) -> str| Filter which escapes a string by replacing all HTML special characters with their HTML entity equivalents.
>>> from metadock.env import MetadockEnv| -|
>>> env = MetadockEnv().jinja_environment()
>>> env.from_string("{{ 'This is a paragraph.
' \| html.escape }}").render()
'<p>This is a paragraph.</p>'
html.inline|
metadock.env.MetadockHtmlNamespace.inline_filter: (self, content: str) -> str| Filter which inlines a string by replacing all newlines with HTML line-breaks <br> singleton tags.
>>> from metadock.env import MetadockEnv| +|
>>> env = MetadockEnv().jinja_environment()
>>> env.from_string("{{ 'This is a multi-line string.\nThis is the second line.\nAnd the third.' \| html.inline }}").render()
'This is a multi-line string.
This is the second line.
And the third.'
html.escape|
metadock.env.MetadockHtmlNamespace.escape_filter: (self, content: str) -> str| Filter which escapes a string by replacing all HTML special characters with their HTML entity equivalents.
>>> from metadock.env import MetadockEnv| +|
>>> env = MetadockEnv().jinja_environment()
>>> env.from_string("{{ '<p>This is a paragraph.</p>' \| html.escape }}").render()
'\<p\>This is a paragraph.\</p\>'
html.inline|
metadock.env.MetadockHtmlNamespace.inline_filter: (self, content: str) -> str| Filter which inlines a string by replacing all newlines with HTML line-breaks <br> singleton tags.
>>> from metadock.env import MetadockEnv| +
>>> env = MetadockEnv().jinja_environment()
>>> env.from_string("{{ 'This is a multi-line string.\nThis is the second line.\nAnd the third.' \| html.inline }}").render()
'This is a multi-line string.<br>This is the second line.<br>And the third.'
content_schematics:
- name: alerting_project_proposal
template: airflow_project_proposal_template.md
@@ -291,25 +290,26 @@ content_schematics:
jira:
- # "block" syntax for importing a root-level key "IGDP"
+ # "block" syntax for importing a root-level key "IGDP"
project:
import: jira/projects.yml
key: IGDP
- # "flow" syntax for importing a sub-key, "David_Sillman" inside "eng_identity"
- code_owners:
- - { import: jira/identities.yml, key: eng_identity.David_Sillman }
+ # "flow" syntax for importing a sub-key, "David_Sillman" inside "eng_identity"
+ code_owners:
+ - { import: jira/identities.yml, key: eng_identity.David_Sillman }
- # "flow" syntax for importing a sub-key using a merge key ("<<"),
- <<: { import: team_contexts/data.yml, key: resources.alerting_channels }
+ # "flow" syntax for importing a sub-key using a merge key ("<<"),
+ <<: { import: team_contexts/data.yml, key: resources.alerting_channels }
+
+ # "block" syntax for importing multiple subkeys from multiple files using a merge key,
+ <<:
+ - import: team_contexts/data_contacts.yml
+ key: contacts.email
+ - import: team_contexts/data_push_api.yml
+ key: push_api.contracts
+
- # "block" syntax for importing multiple subkeys from multiple files using a merge key,
- <<:
- - import: team_contexts/data_contacts.yml
- key: contacts.email
- - import: team_contexts/data_push_api.yml
- key: push_api.contracts
-```
Note that all paths for the `import` field are relative to the `content_schematics` folder for the project.
If you'd like to import the entire content of a file as context, you may omit the `key` field, e.g.:
@@ -347,6 +347,8 @@ Jinja namespace for the global Metadock environment, including all global macros
+html.bold|
metadock.env.MetadockHtmlNamespace.bold: (self, content: str) -> str| Wraps a string in HTML bold tags (<b></b>).
>>> from metadock.env import MetadockEnv| -|
>>> env = MetadockEnv().jinja_environment()
>>> env.from_string("{{ html.bold('This is bold text.') }}").render()
'This is bold text.'
html.code|
metadock.env.MetadockHtmlNamespace.code: (self, content: str) -> str| Wraps a string in HTML code tags (<code></code>).
>>> from metadock.env import MetadockEnv| -|
>>> env = MetadockEnv().jinja_environment()
>>> env.from_string("{{ html.code('This is code text.') }}").render()
'This is code text.
'
html.details|
metadock.env.MetadockHtmlNamespace.details: (self, *contents: str) -> str| Wraps a string in line-broken HTML details tags (<details></details>). Multiple arguments get separated by two line breaks.
>>> from metadock.env import MetadockEnv| -|
>>> env = MetadockEnv().jinja_environment()
>>> env.from_string("{{ html.details('This is details text.') }}").render()
'\nThis is details text.\n'
html.italic|
metadock.env.MetadockHtmlNamespace.italic: (self, content: str) -> str| Wraps a string in HTML italic tags (<i></i>).
>>> from metadock.env import MetadockEnv| -|
>>> env = MetadockEnv().jinja_environment()
>>> env.from_string("{{ html.italic('This is italic text.') }}").render()
'This is italic text.'
html.pre|
metadock.env.MetadockHtmlNamespace.pre: (self, content: str, indent: int = 0) -> str| Wraps a string in preformatted HTML pre tags (<pre></pre>), and indents the content by the given amount.
>>> from metadock.env import MetadockEnv| -|
>>> env = MetadockEnv().jinja_environment()
>>> env.from_string("{{ html.pre('This is code text.', indent = 4) }}").render()
'This is code text.'
html.summary|
metadock.env.MetadockHtmlNamespace.summary: (self, content: str) -> str| Wraps a string in line-broken HTML summary tags (<summary>\n\n</summary>).
>>> from metadock.env import MetadockEnv| -|
>>> env = MetadockEnv().jinja_environment()
>>> env.from_string("{{ html.summary('This is summary text.') }}").render()
'\nThis is summary text.\n '
html.underline|
metadock.env.MetadockHtmlNamespace.underline: (self, content: str) -> str| Wraps a string in HTML underline tags (<u></u>).
>>> from metadock.env import MetadockEnv| +|
>>> env = MetadockEnv().jinja_environment()
>>> env.from_string("{{ html.underline('This is underlined text.') }}").render()
'This is underlined text.'
html.bold|
metadock.env.MetadockHtmlNamespace.bold: (self, content: str) -> str| Wraps a string in HTML bold tags (<b></b>).
>>> from metadock.env import MetadockEnv| +|
>>> env = MetadockEnv().jinja_environment()
>>> env.from_string("{{ html.bold('This is bold text.') }}").render()
'<b>This is bold text.</b>'
html.code|
metadock.env.MetadockHtmlNamespace.code: (self, content: str) -> str| Wraps a string in HTML code tags (<code></code>).
>>> from metadock.env import MetadockEnv| +|
>>> env = MetadockEnv().jinja_environment()
>>> env.from_string("{{ html.code('This is code text.') }}").render()
'<code>This is code text.</code>'
html.details|
metadock.env.MetadockHtmlNamespace.details: (self, *contents: str) -> str| Wraps a string in line-broken HTML details tags (<details></details>). Multiple arguments get separated by two line breaks.
>>> from metadock.env import MetadockEnv| +|
>>> env = MetadockEnv().jinja_environment()
>>> env.from_string("{{ html.details('This is details text.') }}").render()
'<details>\nThis is details text.\n</details>'
html.italic|
metadock.env.MetadockHtmlNamespace.italic: (self, content: str) -> str| Wraps a string in HTML italic tags (<i></i>).
>>> from metadock.env import MetadockEnv| +|
>>> env = MetadockEnv().jinja_environment()
>>> env.from_string("{{ html.italic('This is italic text.') }}").render()
'<i>This is italic text.</i>'
html.pre|
metadock.env.MetadockHtmlNamespace.pre: (self, content: str, indent: int = 0) -> str| Wraps a string in preformatted HTML pre tags (<pre></pre>), and indents the content by the given amount.
>>> from metadock.env import MetadockEnv| +|
>>> env = MetadockEnv().jinja_environment()
>>> env.from_string("{{ html.pre('This is code text.', indent = 4) }}").render()
'<pre> This is code text.</pre>'
html.summary|
metadock.env.MetadockHtmlNamespace.summary: (self, content: str) -> str| Wraps a string in line-broken HTML summary tags (<summary>\n\n</summary>).
>>> from metadock.env import MetadockEnv| +|
>>> env = MetadockEnv().jinja_environment()
>>> env.from_string("{{ html.summary('This is summary text.') }}").render()
'<summary>\nThis is summary text.\n</summary>'
html.underline|
metadock.env.MetadockHtmlNamespace.underline: (self, content: str) -> str| Wraps a string in HTML underline tags (<u></u>).
>>> from metadock.env import MetadockEnv| +
>>> env = MetadockEnv().jinja_environment()
>>> env.from_string("{{ html.underline('This is underlined text.') }}").render()
'<u>This is underlined text.</u>'
html.escape|
metadock.env.MetadockHtmlNamespace.escape_filter: (self, content: str) -> str| Filter which escapes a string by replacing all HTML special characters with their HTML entity equivalents.
>>> from metadock.env import MetadockEnv| -|
>>> env = MetadockEnv().jinja_environment()
>>> env.from_string("{{ 'This is a paragraph.
' \| html.escape }}").render()
'<p>This is a paragraph.</p>'
html.inline|
metadock.env.MetadockHtmlNamespace.inline_filter: (self, content: str) -> str| Filter which inlines a string by replacing all newlines with HTML line-breaks <br> singleton tags.
>>> from metadock.env import MetadockEnv| +|
>>> env = MetadockEnv().jinja_environment()
>>> env.from_string("{{ 'This is a multi-line string.\nThis is the second line.\nAnd the third.' \| html.inline }}").render()
'This is a multi-line string.
This is the second line.
And the third.'
html.escape|
metadock.env.MetadockHtmlNamespace.escape_filter: (self, content: str) -> str| Filter which escapes a string by replacing all HTML special characters with their HTML entity equivalents.
>>> from metadock.env import MetadockEnv| +|
>>> env = MetadockEnv().jinja_environment()
>>> env.from_string("{{ '<p>This is a paragraph.</p>' \| html.escape }}").render()
'\<p\>This is a paragraph.\</p\>'
html.inline|
metadock.env.MetadockHtmlNamespace.inline_filter: (self, content: str) -> str| Filter which inlines a string by replacing all newlines with HTML line-breaks <br> singleton tags.
>>> from metadock.env import MetadockEnv| +
>>> env = MetadockEnv().jinja_environment()
>>> env.from_string("{{ 'This is a multi-line string.\nThis is the second line.\nAnd the third.' \| html.inline }}").render()
'This is a multi-line string.<br>This is the second line.<br>And the third.'