From d3a950c2745881987d102a7a472db54d22c603b2 Mon Sep 17 00:00:00 2001 From: David Sillman Date: Sun, 26 Nov 2023 09:13:19 -0800 Subject: [PATCH] escaping tags in readme block --- .metadock/content_schematics/jinja_helpers/md.yml | 2 +- .metadock/generated_documents/README.html | 2 +- .metadock/generated_documents/README.md | 2 +- README.md | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/.metadock/content_schematics/jinja_helpers/md.yml b/.metadock/content_schematics/jinja_helpers/md.yml index fd6226c..c820fe6 100644 --- a/.metadock/content_schematics/jinja_helpers/md.yml +++ b/.metadock/content_schematics/jinja_helpers/md.yml @@ -82,7 +82,7 @@ md: >>> env.from_string( ... "{{ md.tablehead('Column 1', 'Column 2', 'Column 3', bold = true) }}" ... ).render() - '| Column 1 | Column 2 | Column 3 |\n| --- | --- | --- |' + '| <b>Column 1</b> | <b>Column 2</b> | <b>Column 3</b> |\n| --- | --- | --- |' source_file: metadock/env.py method_name: metadock.env.MetadockMdNamespace.tablehead signature: "(self, *header_cells: str, bold: bool = False) -> str" diff --git a/.metadock/generated_documents/README.html b/.metadock/generated_documents/README.html index c69ef1e..127a668 100644 --- a/.metadock/generated_documents/README.html +++ b/.metadock/generated_documents/README.html @@ -438,7 +438,7 @@

Jinja macros

md.tablehead
metadock.env.MetadockMdNamespace.tablehead: (self, *header_cells: str, bold: bool = False) -> str
-Produces a Markdown table header from the given cells by joining each cell with pipes ("|") and wrapping the result in pipes, plus adding a header divider row. Cell contents have their pipes escaped with a backslash ("\"). To bold the header cell contents, supply bold = true.

>>> from metadock.env import MetadockEnv
>>> env = MetadockEnv().jinja_environment()
>>> env.from_string(
... "{{ md.tablehead('Column 1', 'Column 2', 'Column 3', bold = true) }}"
... ).render()
'| Column 1 | Column 2 | Column 3 |\n| --- | --- | --- |'
+Produces a Markdown table header from the given cells by joining each cell with pipes ("|") and wrapping the result in pipes, plus adding a header divider row. Cell contents have their pipes escaped with a backslash ("\"). To bold the header cell contents, supply bold = true.

>>> from metadock.env import MetadockEnv
>>> env = MetadockEnv().jinja_environment()
>>> env.from_string(
... "{{ md.tablehead('Column 1', 'Column 2', 'Column 3', bold = true) }}"
... ).render()
'| <b>Column 1</b> | <b>Column 2</b> | <b>Column 3</b> |\n| --- | --- | --- |'
md.tablerow
diff --git a/.metadock/generated_documents/README.md b/.metadock/generated_documents/README.md index 5a529a3..2ced957 100644 --- a/.metadock/generated_documents/README.md +++ b/.metadock/generated_documents/README.md @@ -429,7 +429,7 @@ The following macros are available in the md namespace: |
md.code
|
metadock.env.MetadockMdNamespace.code: (self, content: str) -> str
| Produces a Markdown inline code block from the given content by wrapping the string in graves ("\`").

>>> from metadock.env import MetadockEnv
>>> env = MetadockEnv().jinja_environment()
>>> env.from_string("{{ md.code('This is an inline code block.') }}").render()
'`This is an inline code block.`'
| |
md.codeblock
|
metadock.env.MetadockMdNamespace.codeblock: (self, content: str, language: str = '') -> str
| Produces a Markdown codeblock from the given content by wrapping the string in triple-graves ("\`\`\`"), and optionally specifies a language.

>>> from metadock.env import MetadockEnv
>>> env = MetadockEnv().jinja_environment()
>>> env.from_string("{{ md.codeblock('This is a codeblock.', language = 'sh') }}").render()
'```sh\nThis is a codeblock.\n```'
| |
md.list
|
metadock.env.MetadockMdNamespace.list: (self, *items: str) -> str
| Produces a Markdown list from the given content by prepending each line with a dash ("- "). If any of its arguments are, themselves, formatted as Markdown lists, then they are simply indented as sublists.

>>> from metadock.env import MetadockEnv
>>> env = MetadockEnv().jinja_environment()
>>> env.from_string(
... "{{ md.list('This is a list.', md.list('This is a sublist,', 'in two pieces.')) }}"
... ).render()
'- This is a list.\n - This is a sublist,\n - in two pieces.'
| -|
md.tablehead
|
metadock.env.MetadockMdNamespace.tablehead: (self, *header_cells: str, bold: bool = False) -> str
| Produces a Markdown table header from the given cells by joining each cell with pipes ("\|") and wrapping the result in pipes, plus adding a header divider row. Cell contents have their pipes escaped with a backslash ("\\"). To bold the header cell contents, supply `bold = true`.

>>> from metadock.env import MetadockEnv
>>> env = MetadockEnv().jinja_environment()
>>> env.from_string(
... "{{ md.tablehead('Column 1', 'Column 2', 'Column 3', bold = true) }}"
... ).render()
'\| Column 1 \| Column 2 \| Column 3 \|\n\| --- \| --- \| --- \|'
| +|
md.tablehead
|
metadock.env.MetadockMdNamespace.tablehead: (self, *header_cells: str, bold: bool = False) -> str
| Produces a Markdown table header from the given cells by joining each cell with pipes ("\|") and wrapping the result in pipes, plus adding a header divider row. Cell contents have their pipes escaped with a backslash ("\\"). To bold the header cell contents, supply `bold = true`.

>>> from metadock.env import MetadockEnv
>>> env = MetadockEnv().jinja_environment()
>>> env.from_string(
... "{{ md.tablehead('Column 1', 'Column 2', 'Column 3', bold = true) }}"
... ).render()
'\| <b>Column 1</b> \| <b>Column 2</b> \| <b>Column 3</b> \|\n\| --- \| --- \| --- \|'
| |
md.tablerow
|
metadock.env.MetadockMdNamespace.tablerow: (self, *row_cells: str) -> str
| Produces a Markdown table row from the given cells by joining each cell with pipes ("\|") and wrapping the result in pipes. Cell contents have their pipes escaped with a backslash ("\\").

>>> 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 \|'
| diff --git a/README.md b/README.md index 5a529a3..2ced957 100644 --- a/README.md +++ b/README.md @@ -429,7 +429,7 @@ The following macros are available in the md namespace: |
md.code
|
metadock.env.MetadockMdNamespace.code: (self, content: str) -> str
| Produces a Markdown inline code block from the given content by wrapping the string in graves ("\`").

>>> from metadock.env import MetadockEnv
>>> env = MetadockEnv().jinja_environment()
>>> env.from_string("{{ md.code('This is an inline code block.') }}").render()
'`This is an inline code block.`'
| |
md.codeblock
|
metadock.env.MetadockMdNamespace.codeblock: (self, content: str, language: str = '') -> str
| Produces a Markdown codeblock from the given content by wrapping the string in triple-graves ("\`\`\`"), and optionally specifies a language.

>>> from metadock.env import MetadockEnv
>>> env = MetadockEnv().jinja_environment()
>>> env.from_string("{{ md.codeblock('This is a codeblock.', language = 'sh') }}").render()
'```sh\nThis is a codeblock.\n```'
| |
md.list
|
metadock.env.MetadockMdNamespace.list: (self, *items: str) -> str
| Produces a Markdown list from the given content by prepending each line with a dash ("- "). If any of its arguments are, themselves, formatted as Markdown lists, then they are simply indented as sublists.

>>> from metadock.env import MetadockEnv
>>> env = MetadockEnv().jinja_environment()
>>> env.from_string(
... "{{ md.list('This is a list.', md.list('This is a sublist,', 'in two pieces.')) }}"
... ).render()
'- This is a list.\n - This is a sublist,\n - in two pieces.'
| -|
md.tablehead
|
metadock.env.MetadockMdNamespace.tablehead: (self, *header_cells: str, bold: bool = False) -> str
| Produces a Markdown table header from the given cells by joining each cell with pipes ("\|") and wrapping the result in pipes, plus adding a header divider row. Cell contents have their pipes escaped with a backslash ("\\"). To bold the header cell contents, supply `bold = true`.

>>> from metadock.env import MetadockEnv
>>> env = MetadockEnv().jinja_environment()
>>> env.from_string(
... "{{ md.tablehead('Column 1', 'Column 2', 'Column 3', bold = true) }}"
... ).render()
'\| Column 1 \| Column 2 \| Column 3 \|\n\| --- \| --- \| --- \|'
| +|
md.tablehead
|
metadock.env.MetadockMdNamespace.tablehead: (self, *header_cells: str, bold: bool = False) -> str
| Produces a Markdown table header from the given cells by joining each cell with pipes ("\|") and wrapping the result in pipes, plus adding a header divider row. Cell contents have their pipes escaped with a backslash ("\\"). To bold the header cell contents, supply `bold = true`.

>>> from metadock.env import MetadockEnv
>>> env = MetadockEnv().jinja_environment()
>>> env.from_string(
... "{{ md.tablehead('Column 1', 'Column 2', 'Column 3', bold = true) }}"
... ).render()
'\| <b>Column 1</b> \| <b>Column 2</b> \| <b>Column 3</b> \|\n\| --- \| --- \| --- \|'
| |
md.tablerow
|
metadock.env.MetadockMdNamespace.tablerow: (self, *row_cells: str) -> str
| Produces a Markdown table row from the given cells by joining each cell with pipes ("\|") and wrapping the result in pipes. Cell contents have their pipes escaped with a backslash ("\\").

>>> 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 \|'
|