-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
79 changed files
with
1,074 additions
and
114 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
update: all | ||
branch: develop | ||
schedule: "every week" | ||
schedule: "every day" | ||
label_prs: update |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
.. _beautify: | ||
|
||
Beautify | ||
####################################### | ||
|
||
**Processor name:** ``beautify`` | ||
|
||
The ``beautify`` processor is a post-processor that tidies and prettifies the HTML to give consistent and predictable output. The processor works by applying the prettify function from the ``beautifulsoup4`` library just before the final output, this means HTML elements will be separated onto individual lines where children are indented by one space. For example given the following document: | ||
|
||
.. literalinclude:: ../../../verto/tests/assets/beautify/doc_example_basic_usage.md | ||
:language: none | ||
|
||
Verto will prettify it into: | ||
|
||
.. literalinclude:: ../../../verto/tests/assets/beautify/doc_example_basic_usage_expected.html | ||
:language: html | ||
|
||
Special Case(s) | ||
*************************************** | ||
|
||
For example given the following Markdown: | ||
|
||
.. literalinclude:: ../../../verto/tests/assets/beautify/example_inline_code.md | ||
:language: none | ||
|
||
Verto with ``beautify`` enabled will produce the following html: | ||
|
||
.. literalinclude:: ../../../verto/tests/assets/beautify/example_inline_code_expected.html | ||
:language: html | ||
|
||
Where the ``code`` tag and its contents are unchanged to preserve formatting, this is especially important for whitespace dependent languages. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
.. _jinja: | ||
|
||
Jinja | ||
####################################### | ||
|
||
**Processor name:** ``jinja`` | ||
|
||
The ``jinja`` processor is a post-processor that is used to undo HTML escaping on Jinja/Django statements (i.e. ``{% ... %}``) that may be present in the document for further processing of the document after conversion. This processor does not do any sanitizing of the Jinja/Django statements and therefore should not be used on untrusted input without sanitation before or after the Verto conversion. This processor should be used with the :doc:`conditional` as the default HTML-template produces Jinja statements. | ||
|
||
For example the following document with an if statement: | ||
|
||
.. literalinclude:: ../../../verto/tests/assets/jinja/doc_example_basic_usage.md | ||
:language: html+jinja | ||
|
||
Verto will unescape the Jinja/Django statement and produce the following output: | ||
|
||
.. literalinclude:: ../../../verto/tests/assets/jinja/doc_example_basic_usage_expected.html | ||
:language: html+jinja |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
.. _remove: | ||
|
||
Remove | ||
####################################### | ||
|
||
**Processor name:** ``remove`` | ||
|
||
The ``remove`` processor is a post-processor that searches the document for remove HTML-elements (i.e. ``<remove>...</remove>``) and removes them from the document leaving the content unchanged. This is useful when creating HTML-templates as they can be used to add multiple siblings to a parent element that are not valid HTML, allowing the document to be parsed as a valid HTML-document up until their removal. | ||
|
||
.. note:: | ||
|
||
The ``remove`` processor does not remove the content between the remove element tags, but instead only removes the tag itself. | ||
|
||
For example the :doc:`conditional` processors default HTML template, as follows, does not produce valid HTML and so is placed within a remove element so that Verto can add it to the element tree. | ||
|
||
.. literalinclude:: ../../../verto/html-templates/conditional.html | ||
:language: html+jinja | ||
|
||
Therefore a Markdown document like: | ||
|
||
.. literalinclude:: ../../../verto/tests/assets/remove/doc_example_basic_usage.md | ||
:language: html+jinja | ||
|
||
When parsed with Verto will produce the output: | ||
|
||
.. literalinclude:: ../../../verto/tests/assets/remove/doc_example_basic_usage_expected.html | ||
:language: html+jinja |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
.. _scratch-compatibility: | ||
|
||
Scratch Compatibility | ||
####################################### | ||
|
||
**Processor name:** ``scratch-compatibility`` | ||
|
||
The ``scratch-compatibility`` processor is a pre-processor that is enabled by the :doc:`scratch` processor when the ``codehilite`` and ``fenced_code`` extensions are enabled. | ||
|
||
When both ``codehilite`` and ``fenced_code`` extensions are enabled the ``fenced_code`` extension modifies the fenced code-blocks by using methods from the ``codehilite`` extension before stashing them to be place in later in the document. The ``scratch-compatibility`` processor is therefore needed to stash the fenced code-blocks before ``fenced_code`` so that they can be processed properly by the :doc:`scratch` processor later. | ||
|
||
.. note:: | ||
|
||
We consider the ``codehilite`` and ``fenced_code`` extensions a bad way of writing extensions as the output of one dramatically changes depending on if the other is active. | ||
|
||
We believe that an extension like these should produce predictable output and handle compatibility through inputs. | ||
|
||
For example if the following Markdown document is processed using both the ``codehilite`` and ``fenced_code`` extensions | ||
|
||
.. literalinclude:: ../../../verto/tests/assets/scratch/example_multiple_codeblocks_2.md | ||
:language: none | ||
|
||
Verto will produce the following output (which is the same as the ``scratch`` processor would expect): | ||
|
||
.. literalinclude:: ../../../verto/tests/assets/scratch/example_multiple_codeblocks_expected_2.html | ||
:language: html |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
.. _style: | ||
|
||
Style | ||
####################################### | ||
|
||
**Processor name:** ``style`` | ||
|
||
The ``style`` processor is a pre-processor that checks that the input Markdown to enforce style rules. These rules include: | ||
|
||
- Processor tags have empty lines before and after. | ||
- Processor tags do not share a line with other text. | ||
|
||
An example of a valid document follows: | ||
|
||
.. literalinclude:: ../../../verto/tests/assets/style/doc_example_block_valid.md | ||
:language: none | ||
|
||
Error Example(s) | ||
************************************** | ||
|
||
.. note:: | ||
|
||
The examples covered in this section are invalid and will raise errors. | ||
|
||
The following examples raise errors because the processor tags do not have empty lines before and after. | ||
|
||
.. literalinclude:: ../../../verto/tests/assets/style/doc_example_block_whitespace.md | ||
:language: none | ||
|
||
.. literalinclude:: ../../../verto/tests/assets/style/doc_example_block_whitespace_1.md | ||
:language: none | ||
|
||
.. literalinclude:: ../../../verto/tests/assets/style/doc_example_block_whitespace_2.md | ||
:language: none | ||
|
||
.. literalinclude:: ../../../verto/tests/assets/style/doc_example_block_whitespace_3.md | ||
:language: none | ||
|
||
The following examples raise errors because the processor tags share a line with other text. | ||
|
||
.. literalinclude:: ../../../verto/tests/assets/style/doc_example_block_solitary.md | ||
:language: none | ||
|
||
.. literalinclude:: ../../../verto/tests/assets/style/doc_example_block_solitary_1.md | ||
:language: none |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
# flake8: noqa | ||
from .Verto import Verto | ||
|
||
__version__ = '0.4.1' | ||
__version__ = '0.5.0' |
Oops, something went wrong.